Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| computer:network:wireguard [2021/11/15 06:34] – ↷ Links adapted because of a move operation springm | computer:network:wireguard [2025/06/05 05:43] (current) – spring | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Setup ====== | ||
| * see also https:// | * see also https:// | ||
| * lokale Kopie {{: | * lokale Kopie {{: | ||
| + | ===== DNS-Refresh für Ubuntu 24 Client ===== | ||
| + | To refresh or update the DNS server settings used by a WireGuard client on Ubuntu 24.04, you need to ensure both your WireGuard configuration and your system' | ||
| + | |||
| + | Use systemd-resolved with PostUp (Recommended for Ubuntu 24.04) | ||
| + | |||
| + | The DNS = ... line in the config is only processed if the system is set up to use resolvconf or openresolv. On Ubuntu 24.04, systemd-resolved is the default resolver and does not process the DNS = ... line automatically | ||
| + | |||
| + | Instead, use a PostUp command in your config to set the DNS server via resolvectl: | ||
| + | |||
| + | [Interface] | ||
| + | PrivateKey = ... | ||
| + | Address = ... | ||
| + | # DNS = 10.10.0.2 | ||
| + | PostUp = resolvectl dns %i 10.10.0.2 | ||
| + | PostUp = resolvectl domain %i ~. | ||
| + | PostDown = resolvectl revert %i | ||
| + | |||
| + | This tells systemd-resolved to use the specified DNS server for the WireGuard interface when it comes up, and to revert the setting when the interface goes down | ||
| + | |||
| + | Restart wireguard to apply settings | ||
| + | |||
| + | 4. Verify DNS Settings | ||
| + | |||
| + | Check the DNS settings applied to your WireGuard interface: | ||
| + | |||
| + | resolvectl status wg0 | ||
| + | |||
| + | Look for the DNS Servers line to confirm your changes took effect | ||
| + | |||
| + | ==== OrangePi ==== | ||
| apt install -y linux-headers-current-sunxi qrencode dirmngr | apt install -y linux-headers-current-sunxi qrencode dirmngr | ||
| apt install -y wireguard-tools | apt install -y wireguard-tools | ||