Raspberry pi as Wireguard server and OpenVPN client: No connection to devices


I am trying and searching a lot but I am struggling with my scenario. I found some same posts, but there was no solution.

-I am using a Raspberry PI ( to connect as a openvpn client to Nordvpn. This PI is the Gateway for my local clients to use the VPN connection

  • I set up a Wireguard Server on the PI to receive connection from outside my network. The ports are open on my Router (

  • When I am connecting my smartphone from my home network (not using the PI as VPN Gateway, using the ISP-IP) to the Wireguard server, I am connected and I am using the open vpn connection. I am getting the IP from Nordvpn. Everything works fine.

  • When I am connecting the smartphone outside my LAN with mobile connection, I am connected to the VPN as well (getting the Nordvpn-IP) I am able to access internal devices like the router or any WLAN-repeater but I am not able to connect to the PI via SSH or HTTP.

It seems, that PI is not accepting the connection from the Wireguard connection.

Can anyone. help me please. Here is my configuration:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface       UG    0      0        0 tun0         UG    202    0        0 eth0 UGH   0      0        0 eth0   U     0      0        0 wg0   U     0      0        0 tun0       UG    0      0        0 tun0   U     202    0        0 eth0


sudo ip rule add from lookup 9
sudo ip route add default via table 9
sudo ip route add default via dev eth0 table 6
sudo ip rule add fwmark 0x55 priority 1000 table 6
sudo ip route flush cache
sudo iptables -t filter -A FORWARD -i wg0 -o tun0 -j ACCEPT
sudo iptables -t filter -A FORWARD -o wg0 -i tun0 -j ACCEPT
sudo iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE


Address =
MTU = 1420
ListenPort = 51820
fwMark = 0x55
PrivateKey = ...

PublicKey = ...
PresharedKey = ...
AllowedIPs =

Thanks in advance

Not an expert, you may need to open ports on the Pi’s openvpn interface?

I know it’s always nice to help out polite people. You are very polite no doubt. So please don’t take this as impolite, But have you tried a solution that includes at least 1 piece of Gl-inet hardware. Just saying, being a Gl-inet forum.

1 Like

My guess is that you have to go through the Raspberry Pi’s WAN Wireguard IP address ( that may require port forwarding on port 22 for SSH. I don’t think there is NAT loopback on the LAN side.