By connecting an adapter on the physical server to a virtual network, you can join all virtual machines and containers included in the virtual network to the network to which the corresponding adapter is connected.
Let us assume the following:
-
The
enp0s6
physical adapter and thenetwork1
virtual network exist on the hardware node. For information on creating virtual networks, see Section 5.4.1.1, “Creating Virtual Networks”. -
The
enp0s6
physical adapter is connected to the local network. -
The
br1
network bridge for theenp0s6
physical adapter is created. For information on creating network bridges, see Section 5.4.1.2, “Creating Network Bridges for Physical Network Adapters”. -
The container
MyCT
is connected to thenetwork1
virtual network. Detailed information on joining virtual machines and containers to virtual networks is given in Section 5.4.2.3, “Connecting Containers to Virtual Networks” and Section 5.4.3.3, “Connecting Virtual Machines to Virtual Networks”.
To connect the enp0s6
adapter to the network1
virtual network and thus to join the container MyCT
to the network behind enp0s6
, run this command on the server:
# prlsrvctl net set network1 -i enp0s6
To check that the enp0s6
physical adapter has been successfully added to the network1
virtual network, you can execute the following command:
# prlsrvctl net list
Network ID Type Bound To Bridge
Host-Only host-only virbr1
Bridged bridged enp0s5 br0
network1 bridged enp0s6 br1
As you can see, the enp0s6
adapter is now joined to the network1
virtual network. That means that the container MyCT
whose virtual network adapter is connected to network1
can access the local network behind enp0s6
.