MacOS VPN Auto Add Routes

I tested on macOS 10.14, L2TP VPN.

I connect to my office VPN to work remotely, but I don’t want to send all traffic to VPN interface. Usually, I open a and execute commands after VPN connected: is address block used in my office, is VPN gateway address.

It’s really inconvenient. But I have a new solution: networksetup.

Usage: networksetup -setadditionalroutes <networkservice> [ <dest> <mask> <gateway> ]*
        Set additional IPv4 routes associated with <networkservice>
        by specifying one or more [ <dest> <mask> <gateway> ] tuples.
        Remove additional routes by specifying no arguments.
        If <gateway> is “”, the route is direct to the interface

First, find your service name.

Find your VPN connection name, in my case ‘My Office’.

If you have multiple route entries to add,

L2TP is a Point-to-Point VPN, the gateway address is not that important, that’s why I use “” instead of

MacOS VPN Auto Add Routes by @sskaje:

Hijack DnsPod HttpDNS



Continue reading “Hijack DnsPod HttpDNS” »

Hijack DnsPod HttpDNS by @sskaje:

Asus Merlin Policy Based Routing



这回直接简化,搞了个github的repo,,把jffs的配置脚本放进去了,依旧是 dnsmasq + ipset,但是openvpn-event脚本 也可以手工维护路由列表,自动走openvpn的网卡。

Asus Merlin Policy Based Routing by @sskaje:

北京联通IPv6 DNS

之前google搜的时候,看到有人说一个 好像是 的,千万别用!!!

北京联通IPv6 DNS by @sskaje: