What I want to do is establish a VPN from the GlInet travel router to the VPN server 1. Once this tunnel has been established and I have a laptop connected to the GLinet network, I want to create a VPN from the laptop to VPN server 2.
The problem I have is that when connecting to the second server from the laptop I am arriving through the Public IP of the GLinet and not from the public IP of server 1.
In my opinion, the GLInet router is not sending the wireguard traffic of the client (Laptop) through tunnel , I have verified and the rest of the traffic such as web, ping, etc. goes through tunnel 1 correctly.
But as @admon said you need to check the PBR rules after establishing the first tunnel; the option in question might get created automatically. To verify it issue:
The tunnels both work correctly independently, the main problem is that the traffic from the tunnel established by the laptop does not pass through the tunnel established by the glinet (or so we suspect).
You said that ping etcetera worked, but not a website this seem to be a issue i also had not so long ago.
However the wgserver was for me on a vanilla OpenWrt, the fix for me was when i edited the interface for wireguard and go to advanced tab, the checkbox default gateway has to be checked for the server, this sound weird at first since this is often discouraged on the client, but it seems for the server it works the best way if it follows the lan route and firewall.
Can you check if that change behaviour?, or is this full gl-inet firmware?
Then you might enable allow access to wan in the server.
Can you check if that change behaviour?, or is this full gl-inet firmware?
my wg servers are dockers on different servers in different locations. These work correctly since they have several clients each working well.
You said that ping etcetera worked, but not a website this seem to be a issue i also had not so long ago.
I have not talked about web because it seems simpler to analyze this case through ping and traceroute.
Smells like DNS error.
Regarding the DNS, it works correctly and in my opinion it is not very relevant here. The DNS resolves correctly, in fact the ping is being resolved by DNS.
This is confusing! because at the beginning you said ping is going through the tunnel …
Anyway, once the first tunnel is successfully connected, share the WG gl client configurations. I am suspecting that GL’s PBR Global Proxy is conflicting with your configuration! It could be fixed using the option that I referred to at the beginning of the discussion.
Lastly, uci show is a command and not option. If you execute it it will show you all openwrt configurations including the VPN’s. Try it again.
This is confusing! because at the beginning you said ping is going through the tunnel …
Well, I explained myself wrong, after activating tunnel 2 on the client, no traffic passes through tunnel 1 of the glinet.
Anyway, once the first tunnel is successfully connected, share the WG gl client configurations. I am suspecting that GL’s PBR Global Proxy is conflicting with your configuration! It could be fixed using the option that I referred to at the beginning of the discussion.
Lastly, uci show is a command and not option. If you execute it it will show you all openwrt configurations including the VPN’s. Try it again.
I understand, my router does not show any “network.vpn.nohostroute” at the output of command “uci show”.
And as I showed in the previous message, the “uci set network.vpn.nohostroute=“1”” command does not work either, could it be a problem with the openwrt version?
The DNS works for me, anyway, I don’t quite understand what problem the DNS could be causing in my problem. Maybe I haven’t fully explained the case or I don’t see how the DNS could affect me.
Thanks! For the AllowedIPs option specify the IP of the vpn server 1.
The internal wg IP of the server right (10.13.13.1)? Or the public?
FwMark = 51820
Should this be added in the configuration of server 1? or the client?
And regarding the issue of uci set network.vpn.nohostroute=“1”? Is it normal that this command is not available in my router? Could it be the openwrt version?