Re: dhclient multiple aliases limitation



On Tue, Aug 28, 2007 at 03:51:25PM -0500, Sean C. Farley wrote:
I currently have a setup on a laptop where I have two aliases that I
always want present. I would like to setup two aliases in
/etc/dhclient.conf to handle having the Ethernet cable plugged in after
boot, but dhclient has a limit of handling only one alias.

/etc/rc.conf
ifconfig_xl0="DHCP"
ifconfig_xl0_alias0="inet 192.168.1.46 netmask 255.255.255.255"
ifconfig_xl0_alias1="inet 192.168.6.46 netmask 255.255.255.0"

The first address uses an alias-type netmask while the second is a
private network I have for QEMU.

I found that during PREINIT /sbin/dhclient-script is deleting the
192.168.1.46 address when it runs this:

ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255
up

A possible solution that works for me is to add an "alias" to this line.
It appears to work, but I do not know if this would cause problems
elsewhere or for other scenarios. Does anyone see any problems with
this change?

Off hand this sounds correct. We really want dhclient to leave any
addresses other than ones it sets alone so always using alias directives
is probably correct.

-- Brooks

Sean

P.S. Please Cc me since I am not on this list.
--
scf@xxxxxxxxxxx

Content-Description: dhclient-script patch
--- /sbin/dhclient-script 2006-05-12 22:24:00.000000000 -0500
+++ /etc/dhclient-script 2007-08-28 15:25:30.000000000 -0500
@@ -223,7 +223,7 @@

PREINIT)
delete_old_alias
- ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up
+ ifconfig $interface inet 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 alias up
;;

ARPCHECK|ARPSEND)

_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"

Attachment: pgppwc7f1uMcP.pgp
Description: PGP signature



Relevant Pages

  • Networking problems in Fedora Core 2
    ... I have a network profile "Home" which has a device ... named "Home" that maps to eth1:1 (eth1 is my builtin wireless card). ... IP address, and then when I brought one of the aliases up, that would ... The first, and most infuriating, is that the "new" dhcp client dhclient, ...
    (Fedora)
  • Re: kern/87506 : [PATCH] Fix alias support on vr interfaces
    ... >> and an alias IP for a jail running on the system, ... it seems to be an issue with dhclient. ... If I turn dhclient off and ...
    (freebsd-current)
  • FreeBSD laptop annoyance
    ... just passing it along to other laptop users. ... bothering to run dhclient!? ... a laptop that isn't always connected to a network EVERY time you boot, ... it finds a connection it will then try to run dhclient. ...
    (comp.unix.bsd.freebsd.misc)
  • recent GIANT changes causes panic in ifconf()
    ... System panics while boot on interface configuration from dhclient for ... Starting dhclient ... page fault while in kernel mode ... Such panic happens only on boot, if I load if_wi.ko after boot and then ...
    (freebsd-current)
  • Re: 6.0 RC1 dhclient (was Re: 6.0 RC1 usbd.conf (and installation comments))
    ... aliases don't work with dhclient at the moment for ... >> most interfaces because the interfaces generate bogus link events when ... >> aliases are modified. ... we do plan to fix this despite the fact that such ...
    (freebsd-stable)