cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1685
Views
0
Helpful
3
Replies

Modifying destination port with NAT/PAT

Hello everybody

I need help with a NAT/PAT configuration. The scenario is very simple:

- a local network with addressing 192.168.0.0/24

- a router with 2 interfaces, one connected to the LAN with IP 192.168.0.1, and other connected to Internet with a public fixed IP address

- a server on Internet with public and fixed IP address that answers only on port 3100

I only one PC on the local LAN to reach the Internet server on port 3100 but the problem is that the client can initiate only sessions against port 80. So I need the router to translate the internal IP address to its public IP address (normal NAT) but also to change the destination port, from 80 to 3100. Any idea of how to accomplish it?

Thank you in advance for your help

DAni

3 Replies 3

saimbt
Level 1
Level 1

TCP port redirection will happen with the following command,

ip nat inside source static tcp 80 3100

!--- Static NAT command that states any packet received in the inside interface with a source IP address of :80 will be translated to :3100

Hi Saimbt

I think I haven't explianed the situation correctly. You are right but only when talking about outside initiated connections. I'm talking about a session initiated from the local network to an outside server. The local network PC tries to reach the server on port TCP 80 whereas the outside server oly listens on port 3100. So I need the router to translate the destination port from 80 to 3100.

Before openning the question I have tried many things. The first one was the one you suggest but it didn't work. I have also tried ip nat outside, ipnat with route-map but I failed.

Any other idea?

DAni

You can use ip nat outside static tcp/udp .

This should work, more info here:

http://www.cisco.com/en/US/docs/ios/12_3/ipaddr/command/reference/ip1_i2g.html#wp1079462

Review Cisco Networking for a $25 gift card