1

I have two Cisco 2960 switches, connected by a trunk, with all ports on VLAN1. I've setup one switch to have DHCP Server Port-Based Address Allocation, such that a client connected to port X always gets the same address. I'd like to setup the second switch with a second address pool, also using port-based address allocation. When I try this, it appears client requests are trunked to the first switch and a non-reserved address from the pool on the first switch is leased to the client on the second switch.

Cisco has a note under the header: Preassigning IP Addresses and Associating Them to a Client here. It states "When the DHCP Server Port-Based Address Allocation feature is configured on multiple switches, devices connected to one switch may also receive an IP address assignment from the neighboring switches rather than the local DHCP address pool switch. If you want the switch to serve only the client directly connected to the switch, you can configure a group of switches with pools that share a common IP subnet and ignore the requests from other clients (not connected to this switch)."

What I can't understand is the last part "ignore the requests from other clients" - I'm not sure how to configure this. In the context of configuring the address pool, I've tried the reserved-only command in hopes that non-reserved addresses in the pool on my first switch wouldn't be leased to clients on the second switch; however I still get an address from the first pool.

My configuration for the pools between the 2 switches is basically:

On switch 1:

ip dhcp use subscriber-id client-id
ip dhcp pool pool1
network 192.168.1.0 255.255.0.0
...
address 192.168.1.50 client-id "Gi1/0/1" ascii
address 192.168.1.51 client-id "Gi1/0/2" ascii
...

On switch 2:

ip dhcp use subscriber-id client-id
ip dhcp pool pool2
network 192.168.2.0 255.255.0.0
...
address 192.168.2.51 client-id "Gi1/0/2" ascii
address 192.168.2.52 client-id "Gi1/0/3" ascii
...

When I connect a client to port 2 on switch 2, I would expect to receive 192.168.2.51. Instead I am receiving a 192.168.1.x address from pool1 on switch 1.

Any ideas how to configure the 2 switches such that I get my desired behavior?

  • Use port-based VLANs (Make VLANs, allocate ports to them). Then make the DHCP pools per each VLAN. This is guaranteed to work. – Overmind Feb 24 '21 at 13:09
  • Thanks, can give it a try. Wasn't sure how much capability I had routing between multiple VLANs on the 2960s - I have set sdm prefer lanbase-routing though. My end goal is to have a single host that acts as a controller on switch 1 that is capable of talking with any other host on switch 1 or switch 2. – stratocaster_master Feb 24 '21 at 14:01
  • Routing will work, you only need ip routing enabled. – Overmind Feb 25 '21 at 07:51
  • I was able to get this working with a single VLAN. I just hadn't followed the directions from Cisco that I posted, particularly: "you can configure a group of switches with pools that share a common IP subnet". Once I used the same subnet for each pool, I got my desired behavior. – stratocaster_master Mar 01 '21 at 12:15

0 Answers0