Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Oct 2010 16:17:01 +0000 (UTC)
From:      "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
To:        Nikolay Denev <ndenev@gmail.com>
Cc:        freebsd-net@freebsd.org, freebsd-stable@freebsd.org, FreeBSD virtualization mailing list <freebsd-virtualization@freebsd.org>
Subject:   Re: ifconfig, vnets and interface names
Message-ID:  <20101017161256.U10185@maildrop.int.zabbadoz.net>
In-Reply-To: <7051D018-684F-417A-AAA0-00603B2FDCD4@gmail.com>
References:  <7051D018-684F-417A-AAA0-00603B2FDCD4@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 17 Oct 2010, Nikolay Denev wrote:

> Hello,
>
> While playing with vnet jails I've discovered the following oddity, which probably is not what's expected to happen :
>
...
> And that's what ifconfig shows after this :
>
>    [16:52]root@nas:/home/ndenev# ifconfig
>    <... snip lo0 and physical interface ...>
>    epair0a: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	    ether 02:8c:53:00:03:0a
>    epair1a: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	   ether 02:b6:49:00:05:0a
>    eth0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	    ether 02:8c:53:00:04:0b
> 	    ether 02:b6:49:00:06:0b
>
> Instead of two interfaces, I'm seeing one with to lladdrs, because of the interface names being the same.
>
> Then I'm trying to destroy them :
>
>    [16:52]root@nas:/home/ndenev# ifconfig eth0 destroy
>    [16:53]root@nas:/home/ndenev# ifconfig
>    <... snip lo0 and physical interface ...>
>    epair1a: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	    ether 02:b6:49:00:05:0a
>    eth0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> 	    ether 02:b6:49:00:06:0b
>    [16:53]root@nas:/home/ndenev# ifconfig eth0 destroy
>
>
> So in this case there may be not a clean way to address one of the interfaces specifically (i.e. destroy only the second one)?
>
> I've not investigated further, but I'm thinking probably this is just a "bug" in ifconfig interpreting/parsing the information from the kernel.
> Maybe a solution is to extend ifconfig to be able print the interface list along with the ifIndex values and also manage the interfaces by index?
> Auto renaming also is also probably a possible solution (i.e. eth0_1 , eth0_2 ) as these are interfaces coming from destroyed vnet's and are not likely to be in use. (but still sounds scary :) )

It's actually a bug in sys/net/if.c:if_vmove* we know about and that's
on the todo list.

I am not sure when the behaviour of ifconfig changed as previousy it
would only show you one of the two interfaces with the single ether
address.  ifconfig -l however had shown eth0 twice.  Neither is really
what one would expect thus needs changing.

/bz

PS: freebsd-virtualization@ is the best list to report "VIMAGE" or
"vnet" related problems.

-- 
Bjoern A. Zeeb                              Welcome a new stage of life.



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