With a private network, you can divide your existing network into multiple logical networks. This subdivision gives you greater flexibility when assigning your servers to individual network segments.
In a private network, the servers communicate using local IPs that are not routed on the Internet.
When you create a server and select an existing or a new private network, the new server is automatically added to the selected private network. In these cases, the server is also automatically configured to use the private network. If you add an existing server to a private network, you must then manually configure the network interface to access the private network. As soon as the server has been assigned to the private network, an additional, non-configured network interface is available on the assigned server.
To configure the private network, you need the subnet address, the corresponding subnet mask, the MAC address, and the name of the additional, non-configured network interface. You can then use this data to configure the network interface for the private network.
Follow the steps below to configure your network interface for the private network:
You are in the Cloud Panel.
You have already created a private network.
Determining the MAC Address and Name of the Private Network Interface
Log on to the server as an administrator.
To call the MAC address and the name of the network interface for the private network, type the following command: firstname.lastname@example.org:~# ip addr
email@example.com:~# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:50:56:1b:5b:11 brd ff:ff:ff:ff:ff
inet 18.104.22.168/32 brd 22.214.171.124 scope global eth0
inet6 fe80::250:56ff:fe1b:5b11/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
link/ether 00:50:56:38:87:f2 brd ff:ff:ff:ff:ff:ff:ff
inet6 fe80::250:56ff:fe38:87f2/64 scope link
valid_lft forever preferred_lft foreverIn this example, the name of the unconfigured network interface for the private network is eth1. The MAC address is 00:50:56:38:87:f2.
Make a note of the name of the unconfigured network interface for the private network and the MAC address.
Each IPv4 address consists of two parts. The first part is the address for the network where the host is located. The second part is the address for the host. The subnet mask specifies which part of the IPv4 address is used to identify the host (or server) and which part classifies the network itself.
To define the IP address, you need the following information:
Subnet address: In this case, the subnet address specifies the private network.
Subnet mask: The subnet mask specifies which part of the IP address is used to identify the host (or server) and which part classifies the network itself.
You can use this information to define the IP address at which the server should be accessible in the private network.
If the defined subnet address or network range is 192.168.1.0 and the 255.255.255.0 subnet mask is used, this means that all computers or servers in the first three bytes match. In this example, you can use a maximum of 254 host addresses (192.168.1.1 to 192.168.1.254). If you have assigned 2 servers to a private network, you can assign the IP addresses 192.168.1.1 and 192.168.1.2 to the respective servers.
Configuring the Private Network Interface
Open the /etc/sysconfig/network-scripts directory.
Use vi to create the configuration file for the non-configured interface. The file name of this interface has the following format:
firstname.lastname@example.org:~# vi /etc/sysconfig/network-scripts/ifcfg-eth1
To configure the private network, enter the following information:
The vi editor has an insert mode and a command or command mode. You can enter the insert mode by pressing the i button. In this mode, the entered characters are immediately inserted into the text. To enter the command mode, press the ESC key. When you use command mode, your keyboard input is interpreted as a command.
To exit vi and save the file, type the following command, and then press Enter:
To restart the network interface for the private network, enter the following command:
email@example.com: ifup [NAME_OF_THE_INTERFACE].cfg Example:
ifup ifcfg- eth
Checking the New Configuration
To verify that the network interface is configured correctly for the private network, send a ping to the IP address of another server assigned to the private network.
[root@localhost ~]# ping -c 1 192.168.1.1
PING 192.168.1.4 (192.168.1.4) 56(84) bytes of data.
64 bytes from 192.168.1.4: icmp_seq=1 ttl=64 time=0.019 ms
--- 192.168.1.4 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.019/0.019/0.019/0.000 ms
When the data packets are delivered to the server, the network interface has been configured for the private network.