Configure network
This process configures your server to use Netplan and systemd-resolved to manage both ethernet and Wi-Fi connections through a single, unified configuration file.
-
Install network driver (if applicable)
Section titled “Install network driver (if applicable)”Terminal window lspci -nnk | grep -iA 3 netIf the network controller says “Broadcom” and “BCM43xx”, install the drivers below; otherwise, skip to step 2.
Ensure the
non-freerepository component is enabled for your Debian release. (debanddeb-src)Terminal window sudo nano /etc/apt/sources.listUpdate package lists.
Terminal window sudo apt updateCheck that the Broadcom driver package is available.
Terminal window apt-cache policy broadcom-sta-dkmsInstall the kernel headers, DKMS, NetworkManager and the Broadcom driver.
Terminal window sudo apt install -y linux-headers-$(uname -r) dkms network-manager && sudo apt install -y broadcom-sta-dkmsVerification: If the output includes
wlwith a nonzero size, the driver module is loaded.Terminal window sudo modprobe -r b44 b43 b43legacy ssb brcmsmac bcma && sudo modprobe wl && lsmod | grep wlRemove any wireless interfaces if they exist.
Terminal window sudo nano /etc/network/interfacesDisable Wi-Fi power saving to help prevent connection drops.
/etc/NetworkManager/conf.d/default-wifi-powersave-on.conf sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.confTerminal window [connection]wifi.powersave = 2Restart NetworkManager.
Terminal window sudo systemctl restart NetworkManagerConfigure the corporate Wi-Fi connection using WPA-Enterprise credentials.
Terminal window sudo nmcli connection add type wifi con-name corporate-wifi ssid "YourSSID" wifi-sec.key-mgmt wpa-eap 802-1x.eap peap 802-1x.identity "your_username" 802-1x.password "your_password" 802-1x.phase2-auth mschapv2Connect to the corporate Wi-Fi network.
Terminal window sudo nmcli connection up corporate-wifiTerminal window sudo apt update && sudo apt install linux-headers-$(uname -r) -y && sudo apt install bcmwl-kernel-source -yFor changes to take effect, reboot the system.
Terminal window sudo rebootVerify the driver is active by running
ip link. A wireless interface, typicallywlan0, should now appear in the list. -
Install and enable wpa_supplicant
Section titled “Install and enable wpa_supplicant”Terminal window sudo apt install wpasupplicant -y && sudo systemctl enable --now wpa_supplicant -
Create symlink to systemd-resolved
Section titled “Create symlink to systemd-resolved”Terminal window sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf -
Network configuration
Section titled “Network configuration”systemd-resolved
Section titled “systemd-resolved”-
Open netplan config
Terminal window sudo nano /etc/systemd/resolved.conf.d/10-override-dns.conf -
Update config
/etc/systemd/resolved.conf.d/10-override-dns.conf [Resolve]DNS=1.1.1.1 8.8.8.8FallbackDNS=1.0.0.1 8.8.4.4Domains=~.DNSStubListener=no
netplan
Section titled “netplan”-
Open netplan config
Terminal window sudo nano /etc/netplan/50-cloud-init.yaml -
Update config
- Replace
enp3s0with your ethernet ID fromip link. - Replace
wlan0with your Wi-Fi ID fromip link. - Replace
Your_SSID_NameandYour_Passwordunder access-points.
/etc/netplan/50-cloud-init.yaml network:version: 2renderer: networkdethernets:enp3s0:dhcp4: true# Remove if causing issues when rebootingoptional: truedhcp4-overrides:route-metric: 100use-dns: falsenameservers:addresses: [1.1.1.1, 8.8.8.8]# Optionalwifis:wlan0:dhcp4: trueoptional: truedhcp4-overrides:route-metric: 600use-dns: falsenameservers:addresses: [1.1.1.1, 8.8.8.8]access-points:"Your_SSID_Name":password: "Your_Password" - Replace
-
Apply the config
Terminal window sudo chown root:root /etc/netplan/50-cloud-init.yaml && sudo chmod 600 /etc/netplan/50-cloud-init.yaml -
Apply the config
Terminal window sudo netplan apply
-
-
Restart systemd-resolved
Section titled “Restart systemd-resolved”Terminal window sudo systemctl restart systemd-resolved -
Enable systemd-networkd-wait-online
Section titled “Enable systemd-networkd-wait-online”Terminal window sudo systemctl enable systemd-networkd-wait-online.service -
Reboot the system
Section titled “Reboot the system”Terminal window sudo reboot