0

I have a problem trying to connect to openvpn on ubuntu 15.10(32 bits). I have 15.04 64 bits and to install open vpn all I have to do is run the command "sudo apt-get install openvpn network-manager-openvpn-gnome" and sellect the openvpn config file and it works fine.

The problem now is that it connects fine and but when it connects, I can't access the internet from firefox. The page request timesout. But when i connect directly it works fine. Here is my system Log.

    Dec  4 07:11:19 user-pc nm-openvpn[3039]: TUN/TAP device tun0 opened
Dec  4 07:11:19 user-pc nm-openvpn[3039]: /usr/lib/NetworkManager/nm-openvpn-service-openvpn-helper --tun -- tun0 1500 1559 10.101.0.6 10.101.0.5 init
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): new Tun device (carrier: OFF, driver: 'tun', ifindex: 9)
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  devices added (path: /sys/devices/virtual/net/tun0, iface: tun0)
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  device added (path: /sys/devices/virtual/net/tun0, iface: tun0): no ifupdown configuration found.
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  VPN connection '11->xxxVPN.com TCP-443' (IP Config Get) reply received.
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  VPN connection '11->xxxVPN.com TCP-443' (IP4 Config Get) reply received.
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  VPN Gateway: 189.102.037.102
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  Tunnel Device: tun0
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  IPv4 configuration:
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Internal Gateway: 10.101.0.5
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Internal Address: 10.101.0.6
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Internal Prefix: 32
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Internal Point-to-Point Address: 10.101.0.5
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Maximum Segment Size (MSS): 0
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Static Route: 10.101.0.0/16   Next Hop: 10.101.0.5
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Static Route: 10.101.0.1/32   Next Hop: 10.101.0.5
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Forbid Default Route: no
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    Internal DNS: 10.101.0.1
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>    DNS Domain: '(none)'
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  No IPv6 configuration
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  VPN plugin state changed: started (4)
Dec  4 07:11:19 user-pc nm-openvpn[3039]: Initialization Sequence Completed
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  VPN connection '11->xxxVPN.com TCP-443' (IP Config Get) complete.
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): link connected
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  NetworkManager state is now CONNECTED_LOCAL
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  NetworkManager state is now CONNECTED_GLOBAL
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  Writing DNS information to /sbin/resolvconf
Dec  4 07:11:19 user-pc dnsmasq[2010]: setting upstream servers from DBus
Dec  4 07:11:19 user-pc dnsmasq[2010]: using nameserver 10.101.0.1#53
Dec  4 07:11:19 user-pc dbus[791]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  keyfile: add connection in-memory (10173ed3-3e98-4fe0-9742-a8f2a9980adc,"tun0")
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: unmanaged -> unavailable (reason 'connection-assumed') [10 20 41]
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: unavailable -> disconnected (reason 'connection-assumed') [20 30 41]
Dec  4 07:11:19 user-pc systemd[1]: Starting Network Manager Script Dispatcher Service...
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  Device 'tun0' has no connection; scheduling activate_check in 0 seconds.
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): Activation: starting connection 'tun0' (10173ed3-3e98-4fe0-9742-a8f2a9980adc)
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: prepare -> config (reason 'none') [40 50 0]
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: config -> ip-config (reason 'none') [50 70 0]
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: ip-config -> ip-check (reason 'none') [70 80 0]
Dec  4 07:11:19 user-pc dbus[791]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Dec  4 07:11:19 user-pc systemd[1]: Started Network Manager Script Dispatcher Service.
Dec  4 07:11:19 user-pc nm-dispatcher: Dispatching action 'vpn-up' for tun0
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: ip-check -> secondaries (reason 'none') [80 90 0]
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  (tun0): device state change: secondaries -> activated (reason 'none') [90 100 0]
Dec  4 07:11:19 user-pc gnome-session[1409]: ** (nm-connection-editor:3002): WARNING **: Unsupported connection type 'generic'
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  NetworkManager state is now CONNECTED_LOCAL
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  NetworkManager state is now CONNECTED_GLOBAL
Dec  4 07:11:19 user-pc NetworkManager[821]: <info>  Policy set 'tun0' (tun0) as default for IPv4 routing and DNS.

This are my iptables rules:

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         


Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         


Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         

As you can see it is empty is this normal and if it is empty should it stop the vpn from working?

  • When connected to VPN, can you ping an IP outside? For example, 8.8.8.8? – Tung Tran Dec 4 '15 at 9:03
  • It is not connecting again I don't know why but I will try to check it and put up a log – doeboyfresh Dec 4 '15 at 9:52
  • I added the new log – doeboyfresh Dec 4 '15 at 10:03
  • I can connect now but I cant ping to an outside ip when I ping 8.8.8.8 without the vpn it works fine but when I ping it with the VPn it just shows "PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data". It stops there with no response – doeboyfresh Dec 4 '15 at 10:40
0

The last line of your log file is this:

Dec 4 07:11:19 user-pc NetworkManager[821]: <info> Policy set 'tun0' (tun0) as default for IPv4 routing and DNS

What this means is that your tun0, or VPN, interface is being used as the default route for your Internet connections. If the OpenVPN server isn't configured to allow your VPN network to access the Internet, then your connections will timeout like how they're doing now.

On your Ubuntu 15.10 32-bit (OpenVPN server), you will have to run the following iptables command (or one similar) in order to allow Internet access for your VPN subnet.

# iptables -t nat -A POSTROUTING -s $your_vpn_network -o $wan_interface -j MASQUERADE

What this rule does is NAT any connection coming from your VPN network that is destined for a network out of the WAN interface, which should resolve your issue.

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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