Back to blog

Self-Hosting Networking Cheat Sheet

·1 min read

DHCP Server Not Responding

Recently, my self-hosting setup went down. My router updated and in turn the DHCP server crashed, causing my server to fail to renew it's local IP address. The fix, was of course, restarting my router.

bash
# Check network interfaces
networkctl status
networkctl status <interface>

# Network File: /run/systemd/network/10-netplan-<iface>.network
# If network file is not set in the networkctl status:
# - Ensure correct permissions
sudo chmod 600 /etc/netplan/*yaml
sudo netplan generate
sudo systemctl restart systemd-networkd

# Check network program conflicts
systemctl is-active NetworkManager
systemctl is-active systemd-netword
# - Disable NetworkManager
sudo systemctl disable --now NetworkManager
# -- Stronger than disable
sudo systemctl mask NetworkManager

# Check Netplan config `/etc/netplan/01-netcfg.yaml`
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      dhcp4: true
      dhcp6: false
      optional: false

# Run netplan
sudo netplan apply

# Check DHCP
# - If there's requests and no responses, there's likely an issue with the DHCP server
sudo tcpdump -i <interface> -n port 67 or port 68

# Check IP
ip -br addr