DHCP Static Binding on Cisco IOS

Thanks for the info Rene
As always complete posts!

how to reserve a single ip for pc in router ? ?

That is exactly what this lesson is about…

Hi Rene

I have some challenges with CCNA R&S lab about DHCP/DHCP relay.The lab number is 10.1.3.3 assuming that you have access to the new CCNA R&S oficial course…
The lab has two clients, two intermediary routers and another router connected to the intermediary routers via serials.
Intermediary router are R1 and R3, the central router is R2.
To R2 are connected via Ethernet GIgabit interfaces a DNS Seriver and the ISP
The lab tell me to do the R2 a dhcp server for the two PC’s connected to the intermediary routers R1 and R2 so they receive an IP…
The challenge is i just can’t get the “ip helper addresses” correct for R1 and R3 to relay the DHCP ip allocation from R2…Neither here or in your book i found what i am looking for…

Thank you

Hi Catalin,

Your message wasn’t deleted but not approeved before, I do this manually because of spam. I think this example should help you:

http://networklessons.com/network-services/cisco-ios-dhcp-relay-agent/

If not, let me know.

Rene

Awesome Post!!!

Thanks Jose!

Hello Rene,

Is the client-identifier configured on the dhcp server is not the mac address of the dhcp client? Is it a different value?(real world)

I tried to configure the “ip address dhcp client-id fa0/0” on the dhcp client but it’s not getting the correct ip im expecting. I already have a dhcp pool for it on the dhcp server.:

DHCP SERVER:

R1#SHOW RUN | sec ip dhcp
no ip dhcp use vrf connected
ip dhcp pool DONDRUJA
   network 192.168.1.0 255.255.255.0
   default-router 192.168.1.1
   option 150 ip 192.168.1.1
   dns-server 8.8.8.8
   lease 2
ip dhcp pool PC2
   host 192.168.1.100 255.255.255.0
   client-identifier 2222.2222.2222
ip dhcp pool R3
   host 192.168.1.200 255.255.255.0
   hardware-address 4444.4444.4444

R2:

R2#SHOW RUN INT FA0/0
Building configuration...

Current configuration : 136 bytes
!
interface FastEthernet0/0
 mac-address 2222.2222.2222
 ip address dhcp client-id FastEthernet0/0
 no ip route-cache
 duplex half
end

Hi Don,

It’s probably the DHCP client that is bugging you. Take a look here:

https://networklessons.com/network-services/cisco-ios-dhcp-client-identifier/

Rene

Hi Rene,

For the DHCP client in cisco router, there’s option to put the hostname. What the purpose to put the hostname?

R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address dhcp client-id fastEthernet 0/0 hostname R1

Davis

Hi Davis,

You could use this as an identifier. The DHCP server could be configured to assign an IP address based on the hostname.

Rene

Can you configure multiple static bindings in the same pool?

Hello Chris

Yes you can. Just add additional host commands within the DHCP pool.

I hope this has been helpful!

Laz

Something else I just noticed - it seems Windows 7 will prepend “01” on to the start of the MAC as the client identifier

Hello Chris.

Yes, this is the case. Windows 7 as well as other operating systems as well as firmwares of network devices will implement a client identifier based on RFC4361.

I hope this has been helpful!

Laz

Hii Rene,

i used static binding in dhcp server, but i didnot received Ip address which i desired at Client.Below is my example.

R1(Client)–> R2(DHCP Server)

R1#show running-config interface fastEthernet 0/0
Building configuration...

Current configuration : 101 bytes
!
interface FastEthernet0/0
 ip address dhcp client-id FastEthernet0/0
 speed auto
 duplex auto
end
R1#show interfaces fastEthernet 0/0 | include bia
  Hardware is i82543 (Livengood), address is ca01.33d0.0008 (bia ca01.33d0.0008)
R1#
R2#show running-config | sec dhcp
ip dhcp pool mypool
 host 192.168.1.100 255.255.255.0
 client-identifier ca01.33d0.0008
 domain-name www.chandu.com
 default-router 192.168.1.1

R2#show ip dhcp pool
Pool mypool :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 1
 Leased addresses               : 1
 Excluded addresses             : 1
 Pending event                  : none
 0 subnet is currently in the pool :
 Current index        IP address range                    Leased/Excluded/Total
 192.168.1.100        192.168.1.100    - 192.168.1.100     1     / 1     / 1
R2#

Thanks & Regards,
Chandra

Hello Chandra

