Wireguard Server behind isp modem/router

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Goto page Previous  1, 2
Author Message
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Thu Mar 30, 2023 6:39    Post subject: Reply with quote
About the keys that is right there are no private keys involved, you exchanges the public keys.

I read that the client router has 192.168.5.1 and no wireless, but how can you test with your phone connected to that router as it has no wireless?

If wireless is enabled on this router and you have internet on your phone connected to that router but when enabling WireGuard on that phone you get a destination unreachable than something is blocking WireGuard.

Is the primary router to which the client router connects a normal SoHo router or is it a corporate system which blocks VPN?

Can the ISP block WireGuard?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Sponsor
hafren
DD-WRT Novice


Joined: 19 Dec 2012
Posts: 28

PostPosted: Thu Mar 30, 2023 14:40    Post subject: Reply with quote
egc wrote:
I read that the client router has 192.168.5.1 and no wireless, but how can you test with your phone connected to that router as it has no wireless?
I switched wireless on to do the test but just wanted to explain that the client router was setup with basically default settings so I also find it strange that it would block incoming.

egc wrote:
Is the primary router to which the client router connects a normal SoHo router or is it a corporate system which blocks VPN?
Yes a normal SoHo router, actually another R6700v3 with ddwrt - I like to keep things simple Smile , and it has been working fine when I use a commercial vpn provider, vpnunlimited.

egc wrote:
Can the ISP block WireGuard?
I don't know but I don't think so as I have been using wireguard to vpn provider, vpnunlimited

I did change MTU to 1420 on both server & client but same results. WGServer is working fine, send & receive, but zero 0B received on WGclient

egc wrote:
If wireless is enabled on this router and you have internet on your phone connected to that router but when enabling WireGuard on that phone you get a destination unreachable than something is blocking WireGuard.
I asked about keys as wg on iphone requires local private key entry and as a novice I was concerned I might not setup correctly.
Anyway if my setup screen shots are good then it looks like the wgclinet router isn't working so I'm going reset to defaults and set it up again. I am travelling to UK this weekend so plan to install the server and hope I can resolve the client before but if not I'll work at it when I return Crying or Very sad

_________________
Netgear R6700v3 - DD-WRT v3.0-r53001 VPN wireguard setup v35
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Thu Mar 30, 2023 14:55    Post subject: Reply with quote
When setting up you need the private key (whether you get it in a conf file or generate one)

The private key is used to calculate the public key and this public key is the one which is exchanged.

You mention VPN unlimited, the client must no be on VPN unlimited otherwise you are running a tunnel in a tunnel which could be problematic

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
hafren
DD-WRT Novice


Joined: 19 Dec 2012
Posts: 28

PostPosted: Thu Mar 30, 2023 15:35    Post subject: Reply with quote
egc wrote:
You mention VPN unlimited, the client must no be on VPN unlimited otherwise you are running a tunnel in a tunnel which could be problematic
Understand wgclient router is completely separate and VPN unlimited experience was to help rule out other potential traffic blockage with isp or main router. Thanks for all the help.
_________________
Netgear R6700v3 - DD-WRT v3.0-r53001 VPN wireguard setup v35
hafren
DD-WRT Novice


Joined: 19 Dec 2012
Posts: 28

PostPosted: Fri Mar 31, 2023 22:32    Post subject: Reply with quote
@egc I finally have the client & server communicating. I'm not sure reset to default then rebuild the client wireguard settings was the issue but suspect some remnant of the iphone trial as the wgserver client config file was populated and wrong. Embarassed

Moving forward, I have still not succeeded in getting wan out from the wgserver via the client i.e Google doesn't open on the client and ping 8.8.8.8 is destination unreachable.? WGserver has "Allow clients WAN access" checked but I'm thinking there is a dns issue preventing the client access.

_________________
Netgear R6700v3 - DD-WRT v3.0-r53001 VPN wireguard setup v35
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Sat Apr 01, 2023 6:28    Post subject: Reply with quote
Glad that part is solved Smile

From the client side you can do from the the WG client routers command line:
traceroute 8.8.8.8

This will show the route the packets take it should go into the WG tunnel to your WG server and from there on to the internet you can see where it is stuck

