OpenVZ Forum


Home » Mailing lists » Users » Multiple bridge support
Re: AW: AW: Multiple bridge support [message #31827 is a reply to message #31544] Thu, 10 July 2008 17:42 Go to previous messageGo to previous message
kir is currently offline  kir
Messages: 1645
Registered: August 2005
Location: Moscow, Russia
Senior Member

I don't quite get it. Is it supposed to be a replacement for vznetaddbr, 
an addition to it, or is it orthogonal to it? Who and when calls vznetaddbr?

Dietmar Maurer wrote:
> Hi Kir,
>
>   
>> Von: Kir Kolyshkin [mailto:kir@openvz.org] 
>> Gesendet: Donnerstag, 03. Juli 2008 13:35
>> An: users@openvz.org; Dietmar Maurer
>> Betreff: Re: AW: [Users] Multiple bridge support
>>
>> How do you invoke it? Using EXTERNAL_SCRIPT?
>>
>> Would be good to have a patch adding (conditional?) 
>> invocation of vznetaddbr to vznetcfg.
>>     
>
> One idea was to add a new global option in vz.conf:
>
> DEF_BRIDGE=XXXX
>
> If set, we automatically setup the bridge (we need to pass an additional
> parameter to vznetcfg, but i guess thats no problem at all). That also
> avoid a hardcoded default bridge name (vmbr0).
>
> Here is the totally untested code. If you like the idea I will test it
> ;-)
>
> ---------------------------------------
> #!/bin/sh
> CONFIGFILE='@PKGCONFDIR@/vz.conf'
>
> [ -f "$CONFIGFILE" ] &&. $CONFIGFILE
>
> VZNETCFG='@PKGCONFDIR@/vznet.conf'
>
> [ -f "$VZNETCFG" ] && . "$VZNETCFG"
>
> usage()
> {
>         echo >&2 "vznetcfg init veth <dev> [<bridge>]"
> }
>
> init_veth()
> {
>         local dev="$1"
>         local bridge="$2"
>
>         if [ -n "$DEV_BRIDGE" ]; then
>             if [ ! -n "$bridge" ]; then
>                 bridge=$DEV_BRIDGE
>             fi
>             echo "Adding interface $dev to bridge $bridge on CT0 for
> CT$VEID"
>             /sbin/ifconfig $dev 0
>             echo 1 > /proc/sys/net/ipv4/conf/$dev/proxy_arp
>             echo 1 > /proc/sys/net/ipv4/conf/$dev/forwarding
>             /usr/sbin/brctl addif $bridge $dev
>         else
>             ip link set "$dev" up
>         fi
> }
>
> # Call the external script if defined
> if [ -n "$EXTERNAL_SCRIPT" -a -x "$EXTERNAL_SCRIPT" ]; then
>         export VEID
>         exec "$EXTERNAL_SCRIPT" $@
> fi
>
> if test $# -le 2; then
>     usage
>     exit 0
> fi
>
> CMD="$1"
> case "$CMD$2" in
>         initveth)
>                 if test $# -le 3; then
>                         usage
>                         exit 1
>                 fi
>
>                 init_veth "$3" "$4"
>                 ;;
>         *)
>                 echo "invalid action"
>                 exit 1
>                 ;;
> esac
> exit 0
>
>
>
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 2.6.24 general protection fault
Next Topic: Another 2.6.24 problem
Goto Forum:
  


Current Time: Mon Sep 29 02:45:47 GMT 2025

Total time taken to generate the page: 0.06714 seconds