At first glance, your configurations look good. What IP address is your client getting? Based on the configuration the DHCP server should only be providing a single IP address, and it should only provide it to the client with the MAC address of that particular interface. It should either be getting the right IP address, or not IP address at all. If you are getting a different IP address, then you must have another DHCP server somewhere on your network.

I suggest you also try to hardwire the client ID using the MAC address of the interface like so:

ip address dhcp client-id ca01.33d0.0008

You can also take a look at the debugs to see what client ID is being used, and how the DHCPDISCOVER and DHCPOFFER messages are being sent. This will give you the information of why you’re not getting the expected results.

Test it out and let us know your results!

I hope this has been helpful!

Laz

Hii,

i didnot received any ip address on R1. and ip address dhcp client-id ca01.393c.0008 is not working.

R1(config)#interface fastEthernet 0/0
R1(config-if)#no ip address dhcp client-id fastEthernet 0/0
R1(config-if)#ip address dhcp client-id ca01.393c.0008
                                        ^
% Invalid input detected at '^' marker.

R1#show ip int brief | include up
FastEthernet0/0        unassigned      YES unset  up                    up
R1#
R2#  show ip dhcp binding
Bindings from all pools not associated with VRF:
IP address      Client-ID/              Lease expiration        Type       State      Interface
                Hardware address/
                User name
192.168.1.100   ca01.393c.0008          Infinite                Manual     Selecting  Unknown
R2#sh
R2#show ip dhcp
R2#show ip dhcp pool

Pool mypool :
 Utilization mark (high/low)    : 100 / 0
 Subnet size (first/next)       : 0 / 0
 Total addresses                : 1
 Leased addresses               : 1
 Excluded addresses             : 1
 Pending event                  : none
 0 subnet is currently in the pool :
 Current index        IP address range                    Leased/Excluded/Total
 192.168.1.100        192.168.1.100    - 192.168.1.100     1     / 1     / 1
R2#



R2#SHow RUNning-config
Building configuration...

Current configuration : 2205 bytes
!
! Last configuration change at 22:08:56 UTC Tue Feb 18 2020
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
ip dhcp pool mypool
 host 192.168.1.100 255.255.255.0
 client-identifier ca01.393c.0008
 domain-name www.chandu.com
!
!
!
no ip domain lookup
ip cef
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 speed auto
 duplex auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet1/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet1/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet2/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet2/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet3/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet3/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet4/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet4/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface Ethernet5/0
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/1
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/2
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/3
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/4
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/5
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/6
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/7
 no ip address
 shutdown
 duplex full
!
interface FastEthernet6/0
 no ip address
 shutdown
 duplex full
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
!
end
###########################################
R1#show run
R1#show running-config
Building configuration...

Current configuration : 2064 bytes
!
! Last configuration change at 22:15:02 UTC Tue Feb 18 2020
!
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
ipv6 multicast rpf use-bgp
no ipv6 cef
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 speed auto
 duplex auto
!
interface FastEthernet0/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet1/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet1/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet2/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet2/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet3/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet3/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet4/0
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface FastEthernet4/1
 no ip address
 shutdown
 speed auto
 duplex auto
!
interface Ethernet5/0
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/1
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/2
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/3
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/4
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/5
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/6
 no ip address
 shutdown
 duplex full
!
interface Ethernet5/7
 no ip address
 shutdown
 duplex full
!
interface FastEthernet6/0
 no ip address
 shutdown
 duplex full
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
line con 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line aux 0
 exec-timeout 0 0
 privilege level 15
 logging synchronous
 stopbits 1
line vty 0 4
 login
!
!
end

Hello Chandra

Yes you are correct, that was my mistake. You cannot explicitly state the MAC address of the interface to be used as a client ID. You can either use the long string of characters that identify the client, or use the interface as a keyword to send the MAC address as the client ID.

I tried labbing up the scenario and I find the following. I am running the command:

R1(config-if)#ip address dhcp client-id GigabitEthernet 0/1

My MAC address of this interface is fa16.3e5d.5fe6. However, when I debug DHCP packets and see what client ID is being sent by the host I see: 01fa.163e.5d5f.e6. It seems the DHCP adds two hex digits of 01 at the beginning of the MAC address to use as the client ID. Remember that the client ID can really be anything, including a DNS name if you configure it that way.

So by using the 01fa.163e.5d5f.e6 value in the client-identifier command in the DHCP server, I was able to have the host obtain the IP address I wanted.

I suggest you try enabling the debugging on the DHCP server as shown in the lesson, to see the actual identifier being used, and copy and past that as the identifier in the DHCP pool.

I hope this has been helpful!

Laz

Thanks Laz. Its working now.