cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
826
Views
15
Helpful
7
Replies

ICMP not working after configuring static NAT

Hi All,

 

I have a small setup below. I want to hide all traffic from Host A so i configured static NAT on my corp router.  After configuring static NAT i couldn't ping the remote router IP. 

If i remove NAT ping works fine. 

 

Host A ( 192.168.1.10) ---> Corp_RTR <------------>  Remote_RTR --> Host B ( 10.40.1.1)

 

Corp_RTR#

interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0
ip nat inside

!

interface GigabitEthernet0/0/2
ip address 10.59.1.1 255.255.255.252
ip nat outside

!

ip nat inside source static 192.168.1.10 10.59.1.1

 

Remote_RTR#

interface GigabitEthernet0/0/2
ip address 10.59.1.2 255.255.255.252

 

 

Thanks

Ali

7 Replies 7

Tyson Joachims
Rising star
Rising star

I just recreated your topology in Packet Tracer and was able to ping even after applying NAT. Could you please post the running-config of both routers?

Hi Tyson Joachims,

 

Below find the Corp rtr config.  Remote rtr is not under my management.

Another information i want to share is the host A can able to communicate with Host B sucessfully with NAT. only issue is from router i can't ping the remote rtr and host B.

 

 

Corp_RTR#show run
Building configuration...
!
Current configuration : 11810 bytes
!
!
version 16.12
no service pad
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
no service dhcp
! Call-home is enabled by Smart-Licensing.
service call-home
platform qfp utilization monitor load 80
no platform punt-keepalive disable-kernel-core
!
hostname Corp_RTR
!
boot-start-marker
boot system flash bootflash:isr4400-universalk9.16.12.04.SPA.bin
boot-end-marker
!
!
vrf definition MGMT-VRF
!
address-family ipv4
exit-address-family
!
vrf definition Mgmt-intf
!
address-family ipv4
exit-address-family
!
address-family ipv6
exit-address-family
!
logging buffered 128000 informational
no logging console
no logging monitor
!
!
!
!
!
aaa session-id common
call-home
! If contact email address in call-home is configured as sch-smart-licensing@cisco.com
! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications.
contact-email-addr sch-smart-licensing@cisco.com
profile "CiscoTAC-1"
active
destination transport-method http
no destination transport-method email
no ip source-route
!
no ip domain lookup
ip dhcp bootp ignore
!
!
!
login on-success log
!
!
!
!
!
!
!
subscriber templating
!
!
!
!
!
multilink bundle-name authenticated
!
!
!
crypto pki trustpoint SLA-TrustPoint
enrollment pkcs12
revocation-check crl
!
!
crypto pki certificate chain SLA-TrustPoint
certificate ca 01
30820321 30820209 A0030201 02020101 300D0609 2A864886 F70D0101 0B050030
32310E30 0C060355 040A1305 43697363 6F312030 1E060355 04031317 43697363
6F204C69 63656E73 696E6720 526F6F74 20434130 1E170D31 33303533 30313934
3834375A 170D3338 30353330 31393438 34375A30 32310E30 0C060355 040A1305
43697363 6F312030 1E060355 04031317 43697363 6F204C69 63656E73 696E6720
526F6F74 20434130 82012230 0D06092A 864886F7 0D010101 05000382 010F0030
82010A02 82010100 A6BCBD96 131E05F7 145EA72C 2CD686E6 17222EA1 F1EFF64D
CBB4C798 212AA147 C655D8D7 9471380D 8711441E 1AAF071A 9CAE6388 8A38E520
1C394D78 462EF239 C659F715 B98C0A59 5BBB5CBD 0CFEBEA3 700A8BF7 D8F256EE
4AA4E80D DB6FD1C9 60B1FD18 FFC69C96 6FA68957 A2617DE7 104FDC5F EA2956AC
7390A3EB 2B5436AD C847A2C5 DAB553EB 69A9A535 58E9F3E3 C0BD23CF 58BD7188
68E69491 20F320E7 948E71D7 AE3BCC84 F10684C7 4BC8E00F 539BA42B 42C68BB7
C7479096 B4CB2D62 EA2F505D C7B062A4 6811D95B E8250FC4 5D5D5FB8 8F27D191
C55F0D76 61F9A4CD 3D992327 A8BB03BD 4E6D7069 7CBADF8B DF5F4368 95135E44
DFC7C6CF 04DD7FD1 02030100 01A34230 40300E06 03551D0F 0101FF04 04030201
06300F06 03551D13 0101FF04 05300301 01FF301D 0603551D 0E041604 1449DC85
4B3D31E5 1B3E6A17 606AF333 3D3B4C73 E8300D06 092A8648 86F70D01 010B0500
03820101 00507F24 D3932A66 86025D9F E838AE5C 6D4DF6B0 49631C78 240DA905
604EDCDE FF4FED2B 77FC460E CD636FDB DD44681E 3A5673AB 9093D3B1 6C9E3D8B
D98987BF E40CBD9E 1AECA0C2 2189BB5C 8FA85686 CD98B646 5575B146 8DFC66A8
467A3DF4 4D565700 6ADF0F0D CF835015 3C04FF7C 21E878AC 11BA9CD2 55A9232C
7CA7B7E6 C1AF74F6 152E99B7 B1FCF9BB E973DE7F 5BDDEB86 C71E3B49 1765308B
5FB0DA06 B92AFE7F 494E8A9E 07B85737 F3A58BE1 1A48A229 C37C1E69 39F08678
80DDCD16 D6BACECA EEBC7CF9 8428787B 35202CDC 60E4616A B623CDBD 230E3AFB
418616A9 4093E049 4D10AB75 27E86F73 932E35B5 8862FDAE 0275156F 719BB2F0
D697DF7F 28
quit
!
!
no license feature hseck9
!
archive
log config
logging enable
logging size 500
notify syslog contenttype plaintext
hidekeys
memory free low-watermark processor 67089
!
diagnostic bootup level minimal
!
spanning-tree extend system-id
!
!
redundancy
mode none
!
!
!
!
!
no cdp run
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0/0
vrf forwarding MGMT-VRF
ip address 10.10.205.8 255.255.255.128
no ip redirects
no ip unreachables
no ip proxy-arp
negotiation auto
no cdp enable
!
interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
negotiation auto
no cdp enable
!
interface GigabitEthernet0/0/2
ip address 10.59.1.1 255.255.255.252
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat outside
negotiation auto
no cdp enable
!
interface GigabitEthernet0/0/3
no ip address
no ip redirects
no ip unreachables
no ip proxy-arp
shutdown
negotiation auto
no cdp enable
!
interface GigabitEthernet0
vrf forwarding Mgmt-intf
no ip address
shutdown
negotiation auto
!
ip forward-protocol nd
no ip http server
ip http authentication local
no ip http secure-server
ip nat inside source static 192.168.1.10 10.59.1.1
ip route 10.40.1.1 255.255.255.255 10.59.1.2
ip route vrf MGMT-VRF 0.0.0.0 0.0.0.0 10.10.205.1
ip ssh time-out 60
ip ssh authentication-retries 4
ip ssh version 2
!
!
!
!
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 15 0
privilege level 15
transport preferred ssh
transport output none
stopbits 1
line aux 0
exec-timeout 15 0
transport output none
stopbits 1
line vty 0 15
exec-timeout 15 0
privilege level 15
transport input ssh
transport output none
!
!
!
!
!
end

