Cisco Support Community
Community Member

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

- a router with 2 interfaces, one connected to the LAN with IP, 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


Community Member

Re: Modifying destination port with NAT/PAT

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

Community Member

Re: Modifying destination port with NAT/PAT

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?


Cisco Employee

Re: Modifying destination port with NAT/PAT

You can use ip nat outside static tcp/udp .

This should work, more info here:

CreatePlease to create content