cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
982
Views
5
Helpful
2
Replies

DHCP Pools assigned to a specific switch port

DEENA VERAPPAN
Level 1
Level 1

Hi All, Looking for some information and help regarding setting up DHCP on a switch. I have 4 dhcp pools setup, each pool is for a specific host, with a single address, tied to the MAC address of the device. Is there a way to tie each DHCP pool to a specific switch port.

Example:

ip dhcp pool Device1
 host 192.168.45.2 255.255.255.255
 hardware-address abab.1111.2a2a
 default-router 192.168.45.1
 domain-name yes.com
 lease infinite
   cip instance 1
!
ip dhcp pool Device2
 host 192.168.45.3 255.255.255.255
 hardware-address a1a1.b2b2.c1d1
 default-router 192.168.45.1
 domain-name yes.com
 lease infinite
   cip instance 2
!
ip dhcp pool Device3
 host 192.168.45.4 255.255.255.255
 default-router 192.168.45.1
 domain-name yes.com
 lease infinite
   cip instance 3
!
Device1->port 1

Device2->port 2

Device3->port 3

 

I would like to ensure that Device1 will only get an ip address from DHCP pool Device1 if its connected to port 1. It will not get an address if it's connected to any other port.

 

Is this possible?

 

Any help and/or suggestions is appreaciated.

 

Cheers

Deena

 

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

There 2 steps you need to do.

 

1. You need to confgure port with mac sticky - if any device connected to this port not going to work. (other than mentioned MAC)

2. reserve the IP addres from exluded pool

 

1   on the interface configure 

switchport port-security mac-address sticky xxxxxxxxxx --< xxx is your mac address

 2

 ip dhcp pool BB
host 192.168.1.9 255.255.255.0
hardware-address MACADDRESS
client-name balaji-bandi ( pc name)
default-router 192.168.1.1
domain-name bb.com
dns-server 8.8.8.8

   

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Thanks BB, for the prompt response.

Review Cisco Networking for a $25 gift card