What's new

Can I have my killswitch and Router inet traffic via a tunnel too?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

rfmodulator

New Around Here
Experience Level: Dangerous
Router: Asus RT-AC56R
Firmware: Merlin 384.6
Other: Single NAT on LAN (modem is in pass-through mode), All tunnels are OpenVPN

I've configured my router as a client of a well known public VPN service which supports port forwarding. This works.

I've configured a private OpenVPN server on my router and enabled the proper port to be forwarded in my public VPN account. This works.

I've installed the OpenVPN client on my laptop and my phone. I am able to connect to my private VPN from either device remotely, and in any combination of single or nested VPN tunnels on either end of the connection.

My current goal:

I want to ensure there no leaks are present in the public VPN tunnel without my prior knowledge and consent. Part of this is to enable "Block routed clients if tunnel goes down" (i.e.. the "kill switch"). To get this ability, I have to configure Redirect Internet traffic to use Policy Rules. (But why though? I know, different forum...)

My current issue:

Using Policy Rules, and rules that I believe to be correct, I am unable to get the router to use the public VPN for its own internet access, and therefore the router does not listen for incoming connections through the public VNP forwarded port.

To put it another way, if I setup Policy Rules the router still listens on and connects to the internet via my ISP's WAN interface.

Using Policy Rules, all internal network clients are routed properly through the public VPN tunnel for internet access.

…all of this is true for Policy Rules and Policy Rules (strict).

Additionally, if I choose either No or All, the router listens on and connects to the internet via my public VPN tunnel, and I am able to reach my private VPN through the public VPN forwarded port.

The All option makes sense, send everything through the tunnel, beautiful.

How or why this works with the No option seems completely counter intuitive to me. I would expect selecting No would prevent all internet traffic from being redirected through the tunnel. This is not what I want, but what I expect, and in fact it does work like I want it to, not like I expect it to. I expect No to be the exact opposite of All.

...I'm sure all of that is about as clear as mud, so here's a demonstration:

Oops... over limit... see replies.

This makes it seem so simple:
https://github.com/RMerl/asuswrt-merlin/wiki/Policy-based-routing
...but instead of Router via WAN Iface, I expected to select the VPN Iface and be good. Actually, I expected the 0/24 would handle the Router as well without an explicit rule. By good, I mean all LAN and Router internet traffic routes through the VPN tunnel, and the "Block routed clients..." option is available.

I've attempted to search for a solution (for a few days now), but the keywords are tricky and nothing I've found seems to match my situation.

I'll be happy to test any settings and post any other output that is relevant and helpful to solving the problem.

At this point I really want to know how to solve this as described for my own curiosity, but if something about this proves to be simply impossible to do with Policy Rules, can I stick with the RIT All option, and implement a kill switch in a different way?

Thank you!
 
Last edited:
Code:
VPN Disabled
====================================================================================
MY.ISP.NET.14
====================================================================================
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
MY.ISP.NET.1    *               255.255.255.255 UH    0      0        0 eth0
MY.ISP.NET.0    *               255.255.255.0   U     0      0        0 eth0
10.8.0.0        *               255.255.255.0   U     0      0        0 tun21
192.168.1.0     *               255.255.255.0   U     0      0        0 br0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         MY.ISP.NET.1.re 0.0.0.0         UG    0      0        0 eth0
====================================================================================
Success: I can see your service on MY.ISP.NET.14 on port (VPNFWD)
====================================================================================





VPN - RIT: NO
====================================================================================
VPN.PUB.NET.83
====================================================================================
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
MY.ISP.NET.1    *               255.255.255.255 UH    0      0        0 eth0
VPN.PUB.NET.82  MY.ISP.NET.1.re 255.255.255.255 UGH   0      0        0 eth0
MY.ISP.NET.0    *               255.255.255.0   U     0      0        0 eth0
VPN.PRI.NET.0   *               255.255.255.0   U     0      0        0 tun12
10.8.0.0        *               255.255.255.0   U     0      0        0 tun21
192.168.1.0     *               255.255.255.0   U     0      0        0 br0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         VPN.PRI.NET.1   128.0.0.0       UG    0      0        0 tun12
128.0.0.0       VPN.PRI.NET.1   128.0.0.0       UG    0      0        0 tun12
default         MY.ISP.NET.1.re 0.0.0.0         UG    0      0        0 eth0
====================================================================================
Success: I can see your service on VPN.PUB.NET.83 on port (VPNFWD)
====================================================================================





