Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

VEs and HNs in same subnets

681 bytes added, 13:20, 26 November 2013
Added GATEWAY to ifcfg-eth0 example.
==Configure host bridge interfaces==
 
Steps 1 through 4 are done only once on the host.
 
1. (Optional) Verify that you can create a bridge interfaces for each physical interface on the host.
If the above commands do not work you may need to install the bridge-utils package.
2. Make note of the existing IP configuration in the hosts ifcfg-ethN files. Also, record the hardware MAC addresses of the ethernet interfaces from the output of 'ifconfig'.  /sbin/ifconfig eth0 /sbin/ifconfig eth1  Then, modify the ifcfg-ethN files on the host so that they ONLY bridge to the corresponding brN interface. /etc/sysconfig/network-scripts/ifcfg-eth0 should look like:
DEVICE=eth0
ONBOOT=yes
TYPE=Bridge
MACADDR=mm:mm:mm:mm:mm:mm
Similarly, ifcfg-br1 should look like:
ONBOOT=yes
TYPE=Bridge
MACADDR=nn:nn:nn:nn:nn:nn
Note that TYPE 'Bridge' is case-sensitive. Otherwise, the bridge interfaces will not initialize correctly during boot.
 
The bridge MACADDR should be hard-coded to match the corresponding hardware MAC address of the ethernet interface. Otherwise the default behaviour is to use the lowest MAC address of all the interfaces in the bridge. This is to prevent the bridge MAC and any auto-configured IPv6 address on the bridge interface from changing as VEs are created, started, or stopped.
4. On the host, do a 'service network restart' and verify the host has both IPv4 and IPv6 connectivity to its brN interfaces.
NETMASK=yyy.yyy.yyy.yyy
ONBOOT=yes
GATEWAY=zzz.zzz.zzz.zzz
10. Initialize the interfaces and restart the network service on the container.
14
edits