I'm trying to connect to a VPN through OpenVPN on Ubuntu 10.04.
I first tried the network-manager-openvpn package, but unfortunately, Network Manager seems to have a few bugs that prevent me from connecting out of the box. However, I found a post that explained a work-around by using the openvpn command line:
sudo /usr/sbin/openvpn --remote 123.456.678.901 --comp-lzo --nobind --dev tun --proto udp --port 1194 --auth-nocache --syslog nm-openvpn --script-security 2 --up /usr/lib/network-manager-openvpn/nm-openvpn-service-openvpn-helper --up-restart --persist-key --persist-tun --route-noexec --client --ca ca.crt --cert myuser.crt --key myuser.key
My logs seem to show the command runs without error:
Nov 28 23:27:22 localhost NetworkManager: <debug> [1291004842.002903] periodic_update(): Roamed from BSSID 01:28:31:A4:B5:A9 (Local Network) to (none) ((none))
Nov 28 23:27:28 localhost NetworkManager: <debug> [1291004848.002931] periodic_update(): Roamed from BSSID (none) ((none)) to 01:28:31:A4:B5:A9 (Local Network)
Nov 28 23:27:33 localhost NetworkManager: SCPlugin-Ifupdown: devices removed (path: /sys/devices/virtual/net/tun0, iface: tun0)
Nov 28 23:27:41 localhost nm-openvpn[18917]: OpenVPN 2.1.0 x86_64-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [MH] [PF_INET6] [eurephia] built on Jul 20 2010
Nov 28 23:27:41 localhost nm-openvpn[18917]: WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Nov 28 23:27:41 localhost nm-openvpn[18917]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
Nov 28 23:27:48 localhost nm-openvpn[18917]: /usr/bin/openssl-vulnkey -q -b 1024 -m <modulus omitted>
Nov 28 23:27:49 localhost nm-openvpn[18917]: LZO compression initialized
Nov 28 23:27:49 localhost nm-openvpn[18917]: UDPv4 link local: [undef]
Nov 28 23:27:49 localhost nm-openvpn[18917]: UDPv4 link remote: [AF_INET]123.456.678.901:1194
Nov 28 23:27:50 localhost nm-openvpn[18917]: [server] Peer Connection Initiated with [AF_INET]123.456.678.901:1194
Nov 28 23:27:52 localhost nm-openvpn[18917]: TUN/TAP device tun0 opened
Nov 28 23:27:52 localhost NetworkManager: SCPlugin-Ifupdown: devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
Nov 28 23:27:52 localhost NetworkManager: SCPlugin-Ifupdown: device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
Nov 28 23:27:52 localhost nm-openvpn[18917]: /sbin/ifconfig tun0 10.8.0.28 pointopoint 10.8.0.27 mtu 1500
Nov 28 23:27:52 localhost nm-openvpn[18917]: /usr/lib/network-manager-openvpn/nm-openvpn-service-openvpn-helper tun0 1500 1542 10.8.0.28 10.8.0.27 init
Nov 28 23:27:52 localhost nm-openvpn[18917]: Initialization Sequence Completed
However, when I try and bring up a URL inside the VPN (e.g. wiki.myvpn.com), I get a "Server not found" error.
Is my command actually failing, or is there an additional command I have to do to make the VPN-specific URLs accessible to me?
EDIT: The issue seems to be Network Manager isn't updating /etc/resolv.conf correctly. There are a few related bugs reported, and even though they were allegedly fixed years ago, the problem apparently still exists. I found that if I add the following lines to the TOP (not the bottom or it won't work) of my /etc/resolv.conf, then openvpn actually works:
domain mydomain.com
search mydomain.com
nameserver 10.123.10.128
Any idea how I can get Network Manager to correctly update resolv.conf?