VPN - RIT: ALL
====================================================================================
VPN.PUB.NET.83
====================================================================================
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
MY.ISP.NET.1    *               255.255.255.255 UH    0      0        0 eth0
VPN.PUB.NET.82  MY.ISP.NET.1.re 255.255.255.255 UGH   0      0        0 eth0
MY.ISP.NET.0    *               255.255.255.0   U     0      0        0 eth0
VPN.PRI.NET.0   *               255.255.255.0   U     0      0        0 tun12
10.8.0.0        *               255.255.255.0   U     0      0        0 tun21
192.168.1.0     *               255.255.255.0   U     0      0        0 br0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         VPN.PRI.NET.1   128.0.0.0       UG    0      0        0 tun12
128.0.0.0       VPN.PRI.NET.1   128.0.0.0       UG    0      0        0 tun12
default         MY.ISP.NET.1.re 0.0.0.0         UG    0      0        0 eth0
====================================================================================
Success: I can see your service on VPN.PUB.NET.83 on port (VPNFWD)
====================================================================================





VPN - RIT: Policy Rules 
(no rules)
====================================================================================
MY.ISP.NET.14
====================================================================================
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
MY.ISP.NET.1    *               255.255.255.255 UH    0      0        0 eth0
VPN.PUB.NET.82  MY.ISP.NET.1.re 255.255.255.255 UGH   0      0        0 eth0
MY.ISP.NET.0    *               255.255.255.0   U     0      0        0 eth0
VPN.PRI.NET.0   *               255.255.255.0   U     0      0        0 tun12
10.8.0.0        *               255.255.255.0   U     0      0        0 tun21
192.168.1.0     *               255.255.255.0   U     0      0        0 br0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         MY.ISP.NET.1.re 0.0.0.0         UG    0      0        0 eth0
====================================================================================
Success: I can see your service on MY.ISP.NET.14 on port (VPNFWD)
====================================================================================





VPN - RIT: Policy Rules
Blanks 0.0.0.0 0.0.0.0 VPN  
====================================================================================
MY.ISP.NET.14
====================================================================================
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
MY.ISP.NET.1    *               255.255.255.255 UH    0      0        0 eth0
VPN.PUB.NET.82  MY.ISP.NET.1.re 255.255.255.255 UGH   0      0        0 eth0
MY.ISP.NET.0    *               255.255.255.0   U     0      0        0 eth0
VPN.PRI.NET.0   *               255.255.255.0   U     0      0        0 tun12
10.8.0.0        *               255.255.255.0   U     0      0        0 tun21
192.168.1.0     *               255.255.255.0   U     0      0        0 br0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         MY.ISP.NET.1.re 0.0.0.0         UG    0      0        0 eth0
====================================================================================
Success: I can see your service on MY.ISP.NET.14 on port (VPNFWD)
====================================================================================





VPN - RIT: Policy Rules
All 192.168.1.0/24 0.0.0.0 VPN 
====================================================================================
MY.ISP.NET.14
====================================================================================
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
MY.ISP.NET.1    *               255.255.255.255 UH    0      0        0 eth0
VPN.PUB.NET.82  MY.ISP.NET.1.re 255.255.255.255 UGH   0      0        0 eth0
MY.ISP.NET.0    *               255.255.255.0   U     0      0        0 eth0
VPN.PRI.NET.0   *               255.255.255.0   U     0      0        0 tun12
10.8.0.0        *               255.255.255.0   U     0      0        0 tun21
192.168.1.0     *               255.255.255.0   U     0      0        0 br0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         MY.ISP.NET.1.re 0.0.0.0         UG    0      0        0 eth0
====================================================================================
Error: I could not see your service on VPN.PUB.NET.83 on port (VPNFWD)
====================================================================================





VPN - RIT: Policy Rules
All 192.168.1.0/24 0.0.0.0 VPN  
Router 192.168.1.1 0.0.0.0 VPN  
====================================================================================
MY.ISP.NET.14
====================================================================================
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
MY.ISP.NET.1    *               255.255.255.255 UH    0      0        0 eth0
VPN.PUB.NET.82  MY.ISP.NET.1.re 255.255.255.255 UGH   0      0        0 eth0
MY.ISP.NET.0    *               255.255.255.0   U     0      0        0 eth0
VPN.PRI.NET.0   *               255.255.255.0   U     0      0        0 tun12
10.8.0.0        *               255.255.255.0   U     0      0        0 tun21
192.168.1.0     *               255.255.255.0   U     0      0        0 br0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         MY.ISP.NET.1.re 0.0.0.0         UG    0      0        0 eth0
====================================================================================
Error: I could not see your service on VPN.PUB.NET.83 on port (VPNFWD)
====================================================================================
 
Where (for all intensive purposes):

MY.ISP.NET is my ISP's WAN

VPN.PUB.NET is my public VPN's public network

VPN.PRI.NET is my public VPN's local network

VPNFWD is the port my public VPN is forwarding for me

RIT is short for Redirect Internet traffic


For each section, the layout is as such:



The option(s) tested

================================================================

Output of the command 'wget -O - -q http://api.ipify.org' executed in an SSH on the router

================================================================

Output of the command 'route' executed in an SSH on the router

================================================================

Result from http://www.canyouseeme.org/ on a LAN client (note the difference in address as compared to wget in SSH)

================================================================



Before testing each of the option(s), I disabled the VPN client, verified that everything returned to "normal" and nothing weird was lingering around from a previous configuration.
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top