dhclient ignores received default router IP

dmoore dmoorelists at dslextreme.com
Mon Feb 12 21:09:24 UTC 2007


>>dhclient is written to do so via /sbin/dhclient-script, which contains a
>> function named add_default_gateway(). However the script never calls
>
>The stock dhclient-scripts don't have a function by that name, so
>I don't know what you're talking about.


I've learned how to make Fedora's dhclient variant apply the router
value supplied by dhcp.

Mr. Hankins, in case you you hear of this from other users, what Fedora
does with your dhclient program is to condition the setting of the
default gateway on an environment variable named IGNORE_DEFAULT_GATEWAY
(whether it begins with letter y). Configuring that, in turn, is to be
done by editing file /etc/sysconfig/network-scripts/ifcfg-eth0 (or
eth1/eth2/...). The default gateway that IGNORE_DEFAULT_GATEWAY is
talking about ignoring, is the one that is already set, if any, before
dhclient-script runs. So if you have one already set, and then you run
dhclient-script, dhclient-script doesn't want to disturb it so discards
any from the dhcp server. So you must explicitly "IGNORE" the exisitng
default gateway , otherwise the one from dhcp gets ignored. If you want
dhcp's, you have to say "go ahead, the one from dhcp has priority, it's
OK to remove the existing one" by configuring that environment variable.
That way their add_default_gateway() function gets called which contains
an "ip route..." to do the actual job.

None of the man pages that come in Fedora's dhclient package ("man
dhcp-client" in particular) address this. It gets mention elsewhere
(sysconfig.txt). The user becomes aware of this arrangement only if he
looks there, and grasps how to interpret "IGNORE_..."

I'll try to find a Fedora mailing list to deposit this same FYI in case
they think it could be documented differently.



More information about the dhcp-users mailing list