02-08-2019 03:43 PM - edited 03-08-2019 05:17 PM
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
02-08-2019 04:09 PM - edited 02-08-2019 04:09 PM
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
02-12-2019 12:09 PM
Thanks BB, for the prompt response.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide