I have successfully installed Wireguard on Debian Buster. Now I wanted to configure IPv6 afterwards. I have done that. But the settings inside the [Peer]
-Section of wg0.conf
do not seem to be persistent.
systemctl stop [email protected]
nano /etc/wireguard/wg0.conf
Result:
[Peer]
PublicKey = xxxxx
AllowedIPs = 10.200.200.2/32, xxx:xxxx:xx:xxx:100::2/72
After saving and restarting the service systemctl start [email protected]
the wg0.conf
looks fine.
When I restart the VM or the Service again, all my additional settings are lost.
[Peer]
PublicKey = xxxxx
AllowedIPs = 10.200.200.2/32
Any idea?
Thats how my wg0.conf
should look like
[Interface]
Address = 10.200.200.1/24
Address = xxxx:xxx:xx:xxx::1/72
DNS = 10.200.200.1
SaveConfig = true
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROU$
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTR$
ListenPort = 51820
PrivateKey = xxx
[Peer]
PublicKey = xxx
AllowedIPs = 10.200.200.2/32, xxx:xxxx:xx:xxx:100::2/72
[Peer]
PublicKey = xxx
AllowedIPs = 10.200.200.3/32, xxx:xxxx:xx:xxx:100::3/72
[Peer]
PublicKey = xxx
AllowedIPs = 10.200.200.4/32, xxx:xxxx:xx:xxx:100::4/72
Solved the issue. The magic trick: always stop the Interface with
wg-quick down wg0
before editing the wg0.conf File.systemctl stop [email protected]
will override thewg0.conf
File after the next start.