LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-11-2012, 09:48 AM   #1
tuberb
LQ Newbie
 
Registered: Feb 2012
Location: Belmont, MA, US
Distribution: Centos
Posts: 4

Rep: Reputation: Disabled
iptables port forwarding issues


Here's the context: a router running DD-WRT that I am trying to configure to use an openvpn based proxy. The router already has port forwarding rules that direct ftp and other ports to specific local addresses on the network, and these worked ok before the proxy is installed.

The proxy configuration creates an openvpn tunnel, and the following is added to iptables to route traffic through it:

iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

Once that rule is in place, general traffic from the network goes through the proxy, but the port forwarding rules no longer work.

I am not really familiar with iptables, but it looks to me like the masquerade statement is causing the traffic on the forwarded ports to not make it to the previously defined destination. Is there a way to tweak this so the proxy works without breaking the port forwarding rules?

Thanks,

Barry
 
Old 02-11-2012, 05:07 PM   #2
tva
Member
 
Registered: Jul 2010
Location: Finland
Distribution: Open SUSE 13.1
Posts: 83

Rep: Reputation: 8
Check that port forwarding rules are before that masquerade rule with iptables -t nat -L POSTROUTING .If not, move masquerade to the end of list and try again.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables - port forwarding to blocked port? spangberg Linux - Networking 2 03-26-2010 04:48 AM
iptables - port forwarding through nat issues web_janitor Linux - Networking 2 01-23-2009 06:16 PM
IPTables Help - Forwarding from one port to another cedricd Linux - Networking 2 01-05-2009 11:07 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
IPTables port forwarding.. NeoTech Linux - Networking 2 01-03-2005 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration