2.2.1.2. prlsrvctl net

The prlsrvctl net command is used to create and configure virtual networks.

Table 2.15. Subcommands

NameDescription

net add

Creates a new virtual network

net set

Configures the parameters of an existing virtual network.

net del

Removes an existing virtual network.

net list

List the available virtual networks.

net add

Creates a new virtual network.

Syntax. 

prlsrvctl net add <vnetwork_ID> [-i, --ifname <if>] [-m, --mac <mac_address>]
                  [-t, --type <bridged|host-only>] [-d, --description <desc>]
                  [--ip <IP_address>[/<mask>]] [--dhcp-server <on|off>]
                  [--dhcp-ip <IP_address>] [--ip-scope-start <IP_address>]
                  [--ip-scope-end <IP_address>] [--ip6 <IP_address>[/<mask>_]]
                  [--dhcp6-server <on|off>] [--dhcp-ip6 <IP_address>]
                  [--ip6-scope-start <IP_address>] [--ip6-scope-end <IP_address>]

Table 2.16. Options

NameDescription

<vnetwork_ID>

A user-defined name that will identify the new virtual network.

-i, --ifname <if>

The name of a physical network adapter on the hardware node to which this virtual network should be bound.

-m, --mac <mac_address>

The MAC address of a virtual network adapter on the hardware node to which this virtual network should be bound.

-t, --type <bridged|host-only>

The type of the virtual network to create. Possible values are:

  • bridged. A  virtual machine and container connected to this type of virtual network appears as an independent computer on the network.
  • host_only (default). A virtual machine and container connected to this type of virtual network can access only the hardware node and the virtual machines and containers connected to the same virtual network.

-d, --description <desc>

A user-defined description of the virtual network. Descriptions with white spaces must be enclosed in quotation marks.

--ip <IP_address>[/<mask>] --ip6 <IP_address>[/<mask>]

Set an IPv4/IPv6 address and subnet mask for the OpenVZ virtual adapter.

--dhcp-server <on|off> --dhcp6-server <on|off>

Enable or disable the OpenVZ virtual DHCPv4/DHCPv6 server.

--dhcp-ip <IP_address> --dhcp-ip6 <IP_address>

Set an IPv4/IPv6 address for the OpenVZ virtual DHCPv4/DHCPv6 server.

--ip-scope-start <IP_address> --ip-scope-end <IP_address> --ip6-scope-start <IP_address> --ip6-scope-end <IP_address>

Set the starting and ending IPv4/IPv6 addresses for the DHCPv4/DHCPv6 pool. The virtual machines and containers connected to the network you are creating will automatically receive their IPv4/IPv6 addresses from the respective DHCPv4/DHCPv6 pool.

net set

Configures the settings of an existing virtual network.

Syntax. 

prlsrvctl net set <vnetwork_ID> [-i, --ifname <if>] [-m, --mac <mac_address>]
                  [-t, --type <bridged|host-only>] [-d, --description <desc>]
                  [--ip <IP_address>[/<mask>]] [--dhcp-server <on|off>]
                  [--dhcp-ip <IP_address>] [--ip-scope-start <IP_address>]
                  [--ip-scope-end <IP_address>] [--ip6 <IP_address>[/<mask>_]]
                  [--dhcp6-server <on|off>] [--dhcp-ip6 <IP_address>]
                  [--ip6-scope-start <IP_address>] [--ip6-scope-end <IP_address>]

Table 2.17. Options

NameDescription

<vnetwork_ID>

The name of the virtual network to modify.

-i, --ifname <if>

The name of a physical network adapter on the hardware node to which this virtual network should be bound.

-m, --mac <mac_address>

The MAC address of a virtual network adapter on the hardware node to which this virtual network should be bound.

-t, --type <bridged|host-only>

The type of the virtual network to modify. Possible values are:

  • bridged. A  virtual machine and container connected to this type of virtual network appears as an independent computer on the network.
  • host_only (default). A virtual machine and container connected to this type of virtual network can access only the hardware node and the virtual machines and containers connected to the same virtual network.

-d, --description <desc>

A user-defined description of the virtual network. Descriptions with white spaces must be enclosed in quotation marks.

--ip <IP_address>[/<mask>] --ip6 <IP_address>[/<mask>]

Set an IPv4/IPv6 address and subnet mask for the OpenVZ virtual adapter.

--dhcp-server <on|off> --dhcp6-server <on|off>

Enable or disable the OpenVZ virtual DHCPv4/DHCPv6 server.

--dhcp-ip <IP_address> --dhcp-ip6 <IP_address>

Set an IPv4/IPv6 address for the OpenVZ virtual DHCPv4/DHCPv6 server.

--ip-scope-start <IP_address> --ip-scope-end <IP_address> --ip6-scope-start <IP_address> --ip6-scope-end <IP_address>

Set the starting and ending IPv4/IPv6 addresses for the DHCPv4/DHCPv6 pool. The virtual machines and containers connected to the network you are creating will automatically receive their IPv4/IPv6 addresses from the respective DHCPv4/DHCPv6 pool.

net del

Deletes an existing virtual network.

Syntax. 

prlsrvctl net del <vnetwork_ID>

Table 2.18. Options

NameDescription

<vnetwork_ID>

The name of the virtual network to delete.

net list

Lists the existing virtual networks.

Syntax. 

prlsrvctl net list