Re: [Users] Multiple bridge support

2008-07-03 Thread Arjan Schrijver


Dmitry Mishin wrote:

On Wednesday 02 July 2008 11:36:42 Dietmar Maurer wrote:
  

Hi all,

In Proxmox VE we want to support multiple bridges. I currently use a
patch
which adds an bridge parameter to the netif options:

NETIF=ifname=XXX,bridge=XXX,mac=XXX,host_ifname=XXX,host_mac=XXX

--netif_add ifname[,mac,host_ifname,host_mac,bridge]

I also modified --netif_add to accept empty parameters, for example:

--netif_add eth3vmbr3

I wonder if we can include that into the vzctl release - I will post
the patch if soembody is interested.



Dietmar,

it will be useful indeed, please, provide patch to devel@ mailing list. 

  
Please do so. I've written my own solution for this, but yours looks 
much better.


Arjan
___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users


AW: [Users] Multiple bridge support

2008-07-03 Thread Dietmar Maurer
And here is the vznetaddbr we use (attached).

  I wonder if we can include that into the vzctl release - I 
 will post 
  the patch if soembody is interested.
  
 
  Dietmar,
 
  it will be useful indeed, please, provide patch to devel@ 
 mailing list. 
 

 Please do so. I've written my own solution for this, but 
 yours looks much better.



vznetaddbr
Description: vznetaddbr
___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users


Re: AW: [Users] Multiple bridge support

2008-07-03 Thread Kir Kolyshkin

Dietmar,

I have committed both the patch and the script to git, see [1] and [2]. 
I have modified the script a bit, hope I haven't break anything.


It would be just great if you can provide a patch to vzctl man page 
describing the new parameter, and the according wiki 
modifications/additions.


[1] 
http://git.openvz.org/?p=vzctl;a=commit;h=a16e0ecf72d4f2c7bd08aadbaa8272cbdc9e25a5
[2] 
http://git.openvz.org/?p=vzctl;a=commit;h=41fb6973bc205c00e25ba73431110ac8e821d6c9


Dietmar Maurer wrote:

And here is the vznetaddbr we use (attached).

  
I wonder if we can include that into the vzctl release - I 

will post 


the patch if soembody is interested.



Dietmar,

it will be useful indeed, please, provide patch to devel@ 
  
mailing list. 

  
  
Please do so. I've written my own solution for this, but 
yours looks much better.



  



___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users
  


___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users


AW: AW: [Users] Multiple bridge support

2008-07-03 Thread Dietmar Maurer
Hi Kir,

 Von: Kir Kolyshkin [mailto:[EMAIL PROTECTED] 
 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=

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


___
Users mailing list
Users@openvz.org
https://openvz.org/mailman/listinfo/users