Hello

The only default route you seem to have is in an VRF-MGT it looks like you dont have one for the global route table so try adding a defaut static for that, but before you do check the global route table of the corp rtr to be sure.

sh ip route vrf VRF-MGT <  default route should exist here
sh ip route < if no default exisit here add the following:

ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/0/2 10.59.1.2

Laslty if you are wanting to hide you internal subnets then the remote rtr should NOT beaware of/or be able to reach those networks without NAT


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi Tyson,

Below find the config for Corp RTR.  Remote rtr is not managed by me so not possible to share. 

 

Additional info which i missed to put in original post is that The Host A can able to talk with Host B successfully.  Issues is only from corp router i can't ping the remote router & host B.  I notice the ping traffic initiated from router is also getting translated. 

 


Corp_RTR#show run
Building configuration...
!
Current configuration : 11810 bytes
!
!
version 16.12
no service pad
service timestamps debug datetime msec localtime show-timezone
service timestamps log datetime msec localtime show-timezone
service password-encryption
no service dhcp
! Call-home is enabled by Smart-Licensing.
service call-home
platform qfp utilization monitor load 80
no platform punt-keepalive disable-kernel-core
!
hostname Corp_RTR
!
boot-start-marker
boot system flash bootflash:isr4400-universalk9.16.12.04.SPA.bin
boot-end-marker
!
!
vrf definition MGMT-VRF
!
address-family ipv4
exit-address-family
!
vrf definition Mgmt-intf
!
address-family ipv4
exit-address-family
!
address-family ipv6
exit-address-family
!
logging buffered 128000 informational
no logging console
no logging monitor
!
!
!
!
!
aaa session-id common
call-home
! If contact email address in call-home is configured as sch-smart-licensing@cisco.com
! the email address configured in Cisco Smart License Portal will be used as contact email address to send SCH notifications.
contact-email-addr sch-smart-licensing@cisco.com
profile "CiscoTAC-1"
active
destination transport-method http
no destination transport-method email
no ip source-route
!
no ip domain lookup
ip dhcp bootp ignore
!
!
!
login on-success log
!
!
!
!
!
!
!
subscriber templating
!
!
!
!
!
multilink bundle-name authenticated
!
!
!
crypto pki trustpoint SLA-TrustPoint
enrollment pkcs12
revocation-check crl
!
!
crypto pki certificate chain SLA-TrustPoint
certificate ca 01
30820321 30820209 A0030201 02020101 300D0609 2A864886 F70D0101 0B050030
32310E30 0C060355 040A1305 43697363 6F312030 1E060355 04031317 43697363
6F204C69 63656E73 696E6720 526F6F74 20434130 1E170D31 33303533 30313934
3834375A 170D3338 30353330 31393438 34375A30 32310E30 0C060355 040A1305
43697363 6F312030 1E060355 04031317 43697363 6F204C69 63656E73 696E6720
526F6F74 20434130 82012230 0D06092A 864886F7 0D010101 05000382 010F0030
82010A02 82010100 A6BCBD96 131E05F7 145EA72C 2CD686E6 17222EA1 F1EFF64D
CBB4C798 212AA147 C655D8D7 9471380D 8711441E 1AAF071A 9CAE6388 8A38E520
1C394D78 462EF239 C659F715 B98C0A59 5BBB5CBD 0CFEBEA3 700A8BF7 D8F256EE
4AA4E80D DB6FD1C9 60B1FD18 FFC69C96 6FA68957 A2617DE7 104FDC5F EA2956AC
7390A3EB 2B5436AD C847A2C5 DAB553EB 69A9A535 58E9F3E3 C0BD23CF 58BD7188
68E69491 20F320E7 948E71D7 AE3BCC84 F10684C7 4BC8E00F 539BA42B 42C68BB7
C7479096 B4CB2D62 EA2F505D C7B062A4 6811D95B E8250FC4 5D5D5FB8 8F27D191
C55F0D76 61F9A4CD 3D992327 A8BB03BD 4E6D7069 7CBADF8B DF5F4368 95135E44
DFC7C6CF 04DD7FD1 02030100 01A34230 40300E06 03551D0F 0101FF04 04030201
06300F06 03551D13 0101FF04 05300301 01FF301D 0603551D 0E041604 1449DC85
4B3D31E5 1B3E6A17 606AF333 3D3B4C73 E8300D06 092A8648 86F70D01 010B0500
03820101 00507F24 D3932A66 86025D9F E838AE5C 6D4DF6B0 49631C78 240DA905
604EDCDE FF4FED2B 77FC460E CD636FDB DD44681E 3A5673AB 9093D3B1 6C9E3D8B
D98987BF E40CBD9E 1AECA0C2 2189BB5C 8FA85686 CD98B646 5575B146 8DFC66A8
467A3DF4 4D565700 6ADF0F0D CF835015 3C04FF7C 21E878AC 11BA9CD2 55A9232C
7CA7B7E6 C1AF74F6 152E99B7 B1FCF9BB E973DE7F 5BDDEB86 C71E3B49 1765308B
5FB0DA06 B92AFE7F 494E8A9E 07B85737 F3A58BE1 1A48A229 C37C1E69 39F08678
80DDCD16 D6BACECA EEBC7CF9 8428787B 35202CDC 60E4616A B623CDBD 230E3AFB
418616A9 4093E049 4D10AB75 27E86F73 932E35B5 8862FDAE 0275156F 719BB2F0
D697DF7F 28
quit
!
!
no license feature hseck9
!
archive
log config
logging enable
logging size 500
notify syslog contenttype plaintext
hidekeys
memory free low-watermark processor 67089
!
diagnostic bootup level minimal
!
spanning-tree extend system-id
!
!
redundancy
mode none
!
!
!
!
!
no cdp run
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface GigabitEthernet0/0/0
vrf forwarding MGMT-VRF
ip address 10.10.205.8 255.255.255.128
no ip redirects
no ip unreachables
no ip proxy-arp
negotiation auto
no cdp enable
!
interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat inside
negotiation auto
no cdp enable
!
interface GigabitEthernet0/0/2
ip address 10.59.1.1 255.255.255.252
no ip redirects
no ip unreachables
no ip proxy-arp
ip nat outside
negotiation auto
no cdp enable
!
interface GigabitEthernet0/0/3
no ip address
no ip redirects
no ip unreachables
no ip proxy-arp
shutdown
negotiation auto
no cdp enable
!
interface GigabitEthernet0
vrf forwarding Mgmt-intf
no ip address
shutdown
negotiation auto
!
ip forward-protocol nd
no ip http server
ip http authentication local
no ip http secure-server
ip nat inside source static 192.168.1.10 10.59.1.1
ip route 10.40.1.1 255.255.255.255 10.59.1.2
ip route vrf MGMT-VRF 0.0.0.0 0.0.0.0 10.10.205.1
ip ssh time-out 60
ip ssh authentication-retries 4
ip ssh version 2
!
!
!
!
!
!
!
!
control-plane
!
!
line con 0
exec-timeout 15 0
privilege level 15
transport preferred ssh
transport output none
stopbits 1
line aux 0
exec-timeout 15 0
transport output none
stopbits 1
line vty 0 15
exec-timeout 15 0
privilege level 15
transport input ssh
transport output none
!
!
!
!
!
end,

 

