Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Sounds like you may not be resolving 'wiki.myvpn.com' to the internal IP address of that host. Have you tried seeing if you can bring up the page by using the IP address of the host, ahem, hosting that wiki? If so, you need to have your OpenVPN server pass DNS information using server.conf options like:

push "dhcp-option DNS 192.168.99.99"
push "dhcp-option DOMAIN myvpn.com"

If you don't have a DNS server on your internal network, you might be able to get around it by adding your internal hosts to /etc/hosts on the outside Ubuntu computer.

share|improve this answer
    
Yes, I can ping the IPs just fine, and the debug output shows those dhcp-options are being passed correctly. –  Cerin Dec 12 '10 at 0:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.