Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 7th March 2012, 21:51
WouterDS WouterDS is offline
Junior Member
Join Date: Jan 2012
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
Default OpenVPN iptables + redirects to other host


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
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s -j ACCEPT   
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -o venet0 -j SNAT --to-source

echo 1 > /proc/sys/net/ipv4/ip_forward
And these are my iptable rules to forward the traffic to my other server
iptables -t nat -A POSTROUTING -d \
-p tcp --dport 443 -j SNAT --to

iptables -t nat -A PREROUTING -d \
-p tcp --dport 443 -j DNAT --to

iptables -t nat -A POSTROUTING -d \
-p tcp --dport 444 -j SNAT --to

iptables -t nat -A PREROUTING -d \
-p tcp --dport 444 -j DNAT --to

echo 1 > /proc/sys/net/ipv4/ip_forward
Thanks in advance,
Reply With Quote
Sponsored Links


forwarding, iptables, openvpn, traffic, vpn

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Port foreword + openVPN + iptables ? flan Server Operation 0 16th May 2011 00:31
Postfix queue problem? murunix Server Operation 7 2nd May 2011 02:55
smtp is error!!! fhawk Installation/Configuration 2 7th April 2009 14:17
IPtables rule to let PPTP access LAN brianwebb01 Installation/Configuration 0 1st May 2008 22:23
configuring IPTABLES firewall adityavpratap HOWTO-Related Questions 9 27th May 2006 22:42

All times are GMT +2. The time now is 03:48.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.