cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
27611
Views
26
Helpful
8
Replies

How can i bind ip address to the respective mac address of a PC?

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

Thanks and regards, Chandhuru.M
2 Accepted Solutions

Accepted Solutions

cadet alain
VIP Alumni
VIP Alumni

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.

Don't forget to rate helpful posts.

View solution in original post

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.

Don't forget to rate helpful posts.

View solution in original post

8 Replies 8

cadet alain
VIP Alumni
VIP Alumni

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.

Don't forget to rate helpful posts.

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

Thanks and regards, Chandhuru.M

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.

Don't forget to rate helpful posts.

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

Thanks and regards, Chandhuru.M

if i have multiple device need to bind to specific ip address. What should I do ?

Create multiple dhcp pool ?

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"

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? 

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

Review Cisco Networking products for a $25 gift card