dhclient on a link shared with static IP addresses?
Don Cohen
don-dhclient at isis.cs3-inc.com
Tue Jan 15 08:55:32 UTC 2008
Don Cohen writes:
> I'm trying to use a single link to connect to two ISPs, one of
> which has assigned me a static address. For the other one I want
> to run dhclient. When dhclient gets the address it deletes my
> static address! Is there a way to tell it not to do that?
> I don't see anything in the doc about that.
> I can't be the first one who ever wanted to do this, can I?
After downloading and reading the source I think I've found a
solution.
I've changed dhclient-script to avoid using ifconfig.
ifconfig $interface inet 0 down
=>
ip addr del $old_ip_address dev $interface
(I've not seen that one used yet)
and the normal case that was causing me grief
ifconfig $interface inet $new_ip_address $new_subnet_arg $new_broadcast_arg
=> ip addr add ${new_ip_address}/$prefixlen $new_broadcast_arg dev $interface
where I compute $prefixlen from $new_subnet_mask
Perhaps this is how it should be in the distribution?
More information about the dhcp-hackers
mailing list