Results 1 to 3 of 3

Thread: OpenVPN iptables + redirects to other host

  1. #1
    Join Date
    Jan 2012
    Beans
    10

    OpenVPN iptables + redirects to other host

    Hello,

    I have finally managed to install OpenVPN on my server and works good.
    But the only problem is that when I run the iptables for OpenVPN it breaks my other rules that are forwarding incoming traffic on port 443 and port 444 to another host.

    Anyone who can help me combining them so they'll work together?

    These are my iptable rules for the OpenVPN
    Code:
    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 -o venet0 -j SNAT --to-source 199.180.129.110
    
    echo 1 > /proc/sys/net/ipv4/ip_forward
    And these are my iptable rules to forward the traffic to my other server
    Code:
    iptables -t nat -A POSTROUTING -d 173.0.57.230 \
    -p tcp --dport 443 -j SNAT --to 199.180.129.110
    
    iptables -t nat -A PREROUTING -d 199.180.129.110 \
    -p tcp --dport 443 -j DNAT --to 173.0.57.230
    
    
    iptables -t nat -A POSTROUTING -d 173.0.57.230 \
    -p tcp --dport 444 -j SNAT --to 199.180.129.110
    
    iptables -t nat -A PREROUTING -d 199.180.129.110 \
    -p tcp --dport 444 -j DNAT --to 173.0.57.230
    
    
    echo 1 > /proc/sys/net/ipv4/ip_forward
    Thanks in advance,
    WouterDS

  2. #2
    Join Date
    Jan 2012
    Beans
    10

    Re: OpenVPN iptables + redirects to other host

    Anyone who can help?

  3. #3
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    12,985
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: OpenVPN iptables + redirects to other host

    What happens if you disable

    Code:
    iptables -A FORWARD -j REJECT

Tags for this Thread

Bookmarks

Posting Permissions

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