I use my Ubiquiti USG for Remote User VPN Using L2TP, but L2TP does not provide routing information to the client, so I needed a way to automatically create routes when the VPN connection fires. Thankfully, this is pretty easy in macOS (and Linux).
/etc/ppp/ip-up file, if present, triggers every time a PPP (L2TP is based on PPP) connection is made, thus making it easy to trigger a route command when a connection is established.
/etc/ppp/ip-up looks like this:
#!/bin/sh /sbin/route add -net <my home network subnet>/24 -interface $1
<my home network subnet>/24 with your network information, and you should be ready to go.
netstat -rn after making a connection, should now show a line similar to the one below, where xxx.xxx.xxx is your remote subnet, routed over a ppp interface
~ netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire ... xxx.xxx.xxx ppp0 USc ppp0 ...
- macOS: Aggregate Device for Teams - Fixing Auto-Adjusting Mic Level —
- macOS: Hiding Menu Bar Icons With Dozer —
- macOS Keeps Asking for SSH Passphrase —
- macOS: Using Custom DNS Resolvers —
- macOS: Using and creating Multi-Output Sound Devices —