10-19-2010 03:36 AM - edited 03-04-2019 10:09 AM
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
10-19-2010 04:31 AM
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
10-19-2010 05:06 AM
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
10-19-2010 05:58 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide