Configure a network interface on a server
To connect the server to a private and public network, configure the network interfaces on the server.
The network interface for the private network will be configured automatically only during Linux OS auto-installation. For Windows OS, you can configure the private network interface only manually.
You can view configuration parameters in the control panel: in the top menu, click Products → Dedicated Servers → Servers → server page → Network tab.
Configure the public network interface
Ubuntu
Debian
CentOS
Windows
Ubuntu 20.04 LTS
Ubuntu 22.04 LTS, 24.04 LTS
-
Connect to the server via SSH or via the KVM console.
-
View the name of the configuration file for the
netplanutility:ls /etc/netplan/The response will show the name of the configuration file. For example:
01-netcfg.yamlCopy the name of the configuration file.
-
Open the
netplanutility configuration file with thevitext editor:vi /etc/netplan/<file_name>Specify
<file_name>— the name of the configuration file that you copied in step 2. -
Add or change the parameter values of the public network interface:
network:version: 2renderer: networkdethernets:<eth_name>:addresses:- <ip_address>/<mask>gateway4: <gateway>nameservers:addresses: [<dns_servers>]Specify:
<eth_name>— public network interface name;<ip_address>— public IP address of the server, for example203.0.113.2;<mask>— subnet mask, for example, for a public shared subnet the mask is24;<dns_servers>— DNS servers. We recommend using Selectel recursive DNS servers, but you can specify any available DNS servers;<gateway>— gateway.
-
Press ESC.
-
Exit the
vitext editor, saving changes::wq -
Apply the configuration:
netplan apply -
Optional: reboot the server.
Configure the private network interface
Ubuntu
Debian
CentOS
Windows
-
Connect to the server via SSH or via the KVM console.
-
View the name of the configuration file for the
netplanutility:ls /etc/netplan/The response will show the name of the configuration file. For example:
01-netcfg.yamlCopy the configuration file name.
-
Open the configuration file of the
netplanutility using the text editorvi:vi /etc/netplan/<file_name>Specify
<file_name>— the configuration file name that you copied in step 2. -
Add or change the parameter values of the private network interface:
<eth_name>:addresses: [<ip_address>]Specify:
<eth_name>— name of the private network interface;<ip_address>— private IP address of the server with a subnet mask, for example,192.168.0.2/24.
-
Press ESC.
-
Exit the
vitext editor and save changes::wq -
Apply the configuration:
netplan apply -
Optional: reboot the server.
-
Optional: assign the private IP address to the server in the control panel.