From a Windows PC attached to the WG client router you do from cmd (the DOS prompt):
tracert 8.8.8.8

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
hafren
DD-WRT Novice


Joined: 19 Dec 2012
Posts: 28

PostPosted: Sat Apr 01, 2023 12:28    Post subject: Reply with quote
This is what I get. 10.4.0.1 is the wgserver

Tracing route to dns.google [8.8.8.8] over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms vpnclient [192.168.5.1]
2 64 ms * * 10.4.0.1
3 10.4.0.1 reports: Destination host unreachable.

Trace complete.

_________________
Netgear R6700v3 - DD-WRT v3.0-r53001 VPN wireguard setup v35
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Sat Apr 01, 2023 13:48    Post subject: Reply with quote
Does the Client still have "NAT via Tunnel" enabled on the WG tunnel?

If not you have to add on the server side a rule to MASQUERADE the clients subnet out on the WAN:
iptables -t nat -I POSTROUTING -s 192.168.5.0/24 -o $(get_wanface) -j MASQUERADE

The GUI setting on the WG server "Allow Clients WAN Access" only NAT's the WG subnet (10.4.0.0/24) out on the WAN.

Furthermore if you do not have NAT enabled be sure to have the 192.168.5.0/24 subnet in the Allowed IP's on the server to allow the clients subnet.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
hafren
DD-WRT Novice


Joined: 19 Dec 2012
Posts: 28

PostPosted: Sat Apr 01, 2023 14:58    Post subject: Reply with quote
egc wrote:
Does the Client still have "NAT via Tunnel" enabled on the WG tunnel?
No I've changed it now

egc wrote:
If not you have to add on the server side a rule to MASQUERADE the clients subnet out on the WAN:iptables -t nat -I POSTROUTING -s 192.168.5.0/24 -o $(get_wanface) -j MASQUERADE
Does the wgserver need "NAT via Tunnel"?

egc wrote:
Furthermore if you do not have NAT enabled be sure to have the 192.168.5.0/24 subnet in the Allowed IP's on the server to allow the clients subnet.
Yes I have this subnet in allowed ip's

New tracert
Tracing route to dns.google [8.8.8.8] over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms vpnclient [192.168.5.1]
2 64 ms 64 ms 64 ms 10.4.0.1
3 192.168.1.1 reports: Destination host unreachable.

Trace complete.
192.168.1.1 is wgserver router ip

_________________
Netgear R6700v3 - DD-WRT v3.0-r53001 VPN wireguard setup v35
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12915
Location: Netherlands

PostPosted: Sun Apr 02, 2023 12:58    Post subject: Reply with quote
The WG server does not need to enable NAT via tunnel (just follow the Server Setup guide in this).

On the Client side you can enable it for troubleshooting like we are doing.

Can you show screesnhots of the WireGuard page for Server and client.

For the server please show output of (via the command line e.g telnet/putty):
wg
wg showconf oet1
ip route show
iptables -vnL FORWARD | grep oet
iptables -vnL INPUT
iptables -vnL -t nat
iptables -vnL -t raw
grep -E -i 'oet|wireguard' /var/log/messages

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
hafren
DD-WRT Novice


Joined: 19 Dec 2012
Posts: 28

PostPosted: Sat Sep 02, 2023 20:32    Post subject: Reply with quote
@egc Resurrecting this thread. I was unable to get client and server communicating in time to deploy the server in the UK last April. I have now managed to successfully get client and server communicating. Browsing 'my IP address' on the client now reports the server wan ip. I'd like to finalize the set up of the WG client and WG server so I have a few questions which I hope you can answer:

On the client - should I now turn off NAT via tunnel?
On the server should I change the NTP server time zone to UK when I install?
I read of ipv6 leak concerns in the wg server set up guide v49. How how can I mitigate?

egc wrote:

For the server please show output of (via the command line e.g telnet/putty):
wg
wg showconf oet1
ip route show
iptables -vnL FORWARD | grep oet
iptables -vnL INPUT
iptables -vnL -t nat
iptables -vnL -t raw
grep -E -i 'oet|wireguard' /var/log/messages


Do you still want to see the server tenet output?
Thanks for your continuing help.

_________________
Netgear R6700v3 - DD-WRT v3.0-r53001 VPN wireguard setup v35
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum