extute ip route show
and compare route table before and after connecting to the vpn server to get all required addresses
start.sh
#!/bin/sh [ "$UID" -eq 0 ] || exec sudo "$0" "$@" vpnclient start sleep 2s vpncmd localhost /client /CMD AccountConnect [ConnectionName] dhclient [VPN_Adapter] ip route add [VPN_Server_IP]/32 via [Gateway_Address] dev [Network_Device_Name] ip route del default via [Gateway_Address] dev [Network_Device_Name]
#!/bin/sh [ "$UID" -eq 0 ] || exec sudo "$0" "$@" vpnclient start sleep 2s vpncmd localhost /client /CMD AccountConnect GE dhclient vpn_vpn ip route add 145.245.93.56/32 via 192.168.1.1 dev wlp3s0 ip route del default via 192.168.1.1 dev wlp3s0
stop.sh
#!/bin/sh [ "$UID" -eq 0 ] || exec sudo "$0" "$@" vpncmd localhost /client /CMD AccountDisconnect GE vpnclient stop ip route del default via 192.168.30.1 dev vpn_vpn ip route del 145.245.93.56 via 192.168.1.1 dev wlp3s0 ip route del 192.168.30.0/24 dev vpn_vpn proto kernel scope link src ip route add default via 192.168.1.1 dev wlp3s0 proto dhcp metric 600 echo 'nameserver 8.8.8.8' > /etc/resolv.conf echo 'nameserver 8.8.4.4' >> /etc/resolv.conf
References
https://pupli.net/2016/09/19/how-to-setup-softether-in-ubuntu/