Last updated: August 2025

Network Cards

Network Cards

Note: This article series covers configuring Debian 12 for hosting multiple domains and web sites on a single dedicated server. As such, some strategies may be inappropriate for your environment. Sockets for example are appropriate for communication between services hosted on the same machine but not suited to a set up with distributed services (where you'd use ports). Please consult the overview for more information.

You probably want to do a bit of planning before configuring your network cards, my dedicated.com server came with 1 IP address set up but a total of 5 usable addresses.

I want to split my IP addresses across my network hardware and I know I need to use at least 2 for my DNS nameservers. It's better for your nameservers if they use IP's set up on different network adapters so you've got a bit of redundancy in case of a hardware failure.

First off, log in to your server and work out how many network adapters are available:

sudo ip addr show

You can ignore the loopback adapter as that's not hardware (it's software). I can see I have 2 adapters:

enp1s0f0
enp1s0f1
I plan to split my IP addresses across both adapters and then pick 1 IP from each card to be my DNS nameserver addresses, the recomendation is that you don't use sequential IP's for DNS (that's why I chose .83 and .85!). I'll also be allocating 1 IP to ssh for me to log in to administrate it as follows:

Network Adapter Plan
Adaper ID
IP Address
Allocated Purpose

enp1s0f0
74.201.177.82
SSH Administration
74.201.177.83
DNS nameserver 1

enp1s0f1
74.201.177.84
74.201.177.85
DNS nameserver 2
74.201.177.86

Once you've decided how you want to lay things out, you can edit your interfaces file to reflect that configuration. First back up your existing file in case it goes wrong (you wouldn't be able to log back in so you'd have to use that iKVM option you set up earlier and log in as root to restore the original version):

sudo cp /etc/network/interfaces /etc/network/interfaces.bak

Now you can edit the file. Note that you can define your IP addresses using the newer CIDR format (/X at the end), the /X bit (in my case /29) defines the subnet mask (it's not that new, I'm just old!).

You want 1 gateway defined in the file (to avoid any parallel routing issues).

You can see I define the main IP on each card and then add an extra iface clause for each additional IP I want to allocate to that hardware, copy the format making sure you increment the ID of each one on each card (ie. enp1s0f1:1, enp1s0f1:2 ...). Once you're happy that everything looks good, save the file and reboot the server:

sudo nano /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug enp1s0f0
iface enp1s0f0 inet static
	address 74.201.177.82/29
	gateway 74.201.177.81
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 8.8.8.8

auto enp1s0f0:1
iface enp1s0f0:1 inet static
address 74.201.177.83/29

# The secondary network interface
allow-hotplug enp1s0f1
iface enp1s0f1 inet static
	address 74.201.177.84/29
	# dns-* options are implemented by the resolvconf package, if installed
	dns-nameservers 8.8.8.8

auto enp1s0f1:1
iface enp1s0f1:1 inet static
address 74.201.177.85/29

auto enp1s0f1:2
iface enp1s0f1:2 inet static
address 74.201.177.86/29


You should now be able to ping your newly set up IP's:

eg.
ping 74.201.177.83
PING 74.201.177.83 (74.201.177.83) 56(84) bytes of data.
64 bytes from 74.201.177.83: icmp_seq=1 ttl=64 time=0.029 ms
64 bytes from 74.201.177.83: icmp_seq=2 ttl=64 time=0.032 ms
I'd test each one to make sure they all work properly.



2025