183 lines
3.5 KiB
Markdown
183 lines
3.5 KiB
Markdown
---
|
|
publish: true
|
|
permalink: /10-19 LIFE/13 TECH SETUP/13.13 OS SETUP/Network.md
|
|
title: Network
|
|
created: 2026-01-29T14:15:15.157-07:00
|
|
modified: 2026-02-05T09:41:11.148-07:00
|
|
tags:
|
|
- network
|
|
- wifi
|
|
- tailscale
|
|
cssclasses: ""
|
|
---
|
|
|
|
Network configuration using NetworkManager with iwd backend, systemd-resolved for DNS, and Tailscale for mesh networking.
|
|
|
|
## Architecture
|
|
|
|
My setup:
|
|
- **NetworkManager** — Connection management
|
|
- **iwd** — WiFi backend (replaces wpa_supplicant)
|
|
- **systemd-resolved** — DNS resolution
|
|
- **dhcpcd** — Disabled (NetworkManager handles DHCP)
|
|
|
|
## Disable dhcpcd
|
|
|
|
NetworkManager handles DHCP itself, so dhcpcd is not needed and can cause conflicts.
|
|
|
|
```bash
|
|
# Stop and disable dhcpcd
|
|
sudo systemctl stop dhcpcd
|
|
sudo systemctl disable dhcpcd
|
|
|
|
# Verify it's not running
|
|
systemctl status dhcpcd
|
|
```
|
|
|
|
If you had dhcpcd managing interfaces, NetworkManager will take over after a reboot.
|
|
|
|
## NetworkManager + iwd
|
|
|
|
Using iwd as the WiFi backend provides better stability than wpa_supplicant, especially on Framework AMD with the MediaTek WiFi card.
|
|
|
|
### Configure iwd backend
|
|
|
|
Create `/etc/NetworkManager/conf.d/wifi-backend.conf`:
|
|
```ini
|
|
[device]
|
|
wifi.backend=iwd
|
|
```
|
|
|
|
### Enable services
|
|
|
|
```bash
|
|
sudo systemctl enable --now NetworkManager
|
|
sudo systemctl enable --now iwd
|
|
```
|
|
|
|
### Disable wpa_supplicant (if installed)
|
|
|
|
```bash
|
|
sudo systemctl stop wpa_supplicant
|
|
sudo systemctl disable wpa_supplicant
|
|
```
|
|
|
|
## DNS with systemd-resolved
|
|
|
|
I use systemd-resolved for DNS instead of letting NetworkManager write to `/etc/resolv.conf` directly.
|
|
|
|
### Enable systemd-resolved
|
|
|
|
```bash
|
|
sudo systemctl enable --now systemd-resolved
|
|
```
|
|
|
|
### Link resolv.conf
|
|
|
|
```bash
|
|
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
|
```
|
|
|
|
### Configure NetworkManager to use it
|
|
|
|
Create `/etc/NetworkManager/conf.d/dns.conf`:
|
|
```ini
|
|
[main]
|
|
dns=systemd-resolved
|
|
```
|
|
|
|
### Verify
|
|
|
|
```bash
|
|
resolvectl status
|
|
```
|
|
|
|
## WiFi Management
|
|
|
|
### CLI (nmcli)
|
|
|
|
```bash
|
|
# List networks
|
|
nmcli device wifi list
|
|
|
|
# Connect
|
|
nmcli device wifi connect "SSID" password "password"
|
|
|
|
# Saved connections
|
|
nmcli connection show
|
|
|
|
# Disconnect
|
|
nmcli device disconnect wlan0
|
|
|
|
# Forget network
|
|
nmcli connection delete "SSID"
|
|
```
|
|
|
|
### TUI (impala)
|
|
|
|
I use [[10-19 LIFE/13 TECH SETUP/13.11 APPS/impala]] for interactive WiFi management — much nicer than `iwctl`:
|
|
|
|
```bash
|
|
impala
|
|
```
|
|
|
|
See [[10-19 LIFE/13 TECH SETUP/13.11 APPS/impala]] for keybindings and configuration.
|
|
|
|
## Tailscale
|
|
|
|
Tailscale creates a secure mesh network between all your devices.
|
|
|
|
### Installation
|
|
|
|
```bash
|
|
curl -fsSL https://tailscale.com/install.sh | sh
|
|
```
|
|
|
|
Or via pacman:
|
|
```bash
|
|
sudo pacman -S tailscale
|
|
```
|
|
|
|
### Setup
|
|
|
|
```bash
|
|
sudo systemctl enable --now tailscaled
|
|
sudo tailscale up
|
|
```
|
|
|
|
Follow the auth URL to connect to your tailnet.
|
|
|
|
### Useful commands
|
|
|
|
```bash
|
|
tailscale status # Show connected devices
|
|
tailscale ip # Show Tailscale IP
|
|
tailscale ping <host> # Ping another device
|
|
tailscale ssh <host> # SSH to another device (if enabled)
|
|
```
|
|
|
|
### Exit node (use another device as VPN)
|
|
|
|
```bash
|
|
# Enable exit node on a device
|
|
sudo tailscale up --advertise-exit-node
|
|
|
|
# Use an exit node
|
|
sudo tailscale up --exit-node=<hostname>
|
|
```
|
|
|
|
## Complete Setup Summary
|
|
|
|
1. Disable dhcpcd
|
|
2. Enable NetworkManager + iwd
|
|
3. Disable wpa_supplicant
|
|
4. Enable systemd-resolved
|
|
5. Link resolv.conf
|
|
6. Install Tailscale
|
|
7. Install [[10-19 LIFE/13 TECH SETUP/13.11 APPS/impala]] for WiFi TUI
|
|
|
|
## Resources
|
|
|
|
- Arch Wiki: https://wiki.archlinux.org/title/NetworkManager#Using_iwd_as_the_Wi-Fi_backend
|
|
- Tailscale docs: https://tailscale.com/kb/
|