?
Solved

Configuring 2 DHCP scopes, each for a different VLAN

Posted on 2008-10-14
16
Medium Priority
?
6,429 Views
Last Modified: 2012-05-05
I have a WAN site which uses a Cisco 2811 Router, with several Cisco 3750 switches for LAN access.

At the site I have 2 VLANs configured..

VLAN 100 = Data  (172.21.10.0 /24)
VLAN 300 - Voice  (192.168.53.0 /24)

I want to configure 2 different DHCP scopes, one to assign the 172.21.10.0 subnet to the devices in the Data VLAN, and another to assign the 192.168.53.0 /24 subnet to devices on the Voice VLAN.

I can configure DHCP on either one of the switches or Router, I don't care either way. I am not sure how to do this properly, any config help would be appreciated..

Thanks,
Tim
0
Comment
Question by:touellette83
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 4
  • +1
16 Comments
 
LVL 16

Accepted Solution

by:
btassure earned 1000 total points
ID: 22716355
If you configure on the router you can do the following assuming that the router has interfaces or subinterfaces directly connected to the vlans in question. The router will detect the interface on which the dhcp request was received and respond with the corresponding pool.
If the router is at least one hop away from the vlan and can't receive the broadcast then on the router to which the vlan IS connected you would need to put in an ip helper:
ip helper-address [ip of the dhcp server] and it will again use the source address to determine the pool to use.
0
 
LVL 16

Expert Comment

by:btassure
ID: 22716364
Sorry, forgot to attach the code!
ip dhcp pool data
   network 172.21.10.0 255.255.255.0
   default-router [router ip]
   dns-server [dns ip]
!
ip dhcp pool voice
   network 192.168.53.0 255.255.255.0
   default-router [router ip]
   dns-server [dns ip]

Open in new window

0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 22716407
You're also going to need to exclude the addresses for the default-router in each pool. And any other addresses you don't want allocated.


ip dhcp excluded-address <start> <end>

Open in new window

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 16

Expert Comment

by:btassure
ID: 22716614
Doesn't the router automatically exclude itself? It must know it is using that address?
Please correct me if I'm wrong as I use this setup at home and it might actually explain a problem or two I have been having... :o)
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 22716778
No, the router doesn't "know" anything that you don't tell it. ;-)

I've never tried it without excluding itself. All the documentation I've read always show an exclude of it's own address.
0
 

Author Comment

by:touellette83
ID: 22716815
Thanks,

I will give it a shot tomorrow, I was not aware that the Router would be able to make a decision based on which interface/vlan the request comes from. That makes my life easy...

In my past experience you do need to exclude the Gateway IP, generally I leave 1-99 for Static IP's anyway, things like printers, WAPs etc...

Anyway, I will let you know how it goes, thanks again.

-Tim
0
 
LVL 16

Expert Comment

by:btassure
ID: 22719402
Cool. I'll take a look at my config as well then. DHCP is pretty clever with the source addressing. Took me hours of reading and testing to prove to myself that was how it worked as I couldn't get my ehad around how it knew which scope to use. :o)
0
 

Author Comment

by:touellette83
ID: 22734690
So far it works like a charm. I have subinterfaces on the router for each vlan with 2 different DHCP pools. The router recognizes which VLAN the request is comming from and assigns the correct subnet.

Now to make things more complex....

Consider this scenario...

I have my switch configured with the same 2 vlan's mentioned above, but now I have 1 (or multiple ports) of the switch configured to access both the VOIP and Data VLAN.

With this scenario I have one cable running from the switch port into the VOIP phone, then from the VOIP phone another cable hitting a PC.

PC accesses the DATA VLAN, and the phone access the VOIP VLAN.

My understanding of how this works is that the Phone is configured to access vlan 300 and passes everything else (in this scenario vlan 100).

I guess my question is, will the same config work in this scenario and still assign the PC the Data subnet, and the Phone the VOIP Subnet?
Here is an example of how the switch ports would be configured in the above scenario...
 
interface FastEthernet1/0/1
 description UPLINK TO ROUTER
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 100,300
 switchport mode trunk
!
interface FastEthernet1/0/2
 description Avaya_G700_8300_Gateway
 switchport access vlan 300
 speed 100
 duplex full
 down-when-looped
 spanning-tree portfast
!
interface FastEthernet1/0/3
 description SET FOR IP PHONES WITH DATA VLAN PASSTHROUGH
 switchport access vlan 100
 switchport mode access
 switchport voice vlan 300
 spanning-tree portfast
