From mboxrd@z Thu Jan 1 00:00:00 1970 From: Baruch Even Subject: Re: kvm-ifup bug with complex default routes Date: Mon, 2 Apr 2007 09:53:30 +0300 Message-ID: <20070402065330.GU25760@galon.ev-en.org> References: <20070401182810.GT25760@galon.ev-en.org> <64F9B87B6B770947A9F8391472E032160B21EF6C@ehost011-8.exch011.intermedia.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Dor Laor Return-path: Content-Disposition: inline In-Reply-To: <64F9B87B6B770947A9F8391472E032160B21EF6C-yEcIvxbTEBqsx+V+t5oei8rau4O3wl8o3fe8/T/H7NteoWH0uzbU5w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org * Dor Laor [070402 00:43]: > > > >A user just submitted a bug report against the kvm-18 debian package. > >You can find the bug report at > >http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=417151 > > > >The user has a default route with extra features and the kvm-ifup > script > >fails for him, his default route looks like: > >default via 10.0.0.138 dev br0 metric 1 realm 10 > > > >His suggestion to fix is: > >-switch=$(/sbin/ip route list | awk '/^default / { print $NF }') > >+switch=$(ip route ls | awk '/^default / { for(i=0;i<$NF;i++) { if > ($(i) == > >"dev") print $(i+1) }}') > > Actually using the default route in order to get the bridge name is a > bad thing. The best is to use brctl show and pick the bridge that has > the interface attached. The current approach has its problems, especially if there is no bridge defined. But what if I have multiple bridges? You will need to figure out which one of them to use. But then, this script can't take care of all situations, only of simple and common ones, the fix suggested above just improves coverage for a few more cases. Baruch ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV