HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Server Operation (
-   -   openvpn I cant ping or get connection to the internet through vpn (

Deficit 10th November 2009 05:10

openvpn I cant ping or get connection to the internet through vpn
Edit: This is now fixed. I had to change the DNS from my ISP's to the VPN provider's to make it work.

I have installed debian lenny and ispconfig 3 using the perfect setup. Now I've got a vpn account but I have some issues making it work on Linux.

However, I did make it work using openvpn for Windows XP with GUI (exact same configuration settings). Then I was able to surf around with the IP of the vpn server.

So, this is what I've done.

Downloaded and installed openvpn using apt-get install openvpn

Made a /etc/openvpn/openvpn.conf file with the following contents:

dev tap
remote 88.80.xx.xx
float 88.80.xx.xx
dhcp-option DNS 88.80.xx.xx
port 5122
ifconfig 88.80.xx.xx
route-gateway 88.80.xx.xx
redirect-gateway def1
secret key.txt
cipher AES-128-CBC

My box is behind a router, so I've forwarded port 5122 (both UDP/TCP) to the internal IP of the machine running openvpn.

Furthermore I've included the key in key.txt and restarted openvpn using /etc/init.d/openvpn restart

When I try to ping, there is about 1 minute wait and I get

ping: unknown host
When I run route, there is a 2-3 minute wait until all results are displayed and I get

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
88.80.xx.xx UGH  0      0        0 eth0
88.80.xx.xx      *     U    0      0        0 tap0    *      U    0      0        0 eth0
default        88.80.xx.xx      UG    0      0        0 tap0      88.80.xx.xx      UG    0      0        0 tap0
default        UG    0      0        0 eth0

If I try to run nslookup there is a long halt, and then

;; connection timed out; no servers could be reached
I can ping internal IPs, and I'm connected to the box from behind the router using SSH.

This is what my /etc/network/interfaces looks like

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
#iface eth0 inet dhcp

# The primary network interface
auto eth0
iface eth0 inet static

Ben 11th November 2009 11:04

So what basically happens is in your case all VPN traffic (no matter of the target) is sent to your openvpn server. But as your tunnel IPs are not routed as they are private, your vpn server needs to NAT these stuff. And this you need to set up.

Maybe this points you a bit more in the right direction:

All times are GMT +2. The time now is 18:53.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.