Configure the network interface on the server
To connect the server to private and 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 panel 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. The type of configuration file depends on the Ubuntu version:
Ubuntu 20.04 LTS
Ubuntu 22.04 LTS, 24.04 LTS
network:
ethernets:
<eth_name>:
addresses:
- <ip_address>/<mask>
gateway4: <gateway>
nameservers:
addresses: [<dns_servers>]
renderer: networkd
version: 2Specify:
<eth_name>
— name of the network interface of the public network;<ip_address>/<mask>
— The public IP address of the server with a subnet mask (e.g,188.93.23.36/29
);<dns_servers>
— DNS servers. We recommend using Selectel recursive DNS servers But you can specify any available DNS servers;<gateway>
— gateway.
network:
version: 2
renderer: networkd
ethernets:
<eth_name>:
addresses:
- <ip_address>/<mask>
nameservers:
addresses: [<dns_servers>]
routes:
- to: default
via: <gateway>
- to: <destination_subnet>
via: <next_hop_ip_address>Specify:
<eth_name>
— the name of the network interface of the public network;<ip_address>/<mask>
— the public IP address of the server with a subnet mask, e.g.188.93.23.36/29
;<dns_servers>
— DNS servers. We recommend using Selectel recursive DNS servers But you can specify any available DNS servers;<gateway>
— gateway;<destination_subnet>
— for static routes: the CIDR of the destination subnet to which the traffic will be routed;<next_hop_ip_address>
— for static routes: next-hop — the IP address through which devices on the source subnet will route traffic to the destination subnet. You can enter any address from the source subnet.
-
Click
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, e.g.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>
— the name of the network interface of the public network;<mac_address>
— MAC address of the network device;<ip_address>
— IP address, e.g.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, e.g.
188.93.23.36
; - Subnet mask — subnet mask.
- IP-address — the public IP address of the server, e.g.
-
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>
— the private IP address of the server, e.g.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>
— the private IP address of the server, e.g.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>
— the private IP address of the server, e.g.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 — the private IP address of the server, e.g.
192.168.0.2
; - Subnet mask — subnet mask.
- IP-address — the private IP address of the server, e.g.
-
Click OK.