Wireguard and static IP on RPi4 B

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
dregilley
Posts: 3
Joined: Sun Sep 08, 2019 8:23 pm

Wireguard and static IP on RPi4 B

Post by dregilley » Sun Sep 08, 2019 8:39 pm

First things first, total Linux / RPi / DietPi newbie here. Background is public safety enterprise IT, but all Windows.

Recently discovered Wireguard and DietPi. Got everything up and running until I tried setting a static IP on my RPi4 B using dietpi-config. It immediately broke Wireguard. I tried setting the static before installing wireguard and after the install, neither worked.

With the static IP in place wireguard failed to load at startup and I got the following results from "systemctl status [email protected]". If I revert back to DHCP it loads fine. Currently running with a DHCP reservation at the router so all is working, just figured it might bite someone else?

Process: 552 ExecStart=/usr/bin/wg-quick up wg0 (code=exited, status=255/EXCEPTION)
Main PID: 552 (code=exited, status=255/EXCEPTION)

Sep 08 20:34:03 DietPi wg-quick[552]: [#] wg setconf wg0 /dev/fd/63
Sep 08 20:34:03 DietPi wg-quick[552]: [#] ip -4 address add 10.9.0.1/24 dev wg0
Sep 08 20:34:03 DietPi wg-quick[552]: [#] ip link set mtu 1420 up dev wg0
Sep 08 20:34:03 DietPi wg-quick[552]: [#] sysctl net.ipv4.conf.wg0.forwarding=1 net.ipv4.conf.$(sed -n 3p /DietPi/dietpi/.network).forwarding=1
Sep 08 20:34:03 DietPi wg-quick[552]: net.ipv4.conf.wg0.forwarding = 1
Sep 08 20:34:03 DietPi wg-quick[552]: sysctl: cannot stat /proc/sys/net/ipv4/conf/NONE/forwarding: No such file or directory
Sep 08 20:34:03 DietPi wg-quick[552]: [#] ip link delete dev wg0
Sep 08 20:34:04 DietPi systemd[1]: [email protected]: Main process exited, code=exited, status=255/EXCEPTION
Sep 08 20:34:04 DietPi systemd[1]: [email protected]: Failed with result 'exit-code'.
Sep 08 20:34:04 DietPi systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.

ghettopi
Posts: 37
Joined: Tue Jul 30, 2019 8:17 pm

Re: Wireguard and static IP on RPi4 B

Post by ghettopi » Fri Sep 13, 2019 11:43 pm

Your error is literally in red dude... It's self explanatory.

dregilley
Posts: 3
Joined: Sun Sep 08, 2019 8:23 pm

Re: Wireguard and static IP on RPi4 B

Post by dregilley » Sun Sep 15, 2019 1:21 am

Thanks for the reply, but I fear it wasn't very helpful...

#1 It's red because I made it red to draw attention to it.
#2 If I knew what was causing that file / directory to disappear by my setting a static IP, and why it is magically no longer missing after reverting to DHCP, I wouldn't have reached out for help.

ghettopi
Posts: 37
Joined: Tue Jul 30, 2019 8:17 pm

Re: Wireguard and static IP on RPi4 B

Post by ghettopi » Sun Sep 15, 2019 3:20 pm

There is a clear error in your .config. The directory is missing. You could try creating it as perhaps it isn't made automatically. If other things are missing then you need to check those too.

If this is too hard to set up on your own I recommend a guide from Youtube e.g.

https://www.youtube.com/watch?v=n00ayGUdCaI

or even

https://www.youtube.com/watch?v=Q6pR_JEMRQA

Post Reply