Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

OpenVPN & IP Tables issue

  • 01-08-2013 8:31am
    #1
    Registered Users, Registered Users 2 Posts: 11,264 ✭✭✭✭


    Hi,

    I recently installed openVPN on a server and the rules in my IP Tables are no longer working correctly and I can't figure it out, not really understanding the FORWARD directive. The bolded parts are what I added for openVPN. OpenVPN is working fine, but every machine now has access to ports 22, 3551, 9091 & 9092, both over VPN and the local network. This was not the case before I added the bolded parts.
    [B]*nat
    :PREROUTING ACCEPT [0:0]
    :POSTROUTING ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
    COMMIT[/B]
    *filter
    :INPUT DROP [0:0]
    :FORWARD DROP [0:0]
    :OUTPUT ACCEPT [0:0]
    -A INPUT -i lo -j ACCEPT
    -A INPUT -i eth0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
    -A INPUT -i eth0 -p tcp -s 192.168.0.2 -m conntrack --ctstate NEW -m tcp -m multiport --dports 3551,9091,9092 -j ACCEPT
    -A INPUT -i eth0 -p tcp -s 192.168.0.5 -m conntrack --ctstate NEW -m tcp -m multiport --dports 22,9091,9092 -j ACCEPT
    -A INPUT -i eth0 -p tcp -s 192.168.0.19 -m conntrack --ctstate NEW -m tcp -m multiport --dports 22,9091,9092 -j ACCEPT
    -A INPUT -j REJECT --reject-with icmp-port-unreachable
    [B]-A FORWARD -i eth0 -o tun0 -m conntrack --csstate RELATED,ESTABLISHED -j ACCEPT
    -A FORWARD -i tun0 -o eth0 -s 10.8.0.0/24 -j ACCEPT[/B]
    COMMIT
    

    The problem seems to be with this line:
    -A FORWARD -i eth0 -o tun0 -m conntrack --csstate RELATED,ESTABLISHED -j ACCEPT
    

    When left out the rules work ok locally but then openVPN is not accessible. What is happening here that this allows all NEW connections to these ports from any IP address.


Comments

  • Registered Users, Registered Users 2 Posts: 11,264 ✭✭✭✭jester77


    opps, nevermind... was a silly typo :o
    -A FORWARD -i eth0 -o tun0 -m conntrack --c[B]t[/B]state RELATED,ESTABLISHED -j ACCEPT
    


Advertisement