In line with what @Georg Pauwen was saying, I think your NAT statement is causing your issue. You need to use Port Address Translation (PAT) in order to utilize the IP address assigned to interface GigabitEthernet0/0/2. Here is the command:

no ip nat inside source static 192.168.1.10 10.59.1.1
ip access-list standard INSIDE-NETS
 permit 192.168.1.0 0.0.0.255
ip nat inside source list INSIDE-NETS interface GigabitEtherenet0/0/2 overload

If you are also using this link to get to the internet, you're going to need to add a route:

ip route 0.0.0.0 0.0.0.0 10.59.1.2

Let me know if this fixes your issue and please consider rating any helpful replies

Georg Pauwen
VIP Master VIP Master
VIP Master

Hello,

 

in additon to Tyson's remarks, I assume you mean you cannot ping 10.59.1.2 from the other router ? But with NAT enabled, you can ping 10.59.1.2 from the PC ?

 

This is as far as I can see expected behavior. If you look the debug out from below (with NAT enabled), a ping from the router does not succeed, because the destination is not the router anymore, but the translated source address:

 

R_1#ping 10.59.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.59.1.2, timeout is 2 seconds:

*Jan 7 09:15:27.271: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [5].
*Jan 7 09:15:29.261: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [6]
*Jan 7 09:15:29.977: NAT: expiring 10.59.1.1 (192.168.1.10) icmp 0 (0).
*Jan 7 09:15:31.419: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [7].
*Jan 7 09:15:33.646: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [8].
*Jan 7 09:15:35.746: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [9].

