Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Aug 2007 15:51:25 -0500 (CDT)
From:      "Sean C. Farley" <scf@FreeBSD.org>
To:        freebsd-net@FreeBSD.org
Cc:        "Sean C. Farley" <scf@FreeBSD.org>
Subject:   dhclient multiple aliases limitation
Message-ID:  <alpine.BSF.0.999.0708281533210.2740@thor.farley.org>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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?

Sean

P.S.  Please Cc me since I am not on this list.
-- 
scf@FreeBSD.org
[-- Attachment #2 --]
--- /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)

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.0.999.0708281533210.2740>