OpenVZ with bridged interfaces and VLAN [message #39818] |
Sun, 06 June 2010 07:44 |
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 #39877 is a reply to message #39864] |
Sat, 12 June 2010 16:30 |
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 #47117 is a reply to message #47108] |
Mon, 09 July 2012 23:44 |
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
|
|
|
Re: OpenVZ with bridged interfaces and VLAN [message #47118 is a reply to message #47117] |
Mon, 09 July 2012 23:50 |
pateutz
Messages: 4 Registered: July 2012
|
Junior Member |
|
|
deimosfr wrote on Mon, 09 July 2012 19:44Hi,
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
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 #48909 is a reply to message #47118] |
Sun, 13 January 2013 14:57 |
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
|
|
|