Configure the network interface on the server
To connect the server to private и public network configure the network interfaces on the server.
The network interface for the public network is configured automatically only when the automatic OS installation. The interface for the private network must always be configured manually.
You can view the parameters for customization in control panels on the server page → tab Network.
Configure the network interface of the public network
Ubuntu
Debian
CentOS
Windows
-
Connect to the server via SSH or through KVM console.
-
Open the utility configuration file
netplan
with the vi text editor:vi /etc/netplan/01-netcfg.yaml
-
Add or change the values of the public network interface settings:
<eth_name>:
addresses: [<ip_address>/<mask>]
gateway4: <gateway>
nameservers:
addresses: [<dns_servers>]Specify:
<eth_name>
— name of the network interface of the public network;<ip_address>/<mask>
— public IP address of the server with a subnet mask (for example: 188.93.23.36/29);<gateway>
— gateway;<dns_servers>
— DNS servers. We recommend using Selectel recursive DNS servers But you can specify any available DNS servers.
-
Press the key
ESC
. -
Exit the text editor
vi
with the changes intact::wq
-
Apply the configuration:
netplan apply
-
Optional: reboot the server.
-
Connect to the server via SSH or through KVM console.
-
Open the network interfaces configuration file with the vi text editor:
vi /etc/network/interfaces
-
Add or change the values of the public network interface settings:
auto <eth_name>
iface <eth_name> inet static
address <ip_address>
netmask <mask>
gateway <gateway>
dns-nameserver <dns_servers>Specify:
<eth_name>
— name of the network interface of the public network;<ip_address>
— the public IP address of the server (for example: 188.93.23.36);<gateway>
— gateway;<mask>
— subnet mask;<dns_servers>
— DNS servers. We recommend using Selectel recursive DNS servers But you can specify any available DNS servers.
-
Press the key
ESC
. -
Exit the vi text editor with your changes saved:
:wq
-
Restart the network:
service networking restart
-
Optional: reboot the server.
-
Connect to the server via SSH or through KVM console.
-
Output information about the network interfaces:
ip address
-
Create or open a public network interface configuration file with the vi text editor:
vi /etc/sysconfig/network-scripts/ifcfg-<eth_name>
Specify
<eth_name>
— network interface name. -
Add or change the values of the network interface settings:
NAME="<eth_name>"
ONBOOT=yes
NETBOOT=yes
BOOTPROTO=static
HWADDR="<mac_address>"
IPADDR="<ip_address>"
NETMASK="<mask>"
GATEWAY="<gateway>"
TYPE=EthernetSpecify:
<eth_name>
— name of the network interface of the public network;<mac_address>
— MAC address of the network device;<ip_address>
— IP address (for example: 188.93.23.36);<mask>
— subnet mask;<gateway>
— gateway.
-
Press the key
ESC
. -
Exit the vi text editor with your changes saved:
:wq
-
Restart the network:
systemctl restart network
-
Optional: reboot the server.
Example of changing network settings in CentOS in the blog article Network configuration in CentOS 7.
-
Connect to the server via RDP or through KVM console.
-
Open it up Network and Sharing Center.
-
Open the network interface of the public network.
-
Click Properties.
-
From the list, select IPv4.
-
Click Properties.
-
Specify the network interface parameters:
- IP-address — the public IP address of the server (for example: 188.93.23.36);
- Subnet mask — subnet mask.
-
Click OK.
Configure the network interface of the private network
Ubuntu
Debian
CentOS
Windows
-
Connect to the server via SSH or through KVM console.
-
Open the utility configuration file
netplan
with the vi text editor:vi /etc/netplan/01-netcfg.yaml
-
Add or change values for the network interface settings of the private network:
<eth_name>:
addresses: [<ip_address>]Specify:
<eth_name>
— name of the network interface of the private network;<ip_address>
— private IP address of the server (for example: 192.168.0.2/24).
-
Press the key
ESC
. -
Exit the vi text editor with your changes saved:
:wq
-
Apply the configuration:
netplan apply
-
Optional: reboot the server.
-
Connect to the server via SSH or through KVM console.
-
Open the network interfaces configuration file with the vi text editor:
vi /etc/network/interfaces
-
Add or change values for the network interface settings of the private network:
auto <eth_name>
iface <eth_name> inet static
address <ip_address>Specify:
<eth_name>
— name of the network interface of the private network;<ip_address>
— private IP address of the server (for example: 192.168.0.2/24);
-
Press the key
ESC
. -
Exit the vi text editor with your changes saved:
:wq
-
Restart the network:
service networking restart
-
Optional: reboot the server.
-
Connect to the server via SSH or through KVM console.
-
Output information about the network interfaces:
ip address
-
Create or open the private network interface configuration file with the vi text editor:
vi /etc/sysconfig/network-scripts/ifcfg-<eth_name>
Specify
<eth_name>
— name of the network interface of the private network. -
Add or change the values of the network interface settings:
NAME="<eth_name>"
ONBOOT=yes
BOOTPROTO=none
IPADDR="<ip_address>"Specify:
<eth_name>
— name of the network interface of the private network;<ip_address>
— private IP address of the server (for example: 192.168.0.2/24);
-
Press the key
ESC
. -
Exit the vi text editor with your changes saved:
:wq
-
Restart the network:
systemctl restart network
-
Optional: reboot the server.
Example of changing network settings in CentOS in the blog article Network configuration in CentOS 7.
-
Connect to the server via RDP or through KVM console.
-
Open it up Network and Sharing Center.
-
Open the network interface of the private network.
-
Click Properties.
-
From the list, select IPv4.
-
Click Properties.
-
Specify the network interface parameters:
- IP-address — private IP address of the server (for example: for example: 192.168.0.2);
- Subnet mask — subnet mask.
-
Click OK.