From owner-freebsd-stable@FreeBSD.ORG Sun Oct 17 16:20:08 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D43F5106566B; Sun, 17 Oct 2010 16:20:08 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 5B3B88FC13; Sun, 17 Oct 2010 16:20:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id BF40A41C80E; Sun, 17 Oct 2010 18:20:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id Qumscshu7ptY; Sun, 17 Oct 2010 18:20:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id CC66141C832; Sun, 17 Oct 2010 18:20:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 7F9824448F3; Sun, 17 Oct 2010 16:17:01 +0000 (UTC) Date: Sun, 17 Oct 2010 16:17:01 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Nikolay Denev In-Reply-To: <7051D018-684F-417A-AAA0-00603B2FDCD4@gmail.com> Message-ID: <20101017161256.U10185@maildrop.int.zabbadoz.net> References: <7051D018-684F-417A-AAA0-00603B2FDCD4@gmail.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org, freebsd-stable@freebsd.org, FreeBSD virtualization mailing list Subject: Re: ifconfig, vnets and interface names X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: FreeBSD virtualization mailing list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Oct 2010 16:20:09 -0000 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 metric 0 mtu 1500 > ether 02:8c:53:00:03:0a > epair1a: flags=8842 metric 0 mtu 1500 > ether 02:b6:49:00:05:0a > eth0: flags=8842 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 metric 0 mtu 1500 > ether 02:b6:49:00:05:0a > eth0: flags=8842 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.