Static DHCP assignment for clients without client-id
A while ago I've installed Fedora Linux on one of my workstations and spent enormous amount of time trying to give it a static IP address from the Cisco IOS DHCP server. I though I was the only one dumb enough to have this problem, so I didn’t document my solution, but then one of the readers made a comment to the Assigning server IP addresses with DHCP post describing almost identical symptoms:
I have a hp2300n and I want to make a static IP assignment with DHCP. Nothing is working: hardware-address, client-identifier, no prepend, 01 prepend, 00 prepend.
In my case, the Fedora DHCP client did not send any DHCP client-ID in the DHCPREQUEST message. One would think that the IOS DHCP server would use the MAC address as the client-ID, but that's not the case. You have to configure the hardware-address parameter in the host DHCP pool to match the MAC address of the DHCP client with the pool and the static IP address:
ip dhcp pool fedi
host 192.168.200.206 255.255.255.240
hardware-address 000f.fe83.bca9
dns-server 208.67.220.220 208.67.222.222
This article is part of You've asked for it series.
3 comments:
For most of the modern linux distributions, you can use /etc/dhcp3/dhclient.conf to send whatever client-id you want to the dhcp server. This way you do not have to change the configuration when you replace your server's or desktop's network card.
I added the following line to the conf file;
send dhcp-client-identifier 01:xx:xx:xx:xx:xx:xx (Replace xx with the mac address you want to use)
My preffered way to solve this problem is define dynamic DHCP pool then look into
show ip dhcp server bindings
to know how the client was recognized.
@selcuk: this is what I've tried to do, but for whatever reason, my dhclient.conf file worked while the machine was running but got ignored/overwritten (I don't remember which one any more) during the boot process. After a few hours, I gave up and found an IOS solution (after all, I'm a router-, not a Linux person :)
@anonymous: that's exactly what I'm doing, but if you see just the MAC address without the 01. prefix in the bindings, you don't know whether it's a host with broken Client-ID calculation (that happens as well) in which case you copy the value in client-id parameter, or a host not using the Client-ID at all forcing you to use hardware-address parameter.
Post a Comment