Skip to main content
Configure the network interface on the server
Last update:

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 ProductsDedicated ServersServers → Server page → Network tab.

Configure the network interface of the public network

  1. Connect to the server via SSH or via KVM console.

  2. Open the netplan utility configuration file with the vi text editor:

    vi /etc/netplan/01-netcfg.yaml
  3. Add or change the values of the public network interface settings. The type of configuration file depends on the Ubuntu version:

    network:
    ethernets:
    <eth_name>:
    addresses:
    - <ip_address>/<mask>
    gateway4: <gateway>
    nameservers:
    addresses: [<dns_servers>]
    renderer: networkd
    version: 2

    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 DNS servers, but you can specify any available DNS servers;
    • <gateway> — gateway.
  4. Press ESC.

  5. Exit the vi text editor with your changes saved:

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.

Configure the network interface of the private network

  1. Connect to the server via SSH or via KVM console.

  2. Open the netplan utility configuration file with the vi text editor:

    vi /etc/netplan/01-netcfg.yaml
  3. 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.
  4. Press ESC.

  5. Exit the vi text editor with your changes saved:

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.

  8. Optional: add a private subnet to the control panel.