Saturday, November 5, 2011

Cisco IOS Static PAT - Port Redirection Configuration Example

In this example we will do Cisco IOS Static PAT -  Port Redirection Configuration Example.

Here is the topology for this example:


We assume that R2 is a edge router between inside(R1) and outside(R3).

R2 will do NAT translation.

When R3 tries to connect loopback0 ip address of R2 with tcp 2323, R2 will redirect the connection to the R1`s loopback0 ip address with tcp port 23.

Here is the configuration of R2

interface loopback 0
ip address 10.10.10.2 255.255.255.255

interface f0/1
ip address 10.10.23.2 255.255.255.0
ip nat outside

interface f0/0
ip address 10.10.12.2 255.255.255.0
ip nat inside

ip nat inside source static tcp 10.10.10.1 23 10.10.10.2 2323

Lets test the connection from R3:

R3#telnet 10.10.10.2 2323
Trying 10.10.10.2, 2323 ... Open

User Access Verification
Password:
R1>en
Password:
R1#

R2#show ip nat trans
Pro Inside global      Inside local       Outside local      Outside global
tcp 10.10.10.2:2323    10.10.10.1:23      10.10.23.3:14193   10.10.23.3:14193
tcp 10.10.10.2:2323    10.10.10.1:23      ---                ---

Lets debug it from R2:

R2#debug ip nat
IP NAT debugging is on
R2#
*Mar  1 00:15:32.115: NAT*: TCP s=14193, d=2323->23
*Mar  1 00:15:32.119: NAT*: s=10.10.23.3, d=10.10.10.2->10.10.10.1 [38094]
*Mar  1 00:15:32.163: NAT*: TCP s=23->2323, d=14193
*Mar  1 00:15:32.167: NAT*: s=10.10.10.1->10.10.10.2, d=10.10.23.3 [9589]

No comments:

Post a Comment