5.4.2.2. Configuring veth Adapter Parameters

While functioning in the bridged mode, each container virtual network adapter appears as a full participant on the network to which it is connected and needs to have its own identity on this network.

Fist of all, to start functioning on a TCP/IP network, a veth virtual adapter should be assigned an IP address. This can be done as follows:

# prlctl set MyCT --ifname netif1 --ipadd 192.168.144.123

This command sets an IP address 192.168.144.123 for the netif1 adapter in the container MyCT. If you want to use the Dynamic Host Configuration Protocol (DHCP) to make the netif1 adapter of the container MyCT automatically receive TCP/IP configuration settings, you can issue the following command instead:

# prlctl set MyCT --ifname netif1 --dhcp yes

Any static IP address assigned to the container virtual network adapter can be removed by executing the following command:

# prlctl set MyCT --ifname netif1 --ipdel 192.168.144.123

You can also delete all IP addresses set for the container MyCT at once:

# prlctl set MyCT --ifname netif1 --ipdel all

You may also wish to set the following parameters for a container network adapter:

  • A DNS server that the container virtual adapter is supposed to use:

    # prlctl set MyCT --ifname netif1 --nameserver 192.168.100.111
  • A gateway to be used for routing the traffic of the container virtual adapter:

    # prlctl set MyCT --ifname netif1 --gw 192.168.111.1