By default, each OpenVZ server has one network bridge br0
set up for a single physical network adapter. If your server has more than one physical network adapter, you need to create a network bridge for each of those that you need to connect to a bridged virtual network.
Assuming that two physical network adapters enp0s5
and enp0s6
and a bridge br0
exist on the server, you can create a bridge br1
for enp0s6
as follows:
-
In the
/etc/sysconfig/network-scripts/
directory, create two configuration files: one for the physical adapterenp0s6
and one for the bridgebr1
. You can use the configuration files forenp0s5
andbr0
, respectively, as a basis:cat /etc/sysconfig/network-scripts/ifcfg-enp0s5 > /etc/sysconfig/network-scripts/ \ ifcfg-enp0s6 cat /etc/sysconfig/network-scripts/ifcfg-br0 > /etc/sysconfig/network-scripts/ \ ifcfg-br1
-
In
ifcfg-enp0s6
, setDEVICE
toenp0s6
,BRIDGE
tobr1
, andUUID
to empty. -
In
ifcfg-br1
setDEVICE
tobr1
,NAME
toenp0s6
, andUUID
to empty. -
Restart network to apply changes:
/etc/init.d/network restart
After the network bridge is set up, you can bind a virtual network to it.