This is an old revision of the document!
Debian Server Network Setup
Debian Network - Server Interface Setup
As of Debian 10 (Buster) Debian still by default uses this interface Setup. It can be setup to use netplan inface.
Ubuntu (as of version 14.04) defaults to Predictable Network Interface Names, also see Systemd Docs. I have no problem with this. In any case, you should always check dev names and not assume names, such as “eth0”
To check available interfaces and names use: ip link, or the more verbose ip a.
The units 4 main port will be setup to look like a router with 1 WAN port and 3 LAN port. The WAN port will be setup on NIC1 with the LAN ports 1-3 will be on bridged NIC2-4.
Ensure the bridge utilities are loaded: sudo apt install bridge-utils.
Edit the network configuration file: /etc/network/interfaces as follows:
The following is a list of some stanza not used and why:
Note:
- Use
ip aandip rto analyse current network configuration - Use
sudo journalctl -xeu networkingto check any errors on networking
References:
- NetworkConfiguration see section on Bridging
Network - Netplan Setup
sudo vim /etc/netplan/network.yaml|
network:
#setup network interfaces
version: 2
renderer: networkd
ethernets:
eno1: #start for pppoe and setup modem IP access
dhcp4: yes # yes for dhcp, no for pppoe
dhcp6: yes # yes for dhcp, no for pppoe or not required
addresses:
- [192.168.5.2/24] #Access to the modem web interface
eno2:
dhcp4: no
dhcp6: no
optional: true
eno3:
dhcp4: no
dhcp6: no
optional: true
eno4:
dhcp4: no
dhcp6: no
optional: true
#Setup Bridge Interface
bridges:
br0:
addresses:
- 192.168.1.1/24 #IPv4
- "2001:470:1f2c:20c::3/64" #IPv6
interfaces: [eno2, eno3, eno4]
nameservers:
addresses: ["2001:470:1f2c:20c::3", 192.168.1.1, 9.9.9.9, 1.1.1.1]
parameters:
stp: off # disable Spanning Tree Protocol
forward-delay: 9 # forwarding delay
hello-time: 2 # see netplan.io for definition
max-age: 12 # see netplan.io for definition
#Setup Tunnel Interfaces
tunnels:
he-ipv6: # Hurricane Electric IPv6 tunnel
mode: sit
remote: 216.218.142.50
local: 207.7.254.238
addresses:
- "2001:470:1f2c:10d::2/64"
gateway6: "2001:470:1f2c:10d::1"
- The final command is used to enable the command to run at start-up:
sudo systemctl enable ipv6_start.service. - This also needs to be performed after each time netplan apply is used:
sudo systemctl start ipv6_start.service.
Router Configuration Network Setup
When I initially setup the router I want to use a different network setting. The following is my basic setup netplan yaml file.
''sudo vim /etc/netplan/50-cloud-init.yaml''
Currently Ubuntu (20.04) defaults to netplan.io, where as Debian 10 does not. So in Debian the /etc/network/interfaces need to be disabled, if using netplan. Where as in Ubuntu the auto configuration needs to be disabled.
I am using Debian 12 now and am moving back to /etc/network/interfaces for network configuration. As the DHCP and DNS server now run in a VM/Docker containers, this simplifies settings on the main router functions.
I wrote 2 scripts to switch between configuration:
Use sudo bash tononrouter.sh to move to non router configuration.
Use sudo bash tonrouter.sh to move to non router configuration.
VLAN Info
My ISP states that its setup uses VLAN ID=0. This is a bit ambiguous, does this mean VLAN 801.1q is not used, or priority tagging 801.1p is used, which uses the full VLAN tag frame and has an effective VLAN ID = 0, but is referred to as a priority tag not VLAN? The general online documentation on this matter is vague too. Look's like an experiment to see what works is the only option: 1. Ignore 801.q VLAN entirely, and 2. Attempt too use VLAN priority tagging.
Load the vlan module: sudo apt install vlan.
I tried a number of different configurations of VLAN using for example ip link add add link eno1 name eno1.1 vlan id 1 in the systemctl pppoe.service configuration. I found that my ISP did not seem to need the VLAN defined, so I have not used, and not investigated further.
Some useful links:
- Wikipedia IEEE 802.1Q, IEEE P802.1p
- This one talks about reliable network target with systemdRunning Services After the Network is up.