WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] network-bridge script and the ip route list command

To: xen-users@xxxxxxxxxxxxxxxxxxx, "pete hilton" <saruman@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-users] network-bridge script and the ip route list command
From: "Wouter de Geus" <benv@xxxxxxxxxxxxx>
Date: Fri, 29 Dec 2006 17:03:12 +0100 (CET)
Delivery-date: Tue, 02 Jan 2007 01:28:04 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
Importance: Normal
In-reply-to: <200612272354.47923.saruman@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <200612272354.47923.saruman@xxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: SquirrelMail/1.4.9a
Heia,

I'm running xen 3.0.3 on a slack 11 box myself too and had the same problem.
I noticed that the output of the ip command was indeed different from a
box my girlfriend had running with opensuse on it. (obviously it worked
for her).

I change the command to get the vifnum into this:
vifnum=${vifnum:-$(ip route list | awk '/^default / { print $5 }' | sed
's/^[^0-9]*//')}

I ran into another problem in that script however, so maybe this will save
you the same issue:
The script tries to save the default gateway and restore it later, but
because of different output a test fails.
($gateway becomes more than just 1 word in slackware.)
I changed this line:
---
    [ ${gateway} ] && ip route add default via ${gateway}
---
into:
---
   [ ! -z "${gateway}" ] && ip route add default via ${gateway}
---

Hope it helps :)

Wouter.

Op Do, 28 december, 2006 08:54, schreef pete hilton:
> Hi there,
>                I have got xen 3.0.3 (built from source download from
> xensource) running on my linux box (Slackware 11 distribution).
>
> When the network-bridge script runs, it first of all issues "ip route
> list"
> and then parses the "default" line to pick up the last word.
>
> The ip command in my distribution gives the following:-
>
> default via 192.168.1.1 dev eth0  metric 1
>
> which naturally results in a vifnum of 1 instead of 0.
>
> Is this a bug in the script or is my "ip" command different from the norm?
>
> cheers
> pete



_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>