Extended configurations in Amsterdam
May 17, 2023
Updated May 19, 2023

Configuring the network interface on Debian

Debian Networks

Using another OS?

Select the desired version or distribution.

Cloud servers are often collected in common logical infrastructure for interaction: application servers can be assembled into a cluster, DB servers handles read\writes requests from another servers, backup software connects to target nodes, VPN servers processing clients’ traffic etc.

Cloud server is accessible after installation via public IP address – this is obviously convenient for administration. Meanwhile, network channel has limitation which can be as obstacle for transferring big amount of data between servers.

Instead of using public IP it is possible to create isolated (local) network and connect needed servers to it for intercommunication. Bandwidth is much higher in local network and allows transferring more traffic from server to server.

New network interface is created once a server is connected to a local network. It is even possible to create server without public IP and connect it directly to a local network – in this case server will not be accessible from outside.

Creating isolated networks as well as routed ones is possible for vStack cloud and VMWare cloud. Additionally, VMWare allows creating public networks.
Debian 11 is setting up network connections with using config files in /etc/network/ directory.

In previous versions the settings for network interface were set in single file /etc/network/interfaces. In version 11 this file exists and has the only string (besides comments):

Interfaces file

It specifies that real settings will be taken from files resided in /etc/network/interfaces.d/ directory.

The same approach of splitting a single configuration file into separate ones for each interface is used as for some other system software. Mistake\typo in any file will not cause a common network failure. It is also easy to copy prepared config file or delete it if not needed anymore.

Example of simple configuration with static IP

  • Debian 11 server is created with public IP;
  • Isolated (local) network is created with range (specify another one for your network);
  • Server is connected to the local network.

Public IP is assigned to enp0s5 interface, and new interface enp0s6 in appeared without settings after connection to the local network:

all interfaces

Usually, static IP addresses are assigned on servers. To assign IP to interface enp0s6 new file /etc/network/interfaces.d/enp0s6 has to be created with the following content:

auto enp0s6
iface enp0s6 inet static
mtu 1500

With these settings interface enp0s6 will be active when OS is started.

To apply it network systemd service has to be restarted:

systemctl restart networking

Running again command “ip a” shows that IP is assigned correctly:

New assigned IP

If there are other servers already connected to the same local network than accessibility of IP can be checked after these steps. Otherwise, add any server and ensure it can communicate with local addresses instead of public.

You may be also interested in

5 out of 5
Аverage rating : 5
Rated by: 1
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.