Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jan 2017 13:19:24 +0100
From:      "Nagy, Attila" <bra@fsn.hu>
To:        freebsd-net@freebsd.org
Subject:   Re: Interface cannot change link addresses - switching IP from one IF to another on a netbooted machine
Message-ID:  <ff03ad9e-1de9-1ad7-953e-86ff15cbe62f@fsn.hu>
In-Reply-To: <578F4AB6.2090200@fsn.hu>
References:  <578F4AB6.2090200@fsn.hu>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Following up on this, placing the script into /etc/rc.conf.lagg and 
configuring/including it in rc.conf with:

lagg_dev="lagg0"
lagg_devs="igb0 igb1 igb2 igb3"

Solves the issue.

if [ -n "${lagg_dev}" ]; then
     /sbin/ifconfig "${lagg_dev}" create > /dev/null 2>&1
     if [ $? -eq 0 ]; then
         /sbin/mount -t tmpfs tmpfs /tmp
         /bin/cp /rescue/ifconfig /tmp
         addr=`kenv boot.netif.ip`
         netmask=`kenv boot.netif.netmask`
         bootif=`kenv boot.netif.name`
         if_lagg_devs=`echo ${lagg_devs} | sed "s/ / laggport /g"`
         for dev in ${lagg_devs}
         do
             /tmp/ifconfig ${dev} up
         done
         ifconfig ${lagg_dev} up
         ifconfig ${lagg_dev} ${addr} netmask ${netmask} laggproto \
             lacp laggport ${if_lagg_devs} up
         ifconfig ${bootif} -alias ${addr}
         /sbin/umount /tmp
     fi
fi


On 07/20/2016 11:56 AM, Nagy, Attila wrote:
> Hi,
>
> I have several netbooted machines, which operate in this way:
> - the machine boots up from one interface (PXE, DHCP), for example igb0
> - during the boot, an rc script runs* which deletes the IP from igb0 
> and creates the lagg interface with igb0, igb1 etc and sets the 
> original IP on that interface (with a statically linked ifconfig)
> - normal booting continues from the lagg interface
>
> This has worked for years and broke somewhere in the lifecycle of 
> 10-STABLE.
>
> Now I can't remove the IP address from the interface, ifconfig igb0 
> delete gives:
> interface igb0 cannot change link addresses!
>
> Any ideas about how could I work around this?
>
> Basically I would like to switch the IP from one interface to another 
> while running from an NFS root. (and this has worked before svn rev xxx)
>
> Thanks,
> _______________________________________________
> freebsd-net@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ff03ad9e-1de9-1ad7-953e-86ff15cbe62f>