Multiple venet interfaces in openvz container?

danielparker

Active Member
Aug 29, 2010
11
0
41
Hi,

I have a cluster of two machines (hosts), with two ethernet interfaces each.

On Host one, I have the system interface configuration as:

Interface Active Ports Autostart IP Address Subnet Mask Gateway
vmbr0 Yes eth2 Y 10.1.1.1 255.255.255.0
vmbr1 Yes eth1 Y 192.168.100.130 255.255.255.0 192.168.100.254

On Host 2 it is:
Interface Active Ports Autostart IP Address Subnet Mask Gateway
vmbr0 Yes eth2 Y 10.1.1.2 255.255.255.0
vmbr1 Yes eth1 Y 192.168.100.131 255.255.255.0 192.168.100.254

Eth1 is plugged into a 100mbit firewall, and is the access to the internet (Via 1 to 1 NAT)

Eth2 is a 1000mbit cable, directly attached between machines. It is on vmbr0 so it is used for migrations and backups at the gigabit speed.

On Host 1 I have created an openvz container (container 1), and given it two IP addresses, separated by a space in the venet network address field of 192.168.100.132, 10.1.1.3

On Host 2 I have created an openvz container (container 2), and given it two IP addresses, separated by a space in the venet network address field of 192.168.100.133, 10.1.1.4

From container 1, I can ping container two by using its 192.168.100.133 address, but I cant ping it if I use its 10.1.1.4 address (Which has better bandwidth available, and less latency).

If I do a TCPdump on Host 2 I get:
23:31:50.728459 IP 192.168.100.132 > 10.1.1.4: ICMP echo request, id 2051, seq 22, length 64

I figure that my ping request from my container is going out my hosts vmbr1 interface and therefore not getting a reply, because both container IP addresses are bound to the vmbr1 interface.

How do I make it so my 10.1.1.X traffic goes across my hosts vmbr0 interface?

Thanks in advance.
Daniel
 
Hi,
perhaps the networkconfiguration in /etc/vz/conf/VMID.conf are wrong?!
Code:
NETIF="ifname=eth0,bridge=vmbr0,mac=3E:14:D3:50:AB:18,host_ifname=veth102.0,host_mac=00:18:51:09:90:AD;ifname=eth1,bridge=vmbr1,mac=1A:C1:37:A1:75:10,host_ifname=veth102.1,host_mac=00:18:52:34:79:AD"
this work for me on a openvz-container with VMID 102 and vmbr0+1.

Udo
 
I dont have a NETIF section in my .conf file. I will give this a try.. I notice mentions of veth in the code above.. does this mean I will be using veth and not venet?

Daniel
 
My fix is to add a static route in each of the containers..

route add -net 10.1.1.0 netmask 255.255.255.0 dev venet0:1

Then it works.