03-29-2009 05:52 AM - edited 03-04-2019 04:08 AM
Hi
In my lab I tested PAT like this:
pc connects to R1's ethernet0 interface and R1's serial 0 connects to R2's serial 2 interface.
The IPs are as follows:
pc -> 10.10.10.2
R1 e0 --> 10.10.10.1
R1 s0 --> 20.20.20.1
R2 s2 --> 20.20.20.1
R2 e0 --> 30.30.30.1
When I ping from the PC to 30.30.30.1 and give the nat translation command I get the following output:
inside local 10.10.10.2:6853
10.10.10.2:6854
10.10.10.2:6855
10.10.10.2:6856
inside global 20.20.20.1:6853
20.20.20.1:6854
20.20.20.1:6855
20.20.20.1:6856
outside global 30.30.30.1:6853
30.30.30.1:6854
30.30.30.1:6855
30.30.30.1:6856
The following is a show run of R1:
R1#show run
hostname R1
interface ethernet0
ip address 10.10.10.1 255.255.255.0
ip nat inside
interface serial 0
ip address 20.20.20.1 255.255.255.0
ip nat outside
access-list 25 permit 10.10.10.0 0.0.0.255
ip nat inside source list 25 interface serial 0 overload
end
R1#
But I don't see the port address getting translated. What is the reason?
Thanks in advance!
Solved! Go to Solution.
03-30-2009 05:22 AM
03-29-2009 08:59 AM
What are you expecting to see?
There is one host on the network. The router's NAT process receives the packet and NATs it according to the rules you've set.
No ports are going to be translated as such because there's only one host on the network. There's no port contention.
03-29-2009 12:07 PM
Omal,
That worked as expected. (grin)
You're doing PAT. It means that the router will translate the source port before sending the packet out of the outside interface.
Because the source uses the random port. that's 6584. When the router received that packet. It will look at the table. Did I already use this port? Well, No! So I can use this port for PAT. That's why you saw the same port when using a "sh ip nat trans" command.
HTH,
Toshi
03-30-2009 03:23 AM
Hi Thoshi
You mean to say that if the router has already used that port only it will translate the source port (the port number that comes from the PC) in to a different port number, is it?
Thanks in advance!
03-30-2009 05:22 AM
Omal,
You got it.
Toshi
03-30-2009 09:06 AM
Thanks a lot Thoshi!
Take care.
03-30-2009 07:50 AM
"You mean to say that if the router has already used that port only it will translate the source port (the port number that comes from the PC) in to a different port number, is it?"
Yes, thats what I was talking about when I mentioned port contention between two flows.
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