The ip-up
file is responsible of adding routes to the routing table when a network connection is established. By modifying it, you can add your own routes. A great use case is when you want to access the TLM's Gitlab while on the VPN of a client.
First, you need to know wich interface to use for the new route.
ifconfig
will show all interfaces available.
Open /etc/ppp/ip-up
and add those lines (replace enX
by your interface of choice)
#!/bin/sh
/sbin/route add 10.0.0.5 -interface enX
You can also only add the route with the command route
(with sudo
)
Make the file executable:
sudo chmod 0755 /etc/ppp/ip-up
Reset your network connection and it should be up.
Yout can check it with sudo route get 10.0.0.5
or with netstat -rn -f inet
In order to resolve the URL, you will need to add a host in your host file. MacOS will check there first before checking it on the DNS of the VPN.
Add this line to: /private/etc/hosts
10.0.0.5 gitlab.eradash.info
Be sure that the route you want to add is not conflicting with one in the VPN. If so, you wont be able to access the one on your VPN, since it will be redirected to the interface specified in the routing table.