Skip to main content

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

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

  2. View the name of the configuration file for the netplan utility:

    ls /etc/netplan/

    The response will show the name of the configuration file. For example:

    01-netcfg.yaml

    Copy the name of the configuration file.

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

    vi /etc/netplan/<file_name>

    Specify <file_name> — the name of the configuration file that you copied in step 2.

  4. Add or change the parameter values of the public network interface:

    network:
    version: 2
    renderer: networkd
    ethernets:
    <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 example 203.0.113.2;
    • <mask> — subnet mask, for example, for a public shared subnet the mask is 24;
    • <dns_servers> — DNS servers. We recommend using Selectel recursive DNS servers, but you can specify any available DNS servers;
    • <gateway> — gateway.
  5. Press ESC.

  6. Exit the vi text editor, saving changes:

    :wq
  7. Apply the configuration:

    netplan apply
  8. Optional: reboot the server.

Configure the private network interface

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

  2. View the name of the configuration file for the netplan utility:

    ls /etc/netplan/

    The response will show the name of the configuration file. For example:

    01-netcfg.yaml

    Copy the configuration file name.

  3. Open the configuration file of the netplan utility using the text editor vi:

    vi /etc/netplan/<file_name>

    Specify <file_name> — the configuration file name that you copied in step 2.

  4. 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.
  5. Press ESC.

  6. Exit the vi text editor and save changes:

    :wq
  7. Apply the configuration:

    netplan apply
  8. Optional: reboot the server.

  9. Optional: assign the private IP address to the server in the control panel.