I'm trying for several days now to solve my problem. I have been using openvpn for windows for quite a while and after replacing windows with ubuntu 13.10, I was happy to see that openvpn is available for ubuntu as well.
I copied my settings from windows and in /var/log/syslog I see that my connection is successfully created. However, no matter what I do, I'm unable to set routes. In windows, this was simply done by script that worked as follows (ip addresses slightly differ since I have to keep them private):
c:\windows\system32\route.exe delete 18.104.22.168 c:\windows\system32\route.exe delete 22.214.171.124 del tmp.cmd c:\windows\system32\route.exe print | grep.exe -m1 "^ *0.0.0.0" | sed.exe s/\x20\x20*/\t/g | cut.exe -f4 | sed "s/.*/c:\\windows\\system32\\route.exe add 126.96.36.199 mask 255.255.255.255 &/" > tmp.cmd c:\windows\system32\route.exe print | grep "^ *172.16.0.1" | sed s/\x20\x20*/\t/g | cut -f4 | sed "s/.*/c:\\windows\\system32\\route.exe add 188.8.131.52 mask 255.255.255.0 &/" >> tmp.cmd tmp.cmd
After connection was set and above script was executed, connections to my servers went through VPN, while all other went normally.
Since this script uses grep, sed and cut, I figured I can easily "translate" it to linux. And I did it, except for the fact that I'm a bit unsure how to use
route command to set my connection properly.
P.S. I also tried setting VPN using network manager, but the same question appears: how to add routes?
Thx in advance