--> Success rate is 0 percent (0/5)

 

The debug output when pinging from the PC looks different (ping succeeds):


*Jan 7 09:15:50.139: NAT*: s=192.168.1.10->10.59.1.1, d=10.59.1.2 [53731]
*Jan 7 09:15:50.174: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [53731]
*Jan 7 09:15:51.069: NAT*: s=192.168.1.10->10.59.1.1, d=10.59.1.2 [53732]
*Jan 7 09:15:51.101: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [53732]
*Jan 7 09:15:52.007: NAT*: s=192.168.1.10->10.59.1.1, d=10.59.1.2 [53733]
*Jan 7 09:15:52.007: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [53733]
*Jan 7 09:15:52.689: NAT*: s=192.168.1.10->10.59.1.1, d=10.59.1.2 [53734]
*Jan 7 09:15:52.695: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [53734]
*Jan 7 09:15:53.612: NAT*: s=192.168.1.10->10.59.1.1, d=10.59.1.2 [53735]
*Jan 7 09:15:53.612: NAT*: s=10.59.1.2, d=10.59.1.1->192.168.1.10 [53735]

paul driver
VIP Expert VIP Expert
VIP Expert

Hello

As i’ve stated your static nat is fine it will work when you ping host b from host a because corp rtr as a host static route for host b.

 

As it stands initiating a ping from corp router itself with nat enabled should work and fail-

sourced from the wan interface it should work

sourced from the lan interface it shouldn’t work and you would want it to be like this as the lan interface on corp should be hidden from the outside and the only way it will be reachable from the outside without nat is if say the remote rtr has a route for corps lan interface 

So at present the only thing you are missing is a properly defined default static route in the global rib table of corp rtr so then your host A should be able to reach anywhere on the outside network as long as you have nat enabled and corp rtr wan interface is reachable to all egress hosts

lastly if you don’t want host A to reach anywhere else outside or any other future lan host of corp rtr to do so then your existing config is fine 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers