What's new

VPN Director - 2 VPN Clients and Killswitch (3004.388.8_2)

  • 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!

Skillz

Occasional Visitor
Hi,

I've just configured 2 OVPN clients, both using VPN Director rules with Killswitch enabled.
OVPN1 has DNS config set to exclusive and OVPN has DNS config set to disabled.

The idea is to have my NAS route through OVPN1, then all other clients through OVPN2, unless I route clients specifically through the WAN.

1726938875843.png


The Asuswrt-Merlin VPN Director wiki page states the following:

Keep in mind that the killswitch will affect how lower priority clients work. If a higher priority client triggers its killswitch, then no traffic will go through the lower priority clients. You will generally want your lowest priority client to use the killswitch if you use multiple clients.

With above config, As soon as OVPN1 is disabled, my NAS starts (re)routing through OVPN2, instead of -what I'm expecting- killing the connection.
(If I remove the 'LAN to OVPN' rule, the Killswitch for OVPN1 does work, but I need to have my clients go through OVPN2)

How do I configure 192.168.10.2 to only use OVPN1 and kill the connection when OVPN1 disconnects?

Thank you in advance for reading
 
A little too much going on there to know for sure where the problem lies. Dump the following so we can see exactly how its configured internally. That often reveals the culprit.

Code:
ifconfig
brctl show
ip route show table main
ip route show table ovpnc1
ip route show table ovpnc2
ip rule
iptables -t mangle -vnL
iptables -t nat -vnL
iptables -vnL
cat /tmp/etc/openvpn/client1/config.ovpn
cat /tmp/etc/openvpn/client2/config.ovpn
cat /jffs/openvpn/vpndirector_rulelist
cat /tmp/etc/dnsmasq.conf

Note, do this *after* you've disabled the OpenVPN client so we see the state of the router at the point of failure. Of course, you can mask your public IP, just do so in a way that is obvious and consistent. Do NOT mask any private IPs.
 
Whats the best way to dump the files? Attach them as .txt files?

(it will be a while (12+ hours) before I respond after this post)
 
Let me make it a little easier for you.

Use ssh to access the router and copy/paste the following (in toto) into the terminal window.

Code:
while read cmd; do echo ">>> $cmd"; $cmd; echo; done << EOF &>/tmp/dump.txt
ifconfig
brctl show
ip route show table main
ip route show table ovpnc1
ip route show table ovpnc2
ip rule
iptables -t mangle -vnL
iptables -t nat -vnL
iptables -vnL
cat /tmp/etc/openvpn/client1/config.ovpn
cat /tmp/etc/openvpn/client2/config.ovpn
cat /jffs/openvpn/vpndirector_rulelist
cat /tmp/etc/dnsmasq.conf
EOF
:

It will execute and dump the output from those commands to a file called /tmp/dump.txt. You can verify it worked by browsing the output file.

Code:
less /tmp/dump.txt

(use home/page-up/page-down/end to review, q to exit)

You can then use scp (Linux) or WinSCP to copy the file to your PC, remove your public IP, and either attach it to a followup post, or perhaps post it to PasteBin.

Code:
scp admin@192.168.1.1:/tmp/dump.txt .
 
Last edited:
Ok here's the info you requested.

My AX86U_Pro is behind a modem that I can't put into bridge mode, so that explains the 192.168.100.2 WAN address (I actually forgot about that).

Pastebin Dump.txt

