OpenVZ Forum


Home » General » Support » OpenVZ with bridged interfaces and VLAN (OpenVZ with bridged interfaces and VLAN)
OpenVZ with bridged interfaces and VLAN [message #39818] Sun, 06 June 2010 07:44 Go to next message
deimosfr is currently offline  deimosfr
Messages: 4
Registered: June 2010
Junior Member
Hi !

I've got a problem with OpenVZ with bridged VLAN. Here is my configuration :

                                                    +------+
 +-------+    +-----------+      +---------+  br0   |VE101 |
 |       |    |  OpenBSD  |----->| Debian  |------->|      |   
 | WAN   |--->|  Router   |      | OpenVZ  |        +------+
 |       |    |  Firewall |----->| br0 br1 |  br1   +------+
 +-------+    +-----------+      +---------+------->|VE102 |
                                     |br0           |      |   
                                     |VLAN br0.110  +------+
                                     v    
                                 +---------+     
                                 |VE103.110|           
                                 +---------+    

I can't make VLAN work on br0 (br0.110) and I would like to understand why. I don't have any switch so no problem with unmanageable switch.

When I say it doesn't work, for example I can't ping the default gateway and it works from other hosts (not in VLAN).

I've configured a VLAN interface on OpenBSD in /etc/hostname.vlan110:
inet 192.168.110.254 255.255.255.0 NONE vlan 110 vlandev sis1


And it seems to be working fine. I've also adapted my PF configuration to work with VLAN but I don't see any incoming traffic.

On my Debian Lenny, here is my interfaces configuration :
# The loopback network interface
auto lo
iface lo inet loopback

# br0
auto br0
iface br0 inet static
    address 192.168.100.1
    netmask 255.255.255.0
    gateway 192.168.100.254
    network 192.168.100.0
    broadcast 192.168.100.255
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

# VLAN 110
auto br0.110
iface br0.110 inet static
    address 192.168.110.1
    netmask 255.255.255.0
    network 192.168.110.0
    gateway 192.168.110.254
    broadcast 192.168.110.255
    pre-up vconfig add br0 110
    post-down vconfig rem br0.110


It looks OK, but when I start my VE, here is the message:

...
Configure veth devices: veth103.0 
Adding interface veth103.0 to bridge br0.110 on CT0 for VE103
can't add veth103.0 to bridge br0.110: Operation not supported
VE start in progress...


So I've got one error here. I've followed this documentation http://wiki.openvz.org/VLAN but it doesn't work. I've certainly missed something but I don't know why. Someone could help me please?

Thanks
Re: OpenVZ with bridged interfaces and VLAN [message #39864 is a reply to message #39818] Fri, 11 June 2010 12:35 Go to previous messageGo to next message
maratrus is currently offline  maratrus
Messages: 1495
Registered: August 2007
Location: Moscow
Senior Member
Hello,

I might miss a point but veth103.0 cannot be added to br0.110 because the last one is VLAN interface.
I think that you shouldn't create br0.110 but just leave a single br0 which contains physical interface of the HN (possibly eth0) and veth103.0. Then add vlan interfaces using vconfig utility inside the VE and this should work.
Re: OpenVZ with bridged interfaces and VLAN [message #39877 is a reply to message #39864] Sat, 12 June 2010 16:30 Go to previous messageGo to next message
deimosfr is currently offline  deimosfr
Messages: 4
Registered: June 2010
Junior Member
Hi !

Thanks for your answer. So I'm trying what you told me and I still can't get network in my VE.

On the master host, I pull off the VLAN and br0.110 interface to let only br0.

Then I configured the VE to be on br0 interface :
CONFIG_CUSTOMIZED="yes"
VZHOSTBR="br0"
IP_ADDRESS=""
NAMESERVER="192.168.100.3"
NETIF="ifname=eth0,mac=00:18:51:78:46:C8,host_ifname=veth103.0,host_mac=00:18:51:B1:78:DE"


Then in my VE interfaces, here is what I've got :
auto lo eth0.110
iface lo inet loopback

iface eth0.110 inet static
	address 192.168.110.10
	netmask 255.255.255.0
	#gateway 192.168.110.254
	#network 192.168.110.0
	broadcast 102.168.110.255
	vlan_raw_device eth0

And to finish, to validate the vlan config :
> cat /proc/net/vlan/eth0.110 

eth0.110  VID: 110	 REORDER_HDR: 1  dev->priv_flags: 1
         total frames received            1
          total bytes received           46
      Broadcast/Multicast Rcvd            0

      total frames transmitted           15
       total bytes transmitted         2086
            total headroom inc            0
           total encap on xmit           15
Device: eth0
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
EGRESSS priority Mappings: 


I can't ping my router (of course on the same subnet) with this VE but I can from another host not in this VLAN for example.

I'm still wondering why it doesn't work as it looks like so simple on the documentation.

Thanks

[Updated on: Sat, 12 June 2010 16:31]

Report message to a moderator

Re: OpenVZ with bridged interfaces and VLAN [message #45923 is a reply to message #39877] Mon, 16 April 2012 16:44 Go to previous messageGo to next message
Nilesh Bairagi is currently offline  Nilesh Bairagi
Messages: 2
Registered: March 2012
Junior Member
Can u check your IP forwarding on host machine, if you are not using NAT for containers.
Re: OpenVZ with bridged interfaces and VLAN [message #47108 is a reply to message #45923] Sat, 07 July 2012 20:56 Go to previous messageGo to next message
pateutz is currently offline  pateutz
Messages: 4
Registered: July 2012
Junior Member
i have same problems Sad

network interface
brctl addbr br0
auto br0
iface br0 inet static
bridge_ports eth1
 address 89.42.231.180
 broadcast 89.42.231.255
 netmask 255.255.255.0
 gateway 89.42.231.1

auto eth1.113
iface eth1.113 inet static
        address 89.42.231.113
        netmask 255.255.255.0
        #gateway 192.168.110.254
        #network 192.168.110.0
        broadcast 89.42.231.255
        vlan_raw_device eth1


113.conf
HOSTNAME="test.smallhosting.ro"
NAMESERVER="193.231.169.2"
SEARCHDOMAIN="smallhosting.ro"
VZHOSTBR="br0"
VETH_IP_ADDRESS=""
HOSTNAME="test.smallhosting.ro"
NAMESERVER="193.231.169.2"
SEARCHDOMAIN="smallhosting.ro"
VZHOSTBR="br0"
VETH_IP_ADDRESS=""
NETIF="ifname=eth1,mac=00:02:04:06:08:02,host_ifname=veth113.0,host_mac=00:19:99:C4:66:87"


and when start vzctl start 113

i have this

root@smallhosting:~# vzctl start 113
Starting container ...
Container is mounted
Setting CPU units: 1000
Set hostname: test.smallhosting.ro
File resolv.conf was modified
Configure veth devices: veth113.0
ifname=
host_ifname=
According to basic VE113 has no veth IPs configured.
/usr/sbin/vznetcfg exited with error
Container start failed
Stopping container ...
Container was stopped
Container is unmounted


help me somone?

i wan to add more ips on container
Re: OpenVZ with bridged interfaces and VLAN [message #47117 is a reply to message #47108] Mon, 09 July 2012 23:44 Go to previous messageGo to next message
deimosfr is currently offline  deimosfr
Messages: 4
Registered: June 2010
Junior Member
Hi,

Try that on the host :
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet manual

# The bridged interface
auto vmbr0
iface vmbr0 inet static
        address 192.168.100.1
        netmask 255.255.255.0
        gateway 192.168.100.254
        broadcast 192.168.100.255
        network 192.168.100.0
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

# The DMZ Vlan 110
auto vmbr0.110
iface vmbr0.110 inet static
	address 192.168.110.1
	netmask 255.255.255.0
	broadcast 192.168.110.255
	vlan_raw_device vmbr0

On the VE, configure it to get this config :
[...]
CONFIG_CUSTOMIZED="yes"
VZHOSTBR="vmbr0"
IP_ADDRESS=""
NETIF="ifname=eth0,mac=00:18:50:FE:EF:0B,host_ifname=veth101.0,host_mac=00:18:50:07:B8:F4"
[...]

Then on the guest :
# This configuration file is auto-generated.
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and /etc/network/interfaces.tail instead,
# their contents will be inserted at the beginning and at the end
# of this file, respectively.
#
# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail
# will be at the very end of this file.

# Auto generated lo interface
auto lo
iface lo inet loopback

# VE interface
auto eth0
iface eth0 inet manual

# VLAN 110 interface
auto eth0.110
iface eth0.110 inet static
	address 192.168.110.2
	netmask 255.255.255.0
	gateway 192.168.110.254
	broadcast 192.168.110.255
	vlan_raw_device eth0

It works for me Smile
Re: OpenVZ with bridged interfaces and VLAN [message #47118 is a reply to message #47117] Mon, 09 July 2012 23:50 Go to previous messageGo to next message
pateutz is currently offline  pateutz
Messages: 4
Registered: July 2012
Junior Member
deimosfr wrote on Mon, 09 July 2012 19:44
Hi,

Try that on the host :
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet manual

# The bridged interface
auto vmbr0
iface vmbr0 inet static
        address 192.168.100.1
        netmask 255.255.255.0
        gateway 192.168.100.254
        broadcast 192.168.100.255
        network 192.168.100.0
        bridge_ports eth0
        bridge_fd 9
        bridge_hello 2
        bridge_maxage 12
        bridge_stp off

# The DMZ Vlan 110
auto vmbr0.110
iface vmbr0.110 inet static
	address 192.168.110.1
	netmask 255.255.255.0
	broadcast 192.168.110.255
	vlan_raw_device vmbr0

On the VE, configure it to get this config :
[...]
CONFIG_CUSTOMIZED="yes"
VZHOSTBR="vmbr0"
IP_ADDRESS=""
NETIF="ifname=eth0,mac=00:18:50:FE:EF:0B,host_ifname=veth101.0,host_mac=00:18:50:07:B8:F4"
[...]

Then on the guest :
# This configuration file is auto-generated.
# WARNING: Do not edit this file, your changes will be lost.
# Please create/edit /etc/network/interfaces.head and /etc/network/interfaces.tail instead,
# their contents will be inserted at the beginning and at the end
# of this file, respectively.
#
# NOTE: it is NOT guaranteed that the contents of /etc/network/interfaces.tail
# will be at the very end of this file.

# Auto generated lo interface
auto lo
iface lo inet loopback

# VE interface
auto eth0
iface eth0 inet manual

# VLAN 110 interface
auto eth0.110
iface eth0.110 inet static
	address 192.168.110.2
	netmask 255.255.255.0
	gateway 192.168.110.254
	broadcast 192.168.110.255
	vlan_raw_device eth0

It works for me Smile


i must set a mac to work internet

my isp give me at all ip's a mac to set on nic

and generali i wan to set multiple ip's on openvz container

with one ip and netif mac it work but when i add second ip on container dont work from external
Re: OpenVZ with bridged interfaces and VLAN [message #47121 is a reply to message #47118] Tue, 10 July 2012 11:34 Go to previous messageGo to next message
deimosfr is currently offline  deimosfr
Messages: 4
Registered: June 2010
Junior Member
You can play with NAT and iptables for that. You can found several examples on internet to NAT instead of bridge.
Re: OpenVZ with bridged interfaces and VLAN [message #47138 is a reply to message #47118] Tue, 10 July 2012 23:44 Go to previous messageGo to next message
pateutz is currently offline  pateutz
Messages: 4
Registered: July 2012
Junior Member
i will try with this and i will reply

but i buyed cpanel and i installed centos 6.2 64bits and same problems here
but i will try with NAT on centos too i will come with repley
Re: OpenVZ with bridged interfaces and VLAN [message #48909 is a reply to message #47118] Sun, 13 January 2013 14:57 Go to previous message
bdube is currently offline  bdube
Messages: 2
Registered: January 2013
Junior Member
For me, as a network & Linux guy & just newb with OpenVZ, it looks weird to try to associate a sub-interface (vlan number) to a bridge (vmbr0).

Sub-interface (vlan numbers) should be associate with physical interface to indicate the use of 802.1Q and the number after the interface name inform us about the tag used. Ex.: eth0.125 indicate the tag, or vlan number, 125 on the interface eth0 using 802.1Q.

Then if you want to associate a bridge with this particular vlan just create a simple bridge (vmbr0) & map the sub-interface (eth0.125) to it. The bridge don't have to know about the VLAN number.

Regards

Ben
Previous Topic: need to connect my centos container to the wifi
Next Topic: Xorg - no render extension inside VE
Goto Forum:
  


Current Time: Thu Nov 14 17:56:22 GMT 2024

Total time taken to generate the page: 0.03335 seconds