1

I have a layer three switch connected to four layer 2 switches with multiple PCs connected to them. Each interface has its own IP assigned as well as an associated DHCP pool, however, the PCs are pulling IPs from random pools. I am running the following config:

!
interface FastEthernet0/10
 no switchport
 ip address 192.168.4.1 255.255.255.0 
 duplex auto
 speed auto
!
interface FastEthernet0/11
 no switchport
 ip address 192.168.0.1 255.255.254.0
 duplex auto
 speed auto
!
interface FastEthernet0/12
 no switchport
 ip address 192.168.6.1 255.255.255.240
 duplex auto
 speed auto
!
interface FastEthernet0/13
 no switchport
 ip address 192.168.5.1 255.255.255.0
 duplex auto
 speed auto
!

ip dhcp pool HQSwitch1Pool
network 192.168.4.0 255.255.255.0
!
ip dhcp excluded-address 192.168.4.1

ip dhcp pool HQSwitch2Pool
 network 192.168.0.0 255.255.254.0
!
ip dhcp excluded-address 192.168.0.1

ip dhcp pool HQSwitch3Pool
 network 192.168.6.0 255.255.255.240
!
ip dhcp excluded-address 192.168.6.1

ip dhcp pool HQSwitch4Pool
 network 192.168.5.0 255.255.255.0
!
ip dhcp excluded-address 192.168.5.1
!

Any help would be appreciated

  • ip helper address. However, in my humble opinion this design is not optimal - it's overengineered. Simply have a flat layer 2 network unless you have a gazillion Ethernet ports. This way you can easily assign any port on your network to any VLAN you want at any time (e.g. hey can you give me an port on the dmz at my desk, or hey can you give put this port in VLAN x). Ideally, have cross-chassis etherchannel between access switches and aggregation switches. KISS principle. – Ron Royston May 4 '15 at 2:57
  • Please add: on which one of your 4 networks do PC get IP out of range? Which IP do they get? Do you have any other DHCP server in your network? Where are they? – dan Jun 3 '15 at 12:39
  • Can you find the mac-address of a client getting an address from an unexpected pool and post the result of a 'show mac-address-table address x:x:x'? – cpt_fink Jun 4 '15 at 4:47
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 11 '17 at 16:23
1

I wish I could comment, as this is not really an answer; more of a troubleshooting technique.

Since this is a multi-layer switch, try moving your IP addressing to virtual interfaces instead of assigning them directly to the switchports.

Your config would look like:

interface vlan 100
 description "HQ-Switch-1 Gateway"
 ip address 192.168.4.1 255.255.255.0
!
interface vlan 200
 description "HQ-Switch-2 Gateway"
 ip address 192.168.0.1 255.255.255.0
!
interface vlan 300
 description "HQ-Switch-3 Gateway"
 ip address 192.168.6.1 255.255.255.240
!
interface vlan 400
 description "HQ-Switch-4 Gateway"
 ip address 192.168.5.1 255.255.255.0
!
interface FastEthernet0/10
 switchport mode access
 switchport access vlan 100
!
interface FastEthernet0/11
 switchport mode access
 switchport access vlan 200
!
interface FastEthernet0/12
 switchport mode access
 switchport access vlan 300
!
interface FastEthernet0/13
 switchport mode access
 switchport access vlan 400
!
ip dhcp excluded-address 192.168.0.1
ip dhcp excluded-address 192.168.4.1
ip dhcp excluded-address 192.168.6.1
ip dhcp excluded-address 192.168.5.1
!
ip dhcp pool HQSwitch1Pool
network 192.168.4.0 255.255.255.0
!
ip dhcp pool HQSwitch2Pool
 network 192.168.0.0 255.255.254.0
!
ip dhcp pool HQSwitch3Pool
 network 192.168.6.0 255.255.255.240
!
ip dhcp pool HQSwitch4Pool
 network 192.168.5.0 255.255.255.0
!

Honestly, assuming f0/10-13 are plugged into other switches, you should use 802.1q trunking instead of running them as access ports (as you are doing currently anyway.)

Then, use your other switches to assign individual ports to the appropriate vlan. Here the interface range command is your friend.

-1

In addition to what Rowshi said, you could also add the default-router command to your pools. This will point the DHCP request to the virtual interface ip address.

your config would look like this:

interface vlan 100
description "HQ-Switch-1 Gateway"
ip address 192.168.4.1 255.255.255.0
!
interface vlan 200
description "HQ-Switch-2 Gateway"
ip address 192.168.0.1 255.255.255.0
!
interface vlan 300
description "HQ-Switch-3 Gateway"
ip address 192.168.6.1 255.255.255.240
!
interface vlan 400
description "HQ-Switch-4 Gateway"
ip address 192.168.5.1 255.255.255.0
!
interface FastEthernet0/10
switchport mode access
switchport access vlan 100
!
interface FastEthernet0/11
switchport mode access
switchport access vlan 200
!
interface FastEthernet0/12
switchport mode access
switchport access vlan 300
!
interface FastEthernet0/13
switchport mode access
switchport access vlan 400
!
ip dhcp excluded-address 192.168.0.1
ip dhcp excluded-address 192.168.4.1
ip dhcp excluded-address 192.168.6.1
ip dhcp excluded-address 192.168.5.1
!
ip dhcp pool HQSwitch1Pool
network 192.168.4.0 255.255.255.0
default-router 192.168.4.1
!
ip dhcp pool HQSwitch2Pool
network 192.168.0.0 255.255.254.0
default-router 192.168.0.1
!
ip dhcp pool HQSwitch3Pool
network 192.168.6.0 255.255.255.240
default-router 192.168.6.1
!
ip dhcp pool HQSwitch4Pool
network 192.168.5.0 255.255.255.0
default-router 192.168.5.1
!
  • The default-router option is how you tell the DHCP client what their default gateway should be. It has nothing to do with the DHCP request. – cpt_fink Jun 4 '15 at 3:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.