(there's no ovpn1 info, because that connection was turned off)
 
I can see why it's NOT working as expected. But the issue gets a bit complicated, so bear with me.

Prior to 3004.388.8, the kill switch was NOT persistent. After purposely disabling the OpenVPN client, the kill switch would be deactivated. If, however, the OpenVPN client process died of its own accord for some reason, and the kill switch was enabled, the router would insert a "prohibit default" route into that OpenVPN client's routing table (e.g., ovpnc1, in your case) to deny access to the internet. And that OpenVPN client's routing table necessarily remained in-place.

That has all changed according to the 3004.388.8 changelog. Now the kill switch is persistent, even if you disable the OpenVPN client. But there seems to be a difference in how the priority of a kill switch is handled as well, which explains the behavior you're seeing. It's described more precisely by @RMerlin in response to my own (apprarent mis-) understanding of how the kill switch now operates.

https://www.snbforums.com/threads/asuswrt-merlin-3004-388-8_2-is-now-available.91069/post-919044 (see his response specifically to me in that post)


If we look at the ip rules from your own dump, we can see the effect of those changes.

Code:
0:    from all lookup local
90:    from all to 192.168.11.2 lookup main
90:    from all to 192.168.11.3 lookup main
10010:    from 192.168.10.0/24 to 192.168.10.0/24 lookup main
10011:    from 192.168.10.0/24 to 192.168.11.3 lookup main
10012:    from 192.168.10.10 lookup main
10013:    from 192.168.10.1 lookup main
10410:    from 192.168.11.0/24 lookup ovpnc2
10411:    from 192.168.10.0/24 lookup ovpnc2
12210:    from 192.168.10.2 prohibit
12211:    from 192.168.11.0/24 prohibit
12211:    from 192.168.10.0/24 prohibit
32766:    from all lookup main
32767:    from all lookup default

The first column is the priority (higher numbered = lower priority). While the prohibit rule for 192.168.10.2 is there (#12210), it has *lesser* priority than rule that routes 192.168.10.0/24 through OpenVPN client #2 (#10411)!

That is quite a change from the prior behavior of the kill switch. The prohibit rules have been moved to the ip rules list itself rather than (as before) be managed within the individual OpenVPN client routing tables. It effectively means you can no longer expect a failure or disabling of an OpenVPN client w/ the kill switch enabled to prevent fall-through to another OpenVPN client. All you can guarantee is it won't have access to the WAN, or more precisely, the default gateway associated w/ the main routing table, since the prohibit rules do have higher priority than rule #32766 (main).

IOW, at least according to my understanding of @RMerlin's explanations, it's working as intended.
 
Last edited:
Thank you for your patience and detailed explaination as it confirms the behavior that I've been seeing.
I hope there will be a 'fix' or workaround for this 'issue/behavior' in the future.

Personally I can work around this by implementing another solution (not on the router), but it would have been great to have it all in one place.

edit: maybe the VPN Director Wiki could be updated describing this new behavior
 
What you could do as a workaround on the router is to make the rules for each OpenVPN client mutually exclusive. IOW, rather than 192.168.10.0/24 for OpenVPN client #2, exclude 192.168.10.2. You could do that using a ip range to CIDR calculator.

For example, 192.168.10.3 thru 192.168.10.254 produces ...

Code:
192.168.10.3/32
192.168.10.4/30
192.168.10.8/29
192.168.10.16/28
192.168.10.32/27
192.168.10.64/26
192.168.10.128/26
192.168.10.192/27
192.168.10.224/28
192.168.10.240/29
192.168.10.248/30
192.168.10.252/31
192.168.10.254/32

Obviously not very convenient since you now have to add a lot more rules, but it will work.
 
For example, 192.168.10.3 thru 192.168.10.254 produces ...
Sorry to interrupt, but I was just curious about the importance of leaving out .255 (broadcast) ip. Is it really nessisary?

If not there would be fewer rules:
Code:
192.168.10.3/32
192.168.10.4/30
192.168.10.8/29
192.168.10.16/28
192.168.10.32/27
192.168.10.64/26
192.168.10.128/25

And ofcource if one were to restrict dhcp range further to say, start with 16 it would be down to 4:
Code:
192.168.10.16/28
192.168.10.32/27
192.168.10.64/26
192.168.10.128/25

You could put your nas on .15 and create a special rule for that. All wan clients could be set to static assigned dhcp ip between .2 -.15

This ofcourse assumes adding .255 ip is not a stopper? Otherwise one might add it specifically to wan interface as it would always be local anyway?
 
Last edited:

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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