Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I've configured openvpn to another server and I can now successfully start the process on ubuntu and it says I am connected. However, if I try to SSH to other servers or access privileged websites (only within the VPN), I don't have any luck. Is there usually any further I need to do to get traffic tunnelled through the openvpn service when it is running?

share|improve this question

1 Answer 1

Let us see your log-files, please.

Have you enabled IP forwarding? Masquerade in iptables of server? If not, I think, you should look this manual, as I did- https://wiki.debian.org/OpenVPN#Forward_traffic_via_VPN

I pushed my traffic by these commands:

  1. Edit in /etc/sysctl.conf - net.ipv4.ip_forward = 1
  2. IPtables rules:

    iptables -A FORWARD -i eth0 -o tun0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A FORWARD -s 10.10.5.0/24 -o eth0 -j ACCEPT
    iptables -t nat -A POSTROUTING -s 10.10.5.0/24 -o eth0 -j MASQUERADE
    

Where 10.10.5.0/24 is your internal network, which you defined in server.conf on this line

server 10.10.5.0 255.255.255.0

Also, add this to your server.conf file

# If you want push all your client's traffic through VPN
push "redirect-gateway" def1 bypass-dhcp"

#Or limit by ip-addres of destination
push "route 74.125.224.72 255.255.255.255"
share|improve this answer

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.