1

I have set up an openvpn server, generated a certificate and downloaded it to my client machine.

After importing the client.ovpn file in the network manager, I can still ssh into the server itself, but cannot access the internet.

In my sever's openvpn server.conf, I have:

 push "redirect-gateway def1 bypass-dhcp"
 push "dhcp-option DNS 208.67.222.222"
 push "dhcp-option DNS 208.67.220.220"

all uncommented.

In the global sysctl.conf file I also have:

net.ipv4.ip_forward=1

Is there anything I am missing configuration wise? What can I do to help debug the problem?

2 Answers 2

1

On your server, net.ipv4.ip_forward=1 isn't enough, it only enables the forwarding code. You still have to tell the kernel (via iptables) what it's allowed to forward, from who, and to where. You should read the Linux IP Masquerade HOWTO.

That's if you want to redirect all network traffic through your VPN connection (which is sometimes wanted for security reasons if you connect to an untrusted network, but generally not wanted because it can be quite slow). If you want to access the internet through the normal network while being connected to your VPN, be sure to check "Use this connection only for resources of this network" (it may not be the exact sentence, I'm translating from French) in the popup brought up after clicking on the "Routes..." button (at the bottom of the "IPv4 settings" tab of your VPN connection settings in Network Manager applet).

1

i use the following iptables-rules for forwarding traffic from my ovpn server

IPT=$(which iptables)
WWW="eth0"
${IPT} -A INPUT -i ${WWW} -p udp --dport 1194 -m state --state NEW -j ACCEPT
${IPT} -A INPUT -i tun0 -j ACCEPT
${IPT} -A FORWARD -i tun0 -o ${WWW} -j ACCEPT
${IPT} -A FORWARD -i ${WWW} -o tun0 -j ACCEPT

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.