All of lore.kernel.org
 help / color / mirror / Atom feed
* port translation
@ 2004-01-11 10:21 Romain Moyne
  2004-01-11 10:46 ` [despammed] " Andreas Kretschmer
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Romain Moyne @ 2004-01-11 10:21 UTC (permalink / raw)
  To: netfilter

Hello,

I'm French and my english is bad ;)

I have a http server (debian 3.0) behind a router (debian 3.0). I have a 
problem when I want to log the visitor's IP of my website with PHP or 
Perl or all language. I have always the IP of my router ! Somebody tell 
me that I must do port translation but I have searched and I haven't 
fand anything.
Can you help me ?
This is the rules of my router :

iptables -t nat -A PREROUTING -d MyIP -p tcp --dport 80 -j DNAT 
--to-destination 192.168.0.3:80

Romain




^ permalink raw reply	[flat|nested] 16+ messages in thread
* port translation
@ 2005-01-05  8:23 Richard
  2005-01-05 13:23 ` John A. Sullivan III
  2005-01-06 13:34 ` Eric Ellis
  0 siblings, 2 replies; 16+ messages in thread
From: Richard @ 2005-01-05  8:23 UTC (permalink / raw)
  To: netfilter

Hi,

I am trying to work on port translation. One inside host with source port
xxx would always have the same port yyy after nat. Even after the conntrack
expires, I still want outside incoming packet to port yyy be able to map to
the same host and port. This is what I did,

Assume inside 192.168.25.150:5000 maps to outside 66.1.2.3:60150 on
interface vlan1,

# allow outside traffic to come in
iptables -t nat -I PREROUTING -p udp -i vlan1 -d 66.1.2.3 --dport 60150 -j
DNAT --to-destination 192.168.25.150:5000

# allow outside traffic to go through the router
iptables -t filter -I FORWARD -p udp -i vlan1 --dport 5060 -j ACCEPT

# allow inside traffic to go out
iptables -t nat -I POSTROUTING -p udp -s 192.168.25.150 --sport 5000 -j SNAT
-o vlan1 --to-source 66.1.2.3:60150

Can someone please confirm that this is the right way to do it?

Also if I have multiple internal hosts, for example, one hundred host
192.168.25.1xy:5000 maps to 66.1.2.3:601xy, is there a quick way to do it
instead of 100 blocks of iptables statements?

Thanks,
Richard





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

end of thread, other threads:[~2005-01-06 13:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-11 10:21 port translation Romain Moyne
2004-01-11 10:46 ` [despammed] " Andreas Kretschmer
2004-01-11 11:03   ` Romain Moyne
2004-01-11 11:28     ` Andreas Kretschmer
2004-01-11 11:37 ` Antony Stone
2004-01-11 12:43 ` Cedric Blancher
2004-01-11 12:53   ` Romain Moyne
2004-01-11 13:03     ` Antony Stone
2004-01-11 13:32     ` Cedric Blancher
2004-01-11 13:45       ` Romain Moyne
2004-01-11 13:55         ` Antony Stone
2004-01-11 14:03           ` Romain Moyne
2004-01-16 22:32 ` Bill Davidsen
  -- strict thread matches above, loose matches on Subject: below --
2005-01-05  8:23 Richard
2005-01-05 13:23 ` John A. Sullivan III
2005-01-06 13:34 ` Eric Ellis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.