Skip to contentSkip to conversation

Destination Nat

DISCUSSION [email protected] 3 participants 6 messages May 28, 2004 – Jun 2, 2004

lore
Share & tools
lore
#0 lore raw

would it be 8080 or 80? the web server has a static ip address
on the inside 192.168.x.x

Quoted 7 lines

That will direct all 80 /tcp packets for all addresses the station listens on to 5.6.7.8:8080? Is that what you want or do you want to redirect packets with a specific destination address? If the public Internet address is not an IP address bound to the NAT gateway, then you will need to add it, typically: ip address add 1.1.1.2/24 dev eth0 brd +

john

#1 lore raw

If I understand you correctly and remember your original rule, then I think you have it backward. If you are changing the destination, you probably want to change it from the public address to the private address:

iptables -t nat -A PREROUTING -d 5.6.7.8 -p 6 --dport 8080 -j DNAT --to-destination 192.168.x.x:80

Remember to ensure that traffic to 192.168.x.x:80 is allowed on the FORWARD chain and that the NAT gateway responds to ARPs for 5.6.7.8 - John

Quoted 13 lines · On Fri, 2004-05-28 at 10:18, [email protected] wrote:

would it be 8080 or 80? the web server has a static ip address
on the inside 192.168.x.x

Quoted 7 lines

That will direct all 80 /tcp packets for all addresses the station listens on to 5.6.7.8:8080? Is that what you want or do you want to redirect packets with a specific destination address? If the public Internet address is not an IP address bound to the NAT gateway, then you will need to add it, typically: ip address add 1.1.1.2/24 dev eth0 brd +

john

Signature · 3 lines
Open Source Development Corporation
Financially Sustainable open source development
http://www.opensourcedevelopmentcorp.com
author
#2 lore raw

thanks, ill give it a try tomorrow when i get to work. what is the -p 6? ----- Original Message -----
From: John A. Sullivan III <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Friday, May 28, 2004 8:56 PM
Subject: Re: Destination Nat

Quoted 5 lines

If I understand you correctly and remember your original rule, then I think you have it backward. If you are changing the destination, you probably want to change it from the public address to the private address:

john

#3 lore raw

-p 6 is the same as -p tcp only a little faster as it does not have to look up tcp in the protocols file and translate it from tcp to 6. UDP would be -p 17, ICMP -p 1, ESP -p 50, etc.

Quoted 16 lines · John Black

thanks, ill give it a try tomorrow when i get to work. what is the -p 6? ----- Original Message -----
From: John A. Sullivan III <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Friday, May 28, 2004 8:56 PM
Subject: Re: Destination Nat

Quoted 5 lines

If I understand you correctly and remember your original rule, then I think you have it backward. If you are changing the destination, you probably want to change it from the public address to the private address:

john

Signature · 9 lines
John A. Sullivan III
Chief Technology Officer
Nexus Management
+1 207-985-7880
[email protected]
---
If you are interested in helping to develop a GPL enterprise class
VPN/Firewall/Security device management console, please visit
http://iscs.sourceforge.net 
author
#4 lore raw

okay,
thank you

Quoted 4 lines

-p 6 is the same as -p tcp only a little faster as it does not have to look up tcp in the protocols file and translate it from tcp to 6. UDP would be -p 17, ICMP -p 1, ESP -p 50, etc.

#5 lore raw
In reply to John A. Sullivan III
Quoted 3 lines · John A. Sullivan III

-p 6 is the same as -p tcp only a little faster as it does not have to look up tcp in the protocols file and translate it from tcp to 6. UDP would be -p 17, ICMP -p 1, ESP -p 50, etc.

That lookup would only be done when the rule was posted or loaded. Thus - the time saving is only on loading the rule.
I believe that the rule data is *all* stored in numeric form ... But I could be completely wrong on that front.

Alistair.

Quoted 16 lines · John Black
Quoted 14 lines

thanks, ill give it a try tomorrow when i get to work. what is the -p 6? ----- Original Message -----
From: John A. Sullivan III <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Friday, May 28, 2004 8:56 PM
Subject: Re: Destination Nat

Quoted 4 lines

If I understand you correctly and remember your original rule, then I think you have it backward. If you are changing the destination, you probably want to change it from the public address to the private address:

john