Configure the network interface on the server
To connect the server to the private and public network, configure the network interfaces on the server.
The network interface for the public network is configured automatically only when the OS is automatically installed. The interface for the private network must always be configured manually.
You can view the settings for customization in the Control Panel: from the top menu, click Products → Dedicated Servers → Servers → Server page → Network tab.
Configure the network interface of the public network
Ubuntu
Debian
CentOS
Windows
-
Open the
netplan
utility configuration file with thevi
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>
— the name of the network interface of the public network;<ip_address>/<mask>
— 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 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>
— 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 is the IP address through which devices on the source subnet will forward traffic to the destination subnet. You can enter any address from the source subnet.
-
Press ESC.
-
Exit the
vi
text editor with your changes saved::wq
-
Apply the configuration:
netplan apply
-
Optional: reboot the server.
-
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>
— the name of the network interface of the public network;<ip_address>
— 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 ESC.
-
Exit the
vi
text editor with your changes saved::wq
-
Restart the network:
service networking restart
-
Optional: reboot the server.
-
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>
is the name of the network interface. -
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>
— The MAC address of the network device;<ip_address>
— IP address, e.g.188.93.23.36
;<mask>
— subnet mask;<gateway>
— gateway.
-
Press ESC.
-
Exit the
vi
text editor with your changes saved::wq
-
Restart the network:
systemctl restart network
-
Optional: reboot the server.
An example of changing network settings in CentOS in the blog article Configuring Networking in CentOS 7.
-
Open the 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 — public IP address of the server, e.g.
188.93.23.36
; - Subnet mask — subnet mask.
- IP-address — public IP address of the server, e.g.
-
Press OK.
Configure the network interface of the private network
Ubuntu
Debian
CentOS
Windows
-
Open the
netplan
utility configuration filewith 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>
— the name of the network interface of the private network;<ip_address>
— private IP address of the server, e.g.192.168.0.2/24
.
-
Press ESC.
-
Exit the
vi
text editor with your changes saved::wq
-
Apply the configuration:
netplan apply
-
Optional: reboot the server.
-
Optional: add a private subnet to the control panel.
-
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, e.g.192.168.0.2/24
;
-
Press ESC.
-
Exit the
vi
text editor with your changes saved::wq
-
Restart the network:
service networking restart
-
Optional: reboot the server.
-
Optional: add a private subnet to the control panel.
-
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>
is the 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, e.g.192.168.0.2/24
;
-
Press ESC.
-
Exit the
vi
text editor with your changes saved::wq
-
Restart the network:
systemctl restart network
-
Optional: reboot the server.
-
Optional: add a private subnet to the control panel.
An example of changing network settings in CentOS in the blog article Configuring Networking in CentOS 7.
-
Open the 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, e.g.
192.168.0.2
; - Subnet mask — subnet mask.
- IP-address — private IP address of the server, e.g.
-
Press OK.
-
Optional: add a private subnet to the control panel.