Link to home
Start Free TrialLog in
Avatar of touellette83
touellette83

asked on

Configuring 2 DHCP scopes, each for a different VLAN

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
ASKER CERTIFIED SOLUTION
Avatar of btassure
btassure
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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

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

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)
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.
Avatar of touellette83
touellette83

ASKER

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
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)
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

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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 $$$
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.
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.
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

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.
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
!
!
!
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