Re: dhclient vs aliases

Paul Procacci <[email protected]>
Newsgroups gmane.os.freebsd.devel.net
Message-ID <CAFbbPui05DiO2WQf16extfKy866B54g9pk18xgR-q2y3v_=_OA@mail.gmail.com>
Re: https://forums.freebsd.org/threads/dhclient-trashing-alias-ip-address-upon-reconnect.58729/

You can use a dhclient.conf(5) entry like this to guarantee that the
alias is re-applied every time the interface gets a new address from
DHCP (or the old lease is re-applied):

Code:

          alias {
             interface "em0";
             fixed-address 10.0.0.3;
             option subnet-mask 255.255.255.0;
           }

On Mon, Jun 9, 2025 at 10:20 AM Andriy Gapon <[email protected]> wrote:
>
>
> Apologies if this is a FAQ and maybe it has always been like that but I've just
> noticed this.
>
> A switch needed to be rebooted, so on a FreeBSD host a link went down and then
> up on an interface connected to the switch.
> Apparently triggered by those events, dhclient decided to renew the interface's
> IP address. Afterwards, all alias IP addresses on that interface were cleared.
> Just in case, the new IP address was exactly the same as the old IP address
> (it's "hardwired" in the DHCP server configuration).
>
> This was unhelpful because the host runs a number of jails with a simple IP
> configuration via aliases.
>
> --
> Andriy Gapon
>
>


-- 
__________________

:(){ :|:& };:
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.