!
interface FastEthernet1/0/4
 description SET FOR IP PHONES WITH DATA VLAN PASSTHROUGH
 switchport access vlan 100
 switchport mode access
 switchport voice vlan 300
 spanning-tree portfast

Open in new window

0
 
LVL 50

Assisted Solution

by:Don Johnston
Don Johnston earned 1000 total points
ID: 22735196
>I guess my question is, will the same config work in this scenario and still assign the PC the Data subnet, and the Phone the VOIP Subnet?

Yes. The phone is essentially a 3 port switch. One port goes to the phone, one goes to the PC and the third port is a trunk to the switch.

So any traffic received from the PC is coming from whatever VLAN is identified with the "... access VLAN..." command and any traffic coming from the phone is coming from whatever VLAN is identified with the "... voice VLAN ..." command.

0
 

Author Closing Comment

by:touellette83
ID: 31506061
Thanks for the help guy's

This works out well, with this config I can cut my need for switch ports in half at my VOIP sites, saves a few $$$
0
 

Expert Comment

by:rsharmatgln
ID: 24764868
Hi,

We have somewhat similar setup.

- 3 stacked switches: 2 access (Ports connected to VOIP phones and then chained to PC)  and 1 distribution switch with all servers including DHCP.
- 2 Vlans: for Voice and Data
- routing is enabled between vlans and each port on access switch is member of both vlans
- DHCP relay is turned on and on DHCP server we have created 2 scopes with different IP subnets

The issue is How do we configure DHCP to assign IP addresses to PC from one scope and Phones from another?

Thanks.
0
 

Expert Comment

by:rsharmatgln
ID: 24764900
I forgot to mention.. When we turn on the phones they initially get IP from Voice subnet and then drops it and gets an IP from Data subnet and sticks with it. We need to configure it so Phones only get the IP offered from Voice scope and not data. Any suggestions will be helpful. Thanks.
0
 

Author Comment

by:touellette83
ID: 24765280
I had to use Option 176 in my DHCP scopes to make this work. This allows you to specify the VOIP VLAN and other optiosn the phone might need within with DHCP scope.

The code snipit attached works with Avya. Your VOIP vendor may have some documentation for you on this. (i got the option 176 code I used from Avya directly).

-Tim
p dhcp pool DATA
   network 172.21.6.0 255.255.255.0
   default-router 172.21.6.1
   dns-server 172.16.100.116 172.16.100.117
   domain-name domain.com
   option 176 ascii "L2Q=1,L2QVLAN=300,VLANTEST=0"
!
ip dhcp pool VOIP
   network 192.168.53.0 255.255.255.0
   default-router 192.168.53.1
   option 176 ascii "MCIPADD=192.168.50.22,192.168.50.23,L2QVLAN=300,TFTPSRVR=172.16.100.75"

Open in new window

0
 

Expert Comment

by:rsharmatgln
ID: 24781207
Thanks touellette83, How do we configure these options on Windows 2003 DHCP? On Cisco switch, all we did was enable DHCP relay. Windows 2003 DHCP does not give me option to configure 176 option.
0
 

Expert Comment

by:rsharmatgln
ID: 24781293
This is the config on our Switch for Vlan1 (Data) and Vlan200 (voice)

interface Vlan1
 ip address 192.168.250.83 255.255.255.0
!
interface Vlan200
 ip address 192.168.100.1 255.255.255.0
 ip helper-address 192.168.250.41
!
!
router rip
 version 2
 network 192.168.100.0
 network 192.168.250.0
!
ip classless
ip route 0.0.0.0 0.0.0.0 Vlan1 192.168.250.16
ip route 192.168.100.0 255.255.255.0 Vlan200
ip route 192.168.250.0 255.255.255.0 Vlan1
ip http server
!
!
!
0
 

Author Comment

by:touellette83
ID: 24782071
To Add Custom DHCP Options in Windows 2003....
Example would be for my above code on the Cisco...

After Opening DHCP on your server...
1. Right-click on the DHCP server.
2. Choose Predefined Options.
3. Select Add.
  Name: voip_options
  Data type: String
  Code: 176
  Description: IP Phone settings
5. Click OK.
6. Under the "string" you would add...
"MCIPADD=192.168.50.22,192.168.50.23,L2QVLAN=300,TFTPSRVR=172.16.100.75"
7. Save it and make sure the new option is selected in your scope...

*Note:*  My Option 176 settings are specific to Avya Gear. You should check with your vendor for specifics....

-Tim
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Cisco RV042 router is a popular small network interfacing device that is often used as an internet gateway. Network administrators need to get at the management interface to make settings, change passwords, etc. This access is generally done usi…
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question