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 private and public-network, configure the network interfaces on the server.

The network interface for the public network is configured automatically only when automatic OS installation. The interface for a private network must always be configured manually.

You can view the settings for configuration in Control Panel on the 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:

        <eth_name>:
    addresses: [<ip_address>/<mask>]
    gateway4: <gateway>
    nameservers:
    addresses: [<dns_servers>]

    Specify:

    • <eth_name> is the name of the network interface of the public network;
    • <ip_address>/<mask> — public IP address of the server with subnet mask (for example: 188.93.23.36/29);
    • <gateway> is a gateway;
    • <dns_servers> — DNS servers. DNS Selectel: 188.93.16.19, 188.93.17.19.
  4. Press the ESC key.

  5. Exit the vi text editor with the 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> is the name of the network interface of the private network;
    • <ip_address> — private IP address of the server (for example: 192.168.0.2/24).
  4. Press the ESC key.

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

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.