Cannot connect to Wireguard with Dietpi

Hi, I’m new to both DietPi and Wireguard. I set them up but whenever I try to connect my Ubuntu OS to Wireguard through DietPi I get the following error

[#] ip link add vpn type wireguard
[#] wg setconf vpn /dev/fd/63
[#] ip -4 address add 10.x.x.x/24 dev vpn
[#] ip link set mtu 1420 up dev vpn
[#] sysctl net.ipv4.conf.vpn.forwarding=1 net.ipv4.conf.$(sed -n 3p /DietPi/dietpi/.network).forwarding=1
sed: can’t read /DietPi/dietpi/.network: No such file or directory
net.ipv4.conf.vpn.forwarding = 1
sysctl: separators should not be repeated: …forwarding
sysctl: cannot stat /proc/sys/net/ipv4/conf//forwarding: No such file or directory
[#] ip link delete dev vpn


What am i doing wrong?

Hi,

On which systems you are doing this? Your DietPi system or the Ubuntu one?

try to connect my Ubuntu OS to Wireguard through DietPi

I assume WireGuard Server is running on your DietPi system? And you have issues to start the WireGuard Server?

can't read /DietPi/dietpi/.network: No such file or directory

This is your issue, as you missing the .network file. Usually it contains your network information like this

root@DietPiVM1:/DietPi/dietpi# cat .network
0
0
eth0
192.168.0.13
ETH_IP=192.168.0.13
WLAN_IP=
root@DietPiVM1:/DietPi/dietpi#

Thanks I fixed that issue

Hi,

pls can you let us know how you fixed the issues. It might be interesting for other users as well

Hi buddy, can you share how did you get it fixed? Even looking for the same!

Regards,
Bave Smith

bavejik

what exactly is your issue?