Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

VEs and HNs in same subnets

179 bytes added, 03:49, 26 January 2010
no edit summary
In the following example the host has two physical interfaces and we are setting up the network configuration for VE 100. The host IP configuration is moved out of the ethN interface configs and into the vzbrN interface config scripts (ifcfg-vzbr0 and ifcfg-vzbr1). Ie. the host IP configuration will now reside on the vzbrN interfaces instead of the ethN interfaces.
==Configure host bridge interfaces==
1. (Optional) Verify that you can create a bridge interfaces for each physical interface on the host.
4. On the host, do a 'service network restart' and verify the host has both IPv4 and IPv6 connectivity to its vzbrN interfaces.
==Configure the VE veth interfaces==
5. Create the VE as you normally would except do NOT specify any IP address, just the hostname. Specifying an IP address during VE creation creates an unwanted venet interface which is not used in this configuration.
The above creates corresponding veth100.0 and veth100.1 devices on the host and updates the host /etc/vz/conf/100.conf file with generated MAC addresses for the veth devices.
==Bridge the host and VE==
7. Next we add the host vethN interfaces to the host bridged interfaces (vzbrN).
/usr/sbin/brctl show
==Configure the VE networking==
9. In the container create the ifcfg network scripts for each interface eth0 and eth1. The scripts should look like standard ifcfg network scripts for a host.
Alternatively, just restart the VE from the host.
==Enable bridging through the host firewall==
11. Add FORWARD ACCEPT statements to the host iptables and ip6tables for each VE IPv4 and IPv6 address. You do NOT need to enable any special network forwarding via sysctl.
13. For each additional VE, start at step #5.
== See also ==
* [[IPv6]]
* [[Differences between venet and veth]]
Anonymous user