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
TCP port redirection will happen with the following command,
ip nat inside source static tcp
!--- Static NAT command that states any packet received in the inside interface with a source IP address of
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?
You can use ip nat outside static tcp/udp
This should work, more info here: