I have this configuration. 2 internet access routers. router 1 - router 2 -

1 wireguard server with ip gateway

To connect to wireguard from the internet, I can only open ports on router 2 and I connect to wireguard well but I can't ping any computer on the network. if I change the server gateway to router 2, I can connect to wireguard and ping and connect to the computers on the network

It is necessary that the server uses router 1.

can I configure something in the wireguard server so that the connection works after vpn?

I can't change anything on router 1


  • I suspect you have same network addresses in both subnets and in the vpn also. If this is true, it wouldn't work, you have to change addresses somewhere. Please, attach a network diagram you have, with IP addresses specified for each interface, for this to be clear. In general, having a diagram almost always helps to diagnose and understand networking problems. Dec 15, 2020 at 10:53

1 Answer 1


If you cannot open ports on router 1, ("I can't change anything on router 1", you said) then you can't do what you want. Unless you have open ports on router 1, incoming connections hitting router 1 will simply be dropped. VPN won't help there unless router1 is set to forward VPN to somewhere inside your network, in which case you could presumably forward what you're interested in from the VPN to the Wireguard.

  • I can connect to wireguard server using router 2. What I want is, after connect to the wireguard server, be able to access the computers on the network but having the router 1 as wireguard server gateway.
    – guete
    Dec 14, 2020 at 14:47
  • Yes. Router 1 can only be the gateway for those machines that have router 1 as their default gateway, or have a static route set that points specific IP ranges to router 1. If what you're saying is that you want the Wireguard to talk through router 1 for VPN, you have to tell the WIreguard to establish an outbound VPN to your destination of choice. If you want the Wireguard to do everything except VPN on router 1, you have to change its routing table so that the VPN route is explicitly set to router 2, and the default route is set to router 1.
    – tsc_chazz
    Dec 16, 2020 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.