Enable WireGuard on a KimSuffi server

Hello

Following another post 4 days ago, I hadn't tried using network-manager...

So:

I install WireGuard

sudo apt install wireguard

I copy a configuration (generated by a Freebox) into /etc/wireguard/wg0.conf:

[Interface]
PrivateKey = **************************************
Address = 192.168.27.71/32
DNS = nnn.nnn.nnn.nnn
MTU = 1360

[Peer]
PublicKey = PJ61Y3lfxoChmdXLUlDs3IKB9PIEUXWkmUCmGbPq0mk=
Endpoint = xxx.xxx.xxx.xxx:44570
AllowedIPs = 0.0.0.0/0, 192.168.27.64/27, 192.168.1.0/24
PersistentKeepalive = 0

and I run:

sudo wg-quick up wg0

Several ip commands execute, then resolvconf returns nothing and hangs the terminal.

At this point, you can no longer ping the server.

You have to uninstall WireGuard to get out of this...

What is happening and how can it be fixed?

I should note that ufw is disabled.
If I reactivate it, everything works fine as long as I don’t reboot.
After a reboot, the server becomes inaccessible as well, even without WireGuard.

Hi @MartinR2

When you run wg-quick up wg0, the command modifies the server's routing table to send all traffic (including SSH connections) through the VPN tunnel to the Freebox peer.

To fix it, I recommend these steps:

  1. Access rescue mode :right_arrow: From the OVHcloud client area, reboot your server in rescue mode. This will allow you to access the system files and revert the changes without needing an SSH connection.
  2. Mount the filesystem:
    mount /dev/sda1 /mnt (adjust the partition according to your system)
  3. Disable or delete the WireGuard configuration
    rm /mnt/etc/wireguard/wg0.conf
  4. Check the persistent configuration:
    chroot /mnt
    systemctl disable wg-quick@wg0

Exit the chroot environment and reboot the server in normal mode.

If you want to use WireGuard without losing SSH access, the key is to modify the AllowedIPs line in the wg0.conf file. Instead of AllowedIPs = 0.0.0.0/0, you should limit the routes that are sent through the tunnel.

Let us know how it goes, cheers.
Sergio Turpín