07-30-2013 04:37 AM - edited 03-07-2019 02:39 PM
Dear all,
How can i bind ip address to the respective mac address of a PC in a dhcp enabled network?
wat are all the commands to bind it?
Basically i know this command to bind ip address to the pc statically.
# ip dhcp excluded address xx.xx.xx.xx
i am expecting any other special commands to bind it.
Please do needful.
Advance in Thanks.
with regards,
Chandhuru.M
Solved! Go to Solution.
07-30-2013 05:10 AM
Hi,
the excluded-address command simply tells the DHCP server not to try to allocate these IP addresses, it means they are already statically assigned.
Now for MAC binding, you must do this:
1) not exclude this address
2) when DHCP dynamically assigned an IP to the device use this command to view the client-identifier:
show ip dhcp binding x.x.x.x where x.x.x.x is the allocated IP
3) take note of the client-identifier and delete the dynamic entry:
clear ip dhcp binding x.x.x.x
4) create a host pool for this IP:
ip dhcp pool host_pool
host x.x.x.x y.y.y.y.y where y.y.y.y is the subnet mask for the host
client-identifier 01xx.xxxx.xxxx.xx or hardware-address xxxx.xxxx.xxxx
the last command differs according to the client-identifier used where xxxx.xxxx.xxxx is the MAC address
Regards
Alain
Don't forget to rate helpful posts.
07-31-2013 02:22 AM
Hi,
yes it is doable in GNS3 but I don't think it is in PT though.
here I've got one router doing DHCP server and one host attached which is DHCP client:
1) I do my parent dynamic pool
R1(dhcp-config)#do sh run | s dhcp
no ip dhcp use vrf connected
ip dhcp pool mypool
network 10.0.0.0 255.255.255.0
default-router 10.0.0.254
2) let's verify our binding table
R1(dhcp-config)#do sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.1 01c2.020f.3800.00 Mar 02 2002 12:05 AM Automatic
3) let's clear the dynamic binding
R1(dhcp-config)#do clear ip dhcp binding 10.0.0.1
R1(dhcp-config)#do sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
4) let's create the host pool
R1(dhcp-config)#ip dhcp pool host_pool
R1(dhcp-config)#host 10.0.0.1 255.255.255.0
R1(dhcp-config)#client
R1(dhcp-config)#client-id
R1(dhcp-config)#client-identifier 01c2.020f.3800.00
5) let's renew on the client and verify our binding table again
R1(dhcp-config)#do sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.1 01c2.020f.3800.00 Infinite Manual
Regards
Alain
Don't forget to rate helpful posts.
07-30-2013 05:10 AM
Hi,
the excluded-address command simply tells the DHCP server not to try to allocate these IP addresses, it means they are already statically assigned.
Now for MAC binding, you must do this:
1) not exclude this address
2) when DHCP dynamically assigned an IP to the device use this command to view the client-identifier:
show ip dhcp binding x.x.x.x where x.x.x.x is the allocated IP
3) take note of the client-identifier and delete the dynamic entry:
clear ip dhcp binding x.x.x.x
4) create a host pool for this IP:
ip dhcp pool host_pool
host x.x.x.x y.y.y.y.y where y.y.y.y is the subnet mask for the host
client-identifier 01xx.xxxx.xxxx.xx or hardware-address xxxx.xxxx.xxxx
the last command differs according to the client-identifier used where xxxx.xxxx.xxxx is the MAC address
Regards
Alain
Don't forget to rate helpful posts.
07-30-2013 10:09 PM
Dear cadet alain,
Really thanks for your kind reply.
I had one question. If u dont mind,please tell me is there any chance to do it in emulators like Packet Tracer or GNS3.
If so help or guide me through that with small sample network. If you can.
Advance in thanks.
With thanks and regards,
Chandhuru.M
07-31-2013 02:22 AM
Hi,
yes it is doable in GNS3 but I don't think it is in PT though.
here I've got one router doing DHCP server and one host attached which is DHCP client:
1) I do my parent dynamic pool
R1(dhcp-config)#do sh run | s dhcp
no ip dhcp use vrf connected
ip dhcp pool mypool
network 10.0.0.0 255.255.255.0
default-router 10.0.0.254
2) let's verify our binding table
R1(dhcp-config)#do sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.1 01c2.020f.3800.00 Mar 02 2002 12:05 AM Automatic
3) let's clear the dynamic binding
R1(dhcp-config)#do clear ip dhcp binding 10.0.0.1
R1(dhcp-config)#do sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
4) let's create the host pool
R1(dhcp-config)#ip dhcp pool host_pool
R1(dhcp-config)#host 10.0.0.1 255.255.255.0
R1(dhcp-config)#client
R1(dhcp-config)#client-id
R1(dhcp-config)#client-identifier 01c2.020f.3800.00
5) let's renew on the client and verify our binding table again
R1(dhcp-config)#do sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.1 01c2.020f.3800.00 Infinite Manual
Regards
Alain
Don't forget to rate helpful posts.
07-31-2013 03:08 AM
Dear cadet alain,
Really thanks for your kind reply. I got cleared on these topic. Thanks thanks alot. It was very appreciable.
.
Thank you.
With Thanks and regards,
Chandhuru.M
04-07-2015 07:15 PM
if i have multiple device need to bind to specific ip address. What should I do ?
Create multiple dhcp pool ?
12-06-2021 11:05 PM
I am getting following error so now what to do as i also want to bind mac address with ip
"% this command may not be used with network, origin , vrf or relay pools"
07-03-2019 08:21 AM
Hi, I understand this is an old post but I wanted to know what's the reason for not excluding the ip that we're biding to a MAC?
09-05-2022 03:07 AM
thanks a lot
how can I set100 user IP with DHCP service using client`s MAC addresses?
I mean, to create some kind of list with clients MAC address and tell the router to send them this specific IP address
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