Find the answer to your Linux question:
Results 1 to 2 of 2
Hey all, I have managed to set up my openvpn server 90%. If i disable iptables it connects properly but then i have no internet, but if i have it ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    45

    iptables fun for VPN


    Hey all,
    I have managed to set up my openvpn server 90%.
    If i disable iptables it connects properly but then i have no internet, but if i have it enabled, i cant connect to the vpn. I have the feeling it has somethign to do with these three lines from the tutorial i was following:

    Code:
    Issue the following commands to configure iptables to properly forward traffic through the VPN:
    iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
    
    iptables -A FORWARD -s 10.8.0.0/24 -j ACCEPT
    
    iptables -A FORWARD -j REJECT
    
    iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
    I take it the 10.8.0.0/24 is supposed to be my ip from the client in order to let me in? or perhaps it is supposed to be the ip of one of the two ethernet ports on the server. I know the server has a 50.*.*... eth0 ip that i ssh into it from and also has a 10.183.*.* eth1 port

    If someone could explain in 'plain english' what those lines do I would be grateful and perhaps i could just figure it out. I really need to get a book in iptables. I know that I need it on otherwise I can connect to the vpn but my packets dont get forwarded to the outsid internet.

    Stu

  2. #2
    Just Joined!
    Join Date
    Apr 2012
    Posts
    45
    turns out that openvpn creates clients with ip 10.8.0.x where x changes so that explains that.
    Just needed to have 'iptables -I INPUT -p tcp --dport 1194 -j ACCEPT' added to that tutorial.
    Unfortunately my traffic still isnt getting correctly forwarded though... i have correctly set ip net forwarding to 1 in the sysctl file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •