cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1847
Views
0
Helpful
2
Replies

IOS XE how to do port forwarding on routed /32 address

Jamesits
Level 1
Level 1

Snipaste_2019-08-04_12-42-39.png

the ISP routes a single IP to our gateway router. So our gateway router is set up this way:

 

int Gi1
  ip address 10.0.0.2 255.255.255.0
int Gi2
  ip address 192.168.1.1 255.255.255.0
int Lo0
  ip address 1.2.3.4 255.255.255.255
ip route 0.0.0.0 0.0.0.0 10.0.0.1

Now I need to forward port 1.2.3.4:80 -> 192.168.1.2:80, how do I achieve this?

 

Already tried and doesn't work:

1. ip nat source static tcp 1.2.3.4 80 192.168.1.2 80

2. ip nat pool + ip access-list + ip nat source 

1 Accepted Solution

Accepted Solutions

Hello,

 

I tested the config below in GNS3 (change the static NAT entries to tcp port 80):

 

interface Loopback0
ip address 1.2.3.4 255.255.255.255
ip nat inside
!
interface GigabitEthernet1
ip address 10.0.0.2 255.255.255.0
ip nat outside
!
interface GigabitEthernet2
ip address 192.168.1.1 255.255.255.0
ip nat inside
!
ip nat inside source static 192.168.1.2 interface Loopback0
ip nat outside source static 10.0.0.2 1.2.3.4
ip route 0.0.0.0 0.0.0.0 10.0.0.1

 

and got the debug output below:

 

R1#debug ip nat
IP NAT debugging is on
R1#
*Aug 4 08:38:45.181: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [50]
R1#
*Aug 4 08:38:47.166: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [51]
R1#
*Aug 4 08:38:48.167: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [50]
*Aug 4 08:38:48.167: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [51]
*Aug 4 08:38:48.170: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [52]
*Aug 4 08:38:48.170: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [52]
*Aug 4 08:38:48.174: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [53]
*Aug 4 08:38:48.174: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [53]
*Aug 4 08:38:48.179: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [54]
*Aug 4 08:38:48.179: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [54]

View solution in original post

2 Replies 2

Hello,

 

I tested the config below in GNS3 (change the static NAT entries to tcp port 80):

 

interface Loopback0
ip address 1.2.3.4 255.255.255.255
ip nat inside
!
interface GigabitEthernet1
ip address 10.0.0.2 255.255.255.0
ip nat outside
!
interface GigabitEthernet2
ip address 192.168.1.1 255.255.255.0
ip nat inside
!
ip nat inside source static 192.168.1.2 interface Loopback0
ip nat outside source static 10.0.0.2 1.2.3.4
ip route 0.0.0.0 0.0.0.0 10.0.0.1

 

and got the debug output below:

 

R1#debug ip nat
IP NAT debugging is on
R1#
*Aug 4 08:38:45.181: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [50]
R1#
*Aug 4 08:38:47.166: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [51]
R1#
*Aug 4 08:38:48.167: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [50]
*Aug 4 08:38:48.167: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [51]
*Aug 4 08:38:48.170: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [52]
*Aug 4 08:38:48.170: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [52]
*Aug 4 08:38:48.174: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [53]
*Aug 4 08:38:48.174: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [53]
*Aug 4 08:38:48.179: NAT*: s=10.0.0.1, d=1.2.3.4->192.168.1.2 [54]
*Aug 4 08:38:48.179: NAT*: s=192.168.1.2->1.2.3.4, d=10.0.0.1 [54]

Much thanks! This is working on my setup.

My final config is:
ip nat inside source static tcp 192.168.1.2 80 interface Lo0 80
ip nat outside source static tcp 10.0.0.2 80 1.2.3.4 80
Review Cisco Networking for a $25 gift card