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. Open the netplan utility configuration file with the vi text editor:

    vi /etc/netplan/01-netcfg.yaml
  3. Add or change the values for the public network interface settings:

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

    Specify:

    • <eth_name> — name of the public network interface;
    • <ip_address> — public IP address of the server with a subnet mask, for example, 203.0.113.2;
    • <mask> — subnet mask, for example, 24;
    • <dns_servers> — DNS servers. We recommend using Selectel recursive DNS servers, but you can specify any available DNS servers;
    • <gateway> — gateway.
  4. Press ESC.

  5. Exit the vi text editor, saving changes:

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.

Configure a private network interface

  1. Connect to the server via SSH or via the 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 private network interface settings:

    <eth_name>:
    addresses: [<ip_address>]

    Specify:

    • <eth_name> – private network interface name;
    • <ip_address> – private IP address of the server with a subnet mask, for example, 192.168.0.2/24.
  4. Press ESC.

  5. Exit the vi text editor, saving the changes:

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.

  8. Optional: assign a private IP address to the server in the Control Panel.