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 the automatic OS installation. The interface for the private network must always be configured manually.

You can view the parameters for customization in control panel on the server page → tab Network.

Configure the network interface of the public network

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

  2. Open the utility configuration file netplan 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> — name of the network interface of the public network;
    • <ip_address>/<mask> — The 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.
  4. Click ESC.

  5. Exit the text editor vi with the changes intact:

    :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 through KVM console.

  2. Open the utility configuration file netplan 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> — name of the network interface of the private network;
    • <ip_address> — the private IP address of the server, e.g. 192.168.0.2/24.
  4. Press the key ESC.

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

    :wq
  6. Apply the configuration:

    netplan apply
  7. Optional: reboot the server.