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] Trouble with manual bridging on Xen3/CentOS 5

To: Digimer <linux@xxxxxxxxxxx>
Subject: Re: [Xen-users] Trouble with manual bridging on Xen3/CentOS 5
From: Teck Choon Giam <giamteckchoon@xxxxxxxxx>
Date: Sun, 1 May 2011 03:25:19 +0800
Cc: "xen-users@xxxxxxxxxxxxxxxxxxx" <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sat, 30 Apr 2011 12:26:52 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FNiJGoBmYXgnk6NK3Emx0x/sWkH7nFXgG44ZnWpittY=; b=w0MoPw9M8q6UacLTyCZGqwJclbNvrhn2mTp4b9EqTyoANJ48lW7jd90t9gPDOMGp+Q 9fSLS6M858G/l1MDLkWSFEJk+VDRzKzUcKEra1Q0w8M9Wesq6iCTBS87D+RYynQ/1EzO twfQMVGv4ROgLYPJuLd3Ox8iXPTehVADEBi+0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=gCFmQc2fY02FWMiKNzlbs9Yu4G5Yo983KjAXLD+DpzeccPLj4B1fLm8einIMie14/Z zFOmL5zlmd119h1v8/+5jLTfOmkeG9xLYhCObOXVdf1nz3DQhNNy8O1RTetRDh3jDxB3 anFOU/O0s3R6wtPBqbXFk4goT5IX/6rupdmX4=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DBC3DCE.4060206@xxxxxxxxxxx>
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/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <4DBB36EA.2030202@xxxxxxxxxxx> <BANLkTimE1YDM86_rYj6PHWqgDyRa1gQoHw@xxxxxxxxxxxxxx> <4DBC3DCE.4060206@xxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
On Sun, May 1, 2011 at 12:50 AM, Digimer <linux@xxxxxxxxxxx> wrote:
> On 04/29/2011 06:26 PM, Teck Choon Giam wrote:
>> On Sat, Apr 30, 2011 at 6:08 AM, Digimer <linux@xxxxxxxxxxx> wrote:
>>> Hi all,
>>>
>>>  While trying to sort out/test some patches, I was told that it's best
>>> to create bridges manually in
>>> /etc/sysconfig/network-scripts/ifcfg-xenbr*. I did this, commented out
>>> (network-script network-bridge) and restarted the network and Xen.
>>
>> Yes, using system network configuration will be better.  Which
>> distribution is this?  CentOS/RHEL 5?
>> You commented out (network-script network-bridge)?  If you are using
>> system network configuration to configure your bridge, have you try
>> the following instead of commented out?
>>
>> (network-script /bin/true)
>
> That was the ticket. I was able to provision a new VM with two
> interfaces, however, the vifs were at MTU 1500 so I still have work to
> do. :)

Glad to hear that ;)

Whereby for MTU... maybe you want to try manually set those?  For example:

To get the link of various ip link... ...
ip link show

Then if you want to set the mtu for vif1.0 for instance... do something like:

ip link set dev vif1.0 mtu 1412

Of course in your case, vif1.0 or whatever appended with .0 for vif#.0
will be your xenbr0/eth0... so you might want to do something like:

ip link set dev eth0 mtu 1412 << This can be configure in ifcfg-eth0
ip link set dev xenbr0 mtu 1412 << This also can be set in ifcfg-xenbr0
ip link set dev vif1.0 mtu 1412
ip link set dev vif2.0 mtu 1412

OR using ifconfig to set the related interface mtu.

so on... ... I don't think this is difficult to find the vif related
script in /etc/xen/scripts/ to add in the appropriate link for your
desired mtu value... ... IMO.  I think this is vif-common.sh as the
below codes:

if [ "$type_if" = vif ]; then
    # Check presence of compulsory args.
    XENBUS_PATH="${XENBUS_PATH:?}"
    dev="${dev:?}"

    vifname=$(xenstore_read_default "$XENBUS_PATH/vifname" "")
    if [ "$vifname" ]
    then
        if [ "$command" == "online" ] && ! ip link show "$vifname" >&/dev/null
        then
            do_or_die ip link set "$dev" name "$vifname" << THIS IS
WHERE YOU CAN ADD BUT I HAVE NOT EXPLODE THIS NOR TEST THIS WITH
APPENDED mtu "$mtu"
        fi
        dev="$vifname"
    fi
elif [ "$type_if" = tap ]; then
    # Check presence of compulsory args.
    : ${INTERFACE:?}

    # Get xenbus_path from device name.
    # The name is built like that: "tap${domid}.${devid}".
    dev_=${dev#tap}
    domid=${dev_%.*}
    devid=${dev_#*.}

    XENBUS_PATH="/local/domain/0/backend/vif/$domid/$devid"
fi


Something like:

do_or_die ip link set "$dev" name "$vifname" mtu "$vifmtu"

Or if doesn't work just split to another line:

do_or_die ip link set "$dev" name "$vifname"
do_or_die ip link set dev "$vifname" mtu "$vifmtu"

Or use ifconfig... ...

Of course you will need to set $vifmtu somewhere before the above or
use a function/line to get its bridge/parent interface name
(xenbr0/eth0) mtu value ... ... this is purely talking rubbish from me
without testing... just thoughts/ideas :p

Example:

Get parent/bridge interface mtu value for xenbr0:

local vifmtu=`ip link show xenbr0|head -n 1|sed 's@.*\Wmtu\W@@'|sed 's@\W.*@@'`

Or even better way is we know vif#.N where N will be the bridge number:

local myxenbrN=`echo $vifname | cut -f2 -d '.'`
local myxenbrname="xenbr${myxenbrN}"
local vifmtu=`ip link show ${myxenbrname}|head -n 1|sed
's@.*\Wmtu\W@@'|sed 's@\W.*@@'`
do_or_die ip link set "$dev" name "$vifname" mtu "$vifmtu"

Again, the above are ideas/thoughts without testing at all and I might
be totally wrong :p

Hope this helps!

Thanks.

Kindest regards,
Giam Teck Choon

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