Previous page

Next page

Locate page in Contents

Print this page

Configuring Network Classes

Parallels Server Bare Metal allows you to track the inbound and outbound network traffic as well as to shape the outgoing traffic for a Container. To provide the ability to distinguish between domestic and international traffic, a concept of network classes is introduced. It is important to fully understand this notion, because network classes IDs are used in the values of some network traffic parameters. A network class is a range of IP addresses for which Parallels Server Bare Metal counts and shapes the traffic.

Classes are specified in the /etc/vz/conf/networks_classes file. The file is in the ASCII format, and all empty lines and lines starting with the # sign are ignored. Other lines have the following format:

< class_id > < IP_address >/< prefix_length >

where < class_id > defines the network class ID, and the < IP_address >/< prefix_length > pair defines the range of IP addresses for this class. There may be several lines for each class.

Classes 0 and 1 have special meanings. Class 0 defines the IP address range for which no accounting is performed. Usually, it corresponds to the server subnet (the server itself and its Containers). Setting up Class 0 is not required; however, its correct setup improves performance.

Class 1 is defined by Parallels Server Bare Metal to match any IP address. It must be always present in the network classes definition file. Therefore, it is suggested not to change the default line

1 0.0.0.0/0

in the networks_classes file. Other Classes should be defined after Class 1. They represent exceptions from the "matching-everything" rule of Class 1. The example below illustrates a possible configuration of the network classes definition file:

# server Containers networks
0 192.168.0.0/16

# any IP address (all traffic)
1 0.0.0.0/0

# class 2 – addresses for the "foreign" traffic
2 10.0.0.0/8
2 11.0.0.0/8

# inside "foreign" network there
# is a hole belonging to "local" traffic
1 10.10.16.0/24

In this example, the IP addresses in the range of 192.168.0.0 to 192.168.255.255 are treated as Class 0 addresses and no accounting is done for the traffic from Containers destined to these addresses.

Class 2 matches addresses in two ranges: from 10.0.0.0 to 10.255.255.255 and from 11.0.0.0 to 11.255.255.255 with the exception of addresses in the sub-range of 10.10.16.0 to 10.10.16.255, which are treated as Class 1. All other IP addresses belong to Class 1. As far as the Class 2 addresses in this example are used for foreign routing, the Class 1 addresses are used for local (domestic) routing, by the exclusion method.