Linux Netfilter discussions
 help / color / mirror / Atom feed
* Port forwarding question
@ 2007-04-30 17:37 David
  2007-05-02 12:00 ` Elvir Kuric
  0 siblings, 1 reply; 18+ messages in thread
From: David @ 2007-04-30 17:37 UTC (permalink / raw)
  To: netfilter

Hi all - first post, should be a simple question but google and the docs are not
helping

I want to forward port 10000 from internal hosts to the internet and it works with:

iptables -t nat -A PREROUTING -p tcp --dport 10000 -i ppp0 -j DNAT --to 192.168.0.2

for the host with ip 192.168.0.2, but how do I forward it for a range of hosts,
ie 192.168.0.2-192.168.0.254

I try

iptables -t nat -A PREROUTING -p tcp --dport 10000 -i ppp0 -j DNAT --to
192.168.0.2-192.168.0.254

but it does not work for any other hosts

iptables -L -v -t nat
gives the range, but does not actually forward the port in any apps
tcp dpt:10000 to:192.168.0.2-192.168.0.254

How do I forward the range of ports?
TIA,
David

==============================================
Running gentoo 2.16.18.4, iptables 1.3.5


^ permalink raw reply	[flat|nested] 18+ messages in thread
* Port Forwarding Question
@ 2009-05-06 18:25 Aaron Clausen
  2009-05-08 15:57 ` Michele Petrazzo - Unipex
  0 siblings, 1 reply; 18+ messages in thread
From: Aaron Clausen @ 2009-05-06 18:25 UTC (permalink / raw)
  To: netfilter

I'm in the process of replacing a crappy old 3Com router.  I did a
test run last night with the new Linux router last night, but there is
one issue that I can't quite get my head around.  On the old 3Com, a
user inside the internal NATed network, when he accesses a forwarded
port, can contact the internal device in question.  For instance, I
have a web server on the internal network with port 80 forwarded to
it.  With the 3Com router, I can, from another internal computer,
access that server via the external interface (ie, by going
http://publicaddress).  When I throw in my Linux router, it does not
do that, and user's have to use the internal IP or host name to access
the device.

Now, if need be, I'll just toss in Bind 9 views, so that internal
users get fed the internal IP, but is there a way to do this under
iptables (I'm assuming there is, as I'm fairly certain the old 3Com
router is running a version of iptables)?

-- 
Aaron Clausen
mightymartianca@gmail.com

^ permalink raw reply	[flat|nested] 18+ messages in thread
* port forwarding question
@ 2008-03-17 16:26 Phil Sutter
  2008-03-17 18:13 ` Jan Engelhardt
  0 siblings, 1 reply; 18+ messages in thread
From: Phil Sutter @ 2008-03-17 16:26 UTC (permalink / raw)
  To: netfilter

Hi,

We have been using commands like the following to forward a single port
on our Linux systems and it works fine:

iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 5080 -j DNAT --to
192.168.1.10:80

I am now trying to find a method for port forwarding a range of ports.
For instance, forwarding port 5080 - 5084 to ports 80 - 84 so that:
- port 5080 traffic ends up on port 80
- port 5081 traffic ends up on port 81
- port 5082 traffic ends up on port 82
- port 5083 traffic ends up on port 83
- port 5084 traffic ends up on port 84

I thought I could do the following but it does not work:

iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 5080:5085 -j DNAT
--to 192.168.1.10:80-85

Is there a way to do what I want to do with a single command or do I
have to forward each port with an individual command?

Thanks,

Phil Sutter



^ permalink raw reply	[flat|nested] 18+ messages in thread
* Port forwarding question
@ 2006-09-21 19:55 Dimitri Yioulos
  2006-09-21 20:23 ` Martijn Lievaart
  2006-09-21 20:25 ` Mr Ritter
  0 siblings, 2 replies; 18+ messages in thread
From: Dimitri Yioulos @ 2006-09-21 19:55 UTC (permalink / raw)
  To: netfilter

Hi, folks.

Noob, question:

I want to allow a vendor to access a piece of equipment on our LAN  
(192.168.100.46) through port 4000 from outside via a server in our 
DMZ (www.xxx.yyy.zzz).  While I should know how to do this, I'm not 
100% sure.  Can someone help?

Oh, and separately, how would I allow that access only through the 
vendor's ip address, if that were the way I decided to go?

Thanks.

Dimitri

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-05-18  7:03 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-30 17:37 Port forwarding question David
2007-05-02 12:00 ` Elvir Kuric
  -- strict thread matches above, loose matches on Subject: below --
2009-05-06 18:25 Port Forwarding Question Aaron Clausen
2009-05-08 15:57 ` Michele Petrazzo - Unipex
     [not found]   ` <8ec0428d0905171444q4e8a75dj6e60bfbab93bc75d@mail.gmail.com>
2009-05-17 21:54     ` Aaron Clausen
2009-05-18  7:03       ` Покотиленко Костик
2008-03-17 16:26 port forwarding question Phil Sutter
2008-03-17 18:13 ` Jan Engelhardt
2008-03-17 18:32   ` Cloves Pereira Costa Jr
2008-03-17 20:01     ` Andrew Schulman
2008-03-18 16:36       ` Jan Engelhardt
2006-09-21 19:55 Port " Dimitri Yioulos
2006-09-21 20:23 ` Martijn Lievaart
2006-09-21 20:25 ` Mr Ritter
2006-09-21 20:32   ` Mr. Ritter
2006-09-21 20:53   ` Dimitri Yioulos
2006-09-21 21:14     ` Martijn Lievaart
2006-09-21 21:23       ` Dimitri Yioulos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox