DataLife Engine / How to route selective traffic to a VPN tunnel in macOS?

How to route selective traffic to a VPN tunnel in macOS?


To route specific traffic through a VPN tunnel in macOS, follow these steps:

1. Create the Script File: Open Terminal and create a file named /etc/ppp/ip-up with the following command:
sudo nano /etc/ppp/ip-up

Then, paste the following content into the file:
#!/bin/sh
/sbin/route add SUBNET -interface $1

Replace SUBNET with the subnet you want to route through the VPN (e.g., 192.168.0.0/16).

2. Set Permissions: Make the script executable by running the following command:
sudo chmod 0755 /etc/ppp/ip-up

This command ensures that the script can be executed by the system.
19-02-2024, 16:43
Вернуться назад