Virtual Switch > Configuring a private network on Debian and Ubuntu Cloud Servers

06 Configuring a private network on Debian and Ubuntu Cloud Servers

 
The operations described may affect the system and data, potentially causing malfunctions or data loss:
  • always back up your data or the entire server externally before performing any operation;
  • if available, create a snapshot of the server from the management panel before making changes to the system;
  • for unmanaged services, you are responsible for managing the operating system and software;
  • if in doubt, consult a trusted system administrator or check the latest official documentation for the operating system or software in use.

Before proceeding

Before configuring the private network in the operating system: You can configure the network interface temporarily, for testing or verification purposes, or permanently.

Temporarily configuring the private network on Debian and Ubuntu

The temporary configuration remains active until the next Cloud Server restart.

To temporarily configure the network interface:
  • access the Cloud Server via SSH or using the available console;
  • run the following command:

    ifconfig <interface> <ip_address> netmask <netmask>

    where:
    • <interface> is the network interface connected to the Virtual Switch;
    • <ip_address> is the private IP address you want to configure;
    • <netmask> is the private network netmask.
  • for example:

    ifconfig eth2 192.168.0.11 netmask 255.255.255.0

  • verify the configuration by running:

    ifconfig <interface>

    for example:

    ifconfig eth2

Permanently configuring the private network on Debian and Ubuntu

To make the configuration permanent:
  • open the configuration file:

    nano /etc/network/interfaces

  • enter the settings for the network interface you want to configure. For example:

    auto lo
    iface lo inet loopback

    auto eth0
    iface eth0 inet static
    address 192.168.0.11
    netmask 255.255.255.0

  • save the changes with CTRL+O and close the editor with CTRL+X.
Repeat the configuration for all Debian and Ubuntu Cloud Servers you want to connect to the private network, assigning each network interface a unique private IP address belonging to the same network and using the corresponding netmask.

What to do after configuration

After configuring the private network on the Cloud Servers, verify the private network configuration and check that the Cloud Servers can communicate correctly using their respective private IP addresses.