OpenVZ Forum


Home » General » Support » Possible flaw in /usr/sbin/vznetaddbr script
Possible flaw in /usr/sbin/vznetaddbr script [message #36415] Wed, 17 June 2009 10:35 Go to next message
starfry is currently offline  starfry
Messages: 24
Registered: March 2009
Location: Coulsdon, Surrey, UK
Junior Member
Hello,

I have a bridged configuration working as per the instructions on the page at http://wiki.openvz.org/Virtual_Ethernet_device.

I find that, with the suggested script /usr/sbin/vznetaddbr in place, the "vzctl set 101 --netif eth0 --save" does not work because that script exits if a netif is not already there!

To make it work, I have changed the exit status of the first if-block so it is 0 instead of 1.

This works for me, but I wanted to ask here in case there might be some other reason for the error.
Re: Possible flaw in /usr/sbin/vznetaddbr script [message #36416 is a reply to message #36415] Wed, 17 June 2009 12:44 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

I'm sorry but I don't understand your problem clearly.
Why do you expect this script to work without eth* interface set up inside VE? This script is a way to facilitate a bridge configuration. As far as I understand it doesn't intend to configure veth interface so it expects this to be done beforehand.
Re: Possible flaw in /usr/sbin/vznetaddbr script [message #36425 is a reply to message #36415] Wed, 17 June 2009 22:06 Go to previous messageGo to next message
starfry is currently offline  starfry
Messages: 24
Registered: March 2009
Location: Coulsdon, Surrey, UK
Junior Member
If the script is in place, it fails when you issue the command to add the veth device to the container:

vzctl set 101 --netif eth0 --save

When you issue that command, the vznetaddbr is invoked. It checks for the existance of a netif stanza in the container's config file before it has been added and terminates because there is no stanza in the file at that time. The result is you can't add the veth to the container.

Does that make sense?
Re: Possible flaw in /usr/sbin/vznetaddbr script [message #36430 is a reply to message #36425] Thu, 18 June 2009 11:02 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Yes, thank you very much.

I sent a letter to openvz users list and to a person who seems to be an author of this script.
http://git.openvz.org/?p=vzctl;a=commit;h=41fb6973bc205c00e2 5ba73431110ac8e821d6c9
If your're not an openvz list's subscriber, here is the full text of the letter:
"
Starfry observed a strange behavior of vznetaddbr script.
http://forum.openvz.org/index.php?t=msg&th=7627&star t=0&

So the question arose: how is this script intended to use?
# cat /etc/vz/vznet.conf
#!/bin/bash
EXTERNAL_SCRIPT="/usr/sbin/vznetaddbr"
# vzctl set 101 --netif_add eth0
Configure veth devices: veth101.0
Running: /usr/sbin/vznetcfg init veth veth101.0
According to /etc/vz/conf/101.conf, CT101 has no veth interface configured.
/usr/sbin/vznetcfg exited with error
WARNING: Settings were not saved and will be resetted to original values on next start (use --save flag)

Doesn't it have to be corrected so that the ability to add veth interface inside VE remains intact?

"
Re: Possible flaw in /usr/sbin/vznetaddbr script [message #36446 is a reply to message #36430] Fri, 19 June 2009 08:42 Go to previous message
starfry is currently offline  starfry
Messages: 24
Registered: March 2009
Location: Coulsdon, Surrey, UK
Junior Member
Thanks for picking this up, I wasn't sure of the procedure. I will keep an eye on the mailing list but if there are any updates to this it would be good to see them on this thread.

Many thanks once again.
Previous Topic: move or create vps to secondary hardisk?
Next Topic: CSF firewall giving problem in openvz VPS
Goto Forum:
  


Current Time: Sun Aug 18 21:20:08 GMT 2024

Total time taken to generate the page: 0.03130 seconds