Does anyone have a nice script that they use to execute changes to the routing table in Ubuntu 14.04 and up when the vpn connection is established?  Currently, I have to establish the vpn connection and then I run the following script:
root@XXXXX:~/Documents# ./route.sh add vpn_server_ip
---------------------------------------------------------------------------------------------------------------------------------------------
#!/bin/bash
if [ "x$2" == "x" ];
then
  echo "vpn server ip missing!  ./route.sh add/del vpn_server_ip "
else
 case "$1" in
 add)
 # restore default route to home network
 ip route delete default
 ip route add default via 192.168.43.1 dev wlp3s0
 # obtain ip address for vpn_vpn
 ifdown vpn_vpn
 ifup vpn_vpn
 # add route to vpn server
 ip route add $2/32 via 192.168.43.1 dev wlp3s0
 ip route delete default
 ip route add default via 192.168.74.1 dev vpn_vpn
 ;;
 del)
 ip route del $2/32
 ip route del default
 ip route add default via 192.168.43.1 dev wlp3s0
 ifdown vpn_vpn
 ;;
 esac
fi
~                                                                                       
~                                                                                       
~                                                                                       
~                                                                                       
~                                                                                       
~                                                                                       
~                                                                                       
~                                                                                       
"route.sh" 46 lines, 619 characters
------------------------------------------------------------------------------------------------------------------------------------------
			
									
									
						Linux Client Route Configuration
- 
				raafat
 - Posts: 223
 - Joined: Fri Jul 03, 2015 2:21 pm
 
Re: Linux Client Route Configuration
I think you'r going at the wrong direction, so tell us more about your setup so that i can help you (:
Good luck
			
									
									
						Good luck
- 
				thisjun
 - Posts: 2458
 - Joined: Mon Feb 24, 2014 11:03 am
 
Re: Linux Client Route Configuration
NetworkManager is using in ubuntu.
https://help.ubuntu.com/community/NetworkManager
			
									
									
						https://help.ubuntu.com/community/NetworkManager
