Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jun 2017 16:35:10 +0000
From:      Steven Crangle <Steven@stream-technologies.com>
To:        Alan Somers <asomers@freebsd.org>
Cc:        FreeBSD Net <freebsd-net@freebsd.org>
Subject:   Re: Possible bug in ifconfig regarding ip addresses and fibs
Message-ID:  <DB6PR07MB31119268B9A6F5D432A92CF29BC10@DB6PR07MB3111.eurprd07.prod.outlook.com>
In-Reply-To: <CAOtMX2izh8_V7Psdsy0Fbuty2t%2BZhf4m-aostGWHdR7D13JLqA@mail.gmail.com>
References:  <DB6PR07MB3111985364025AE2F57E13FF9BC10@DB6PR07MB3111.eurprd07.prod.outlook.com>, <CAOtMX2izh8_V7Psdsy0Fbuty2t%2BZhf4m-aostGWHdR7D13JLqA@mail.gmail.com>

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


Thanks for the fast reply.

I actually think I had the fib 5 part appended to the line previously, but =
had somehow removed it in my repeated attempts! Either way, I just tried yo=
ur solution, and it results in the same behaviour.


The initial two IP's are assigned, but the final 192.168.124.216 is not.

When i get chance, I'll try moving the mgmt IP from the 124 range to someth=
ing else and repeating, as I'm sure it's some sort of interaction between m=
anee and mgmt. Since the commands are successful if I change the final addr=
esses IP to a different range!

Thanks


Steven







________________________________



[Stream Logo]








Steven Crangle


Systems Developer | Stream Technologies | Glasgow, UK


[http://www.stream-technologies.com/img/phone.png]


+44 (0)844 800 8520


|


[http://www.stream-technologies.com/img/mouse.png]


www.stream-technologies.com<http://www.stream-technologies.com/>;






________________________________
From: asomers@gmail.com <asomers@gmail.com> on behalf of Alan Somers <asome=
rs@freebsd.org>
Sent: 16 June 2017 17:12:39
To: Steven Crangle
Cc: FreeBSD Net
Subject: Re: Possible bug in ifconfig regarding ip addresses and fibs

On Fri, Jun 16, 2017 at 10:00 AM, Steven Crangle
<Steven@stream-technologies.com> wrote:
>
> Hi,
>
>
> I've been configuring a device with the following rc.conf lines:
>
>
> ifconfig_le6_name=3D"manee"
> ifconfig_manee=3D"fib 5 up"
> ifconfig_manee_alias0=3D"inet 185.100.174.221 netmask 255.255.255.0"
> ifconfig_manee_alias1=3D"inet 172.31.4.216 netmask 255.255.255.128"
> ifconfig_manee_alias2=3D"inet 192.168.124.216 netmask 255.255.255.128"
>
> The result I would have expected is as follows:
>
>
> manee: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu =
1500
>     options=3D8<VLAN_MTU>
>     ether 08:00:27:d3:83:da
>     inet 185.100.174.221 netmask 0xffffff00 broadcast 185.100.174.255
>     inet 172.31.4.216 netmask 0xffffffc0 broadcast 172.31.4.255
>     inet 192.168.124.216 netmask 0xffffff80 broadcast 192.168.124.255
>     nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
>     media: Ethernet autoselect
>     status: active
>     fib: 5
>
>
> Instead I get the following on boot of the box:
>
>
> manee: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu =
1500
>     options=3D8<VLAN_MTU>
>     ether 08:00:27:d3:83:da
>     inet 185.100.174.221 netmask 0xffffff00 broadcast 185.100.174.255
>     inet 172.31.4.216 netmask 0xffffffc0 broadcast 172.31.4.255
>     nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
>     media: Ethernet autoselect
>     status: active
>     fib: 5
>
>
> I then tried to run the following command:
>
> ifconfig manee alias 185.100.174.221 netmask 255.255.255.0
> ifconfig manee alias 172.31.4.216 netmask 255.255.255.128
> ifconfig manee alias 192.168.124.216 netmask 255.255.255.128
>
> Which resulted in the following output:
>
>
> ifconfig: ioctl (SIOCAIFADDR): File exists
>
> After this I tried:
>
> ifconfig manee -alias
>
> Which seemed to wipe all addresses fro mthe device as expected.
>
>
> I then started again using ifconfig lines to assign the aliases to the de=
vice, they all succeed apart from when I get to the 192.168.124.216 one. Wh=
ich again outputs the following:
>
>
> ifconfig: ioctl (SIOCAIFADDR): File exists
>
> Even though running ifconfig only shows the first two addresses configure=
d.
>
>
> Note: I also have a mgmt interface on fib 0 configured with the ip : 192.=
168.124.250
>
> From investigation it seems to somehow be clashing with this, as I am abl=
e to add a 3rd alias with the following line:
>
>
> ifconfig manee alias 192.168.125.216 netmask 255.255.255.128
>
> Is it not possible to have two IP Addresses on the same range, but differ=
ent addresses on seperate fibs?
>
> Thanks for any help!
>
> Steven

There is some subtlety with using multiple fibs.  Your problem is that
you naturally assumed that by assigning fib 5 to the manee interface,
that fib would also be used for all of its addresses.  However, that's
not the way it works.  The interface fib actually isn't very
important.  It's only used for packet forwarding.  The fib of an
interface address is more important, and each address can have a
different fib, even when they share an interface.  In order to set the
interface address fibs, do this:

ifconfig_manee_alias0=3D"inet 185.100.174.221 netmask 255.255.255.0 fib 5"
ifconfig_manee_alias1=3D"inet 172.31.4.216 netmask 255.255.255.128 fib 5"
ifconfig_manee_alias2=3D"inet 192.168.124.216 netmask 255.255.255.128 fib 5=
"

You can't assign the same address to multiple interfaces with the same FIB.

-Alan



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