Examples
The following is sample output from the
debug
ip
nat command. In this example, the first two lines show the Domain Name System (DNS) request and reply debugging output. The remaining
lines show debugging output from a Telnet connection from a host on the inside of the network to a host on the outside of
the network. All Telnet packets, except for the first packet, were translated in the fast path, as indicated by the asterisk
(*).
Router# debug ip nat
NAT: s=192.0.2.1->203.0.112.1, d=203.0.112.254 [6825]
NAT: s=203.0.112.254, d=203.0.112.1->192.0.2.1 [21852]
NAT: s=192.0.2.1->203.0.112.1, d=203.0.112.200 [6826]
NAT*: s=203.0.112.200, d=203.0.112.1->192.0.2.1 [23311]
NAT*: s=192.0.2.1->203.0.112.1, d=203.0.112.200 [6827]
NAT*: s=192.0.2.1->203.0.112.1, d=203.0.112.200 [6828]
NAT*: s=203.0.112.200, d=203.0.112.1->192.0.2.1 [23313]
NAT*: s=203.0.112.200, d=203.0.112.1->192.0.2.1 [23325]
s
The table below describes the significant fields shown in the display.
Table 14. debug ip nat Field Descriptions
Field
|
Description
|
NAT
|
Indicates that the packet is being translated by NAT. An asterisk (*) indicates that the translation is occurring in the
fast path. The first packet in a conversation always goes through the slow path (that is, it is process switched). The remaining
packets go through the fast path if a cache entry exists.
|
s=192.0.2.1->203.0.112.1
|
Source address of the packet and how it is being translated.
|
d=203.0.112.254
|
Destination address of the packet.
|
[6825]
|
IP identification number of the packet. Might be useful in the debugging process to correlate with other packet traces from
protocol analyzers.
|
The following is sample output from the
debug
ip
nat
detailed command. In this example, the first two lines show the debugging output produced by a DNS request and reply. The remaining
lines show the debugging output from a Telnet connection from a host on the inside of the network to a host on the outside
of the network. In this example, the inside host 192.168.1.95 was assigned the global address 172.31.233.193. The output fields
are self-explanatory.
Router# debug ip nat detailed
NAT: i: udp (192.168.1.95, 1493) -> (172.31.2.132, 53) [22399]
NAT: o: udp (172.31.2.132, 53) -> (172.31.233.193, 1493) [63671]
NAT*: i: tcp (192.168.1.95, 1135) -> (172.31.2.75, 23) [22400]
NAT*: o: tcp (172.31.2.75, 23) -> (172.31.233.193, 1135) [22002]
NAT*: i: tcp (192.168.1.95, 1135) -> (172.31.2.75, 23) [22401]
NAT*: i: tcp (192.168.1.95, 1135) -> (172.31.2.75, 23) [22402]
NAT*: o: tcp (172.31.2.75, 23) -> (172.31.233.193, 1135) [22060]
NAT*: o: tcp (172.31.2.75, 23) -> (172.31.233.193, 1135) [22071]
The following is sample output from the
debug
ip
nat
h323 command. In this example, an H.323 call is established between two hosts, one host on the inside and the other host on the
outside of the network. The debugging output displays the H.323 message names that NAT recognizes and the embedded IP addresses
contained in those messages.
Router# debug ip nat h323
NAT:H225:[0] processing a Setup message
NAT:H225:[0] found Setup sourceCallSignalling
NAT:H225:[0] fix transportAddress addr=192.168.122.50 port=11140
NAT:H225:[0] found Setup fastStart
NAT:H225:[0] Setup fastStart PDU length:18
NAT:H245:[0] processing OpenLogicalChannel message, forward channel
number 1
NAT:H245:[0] found OLC forward mediaControlChannel
NAT:H245:[0] fix TransportAddress addr=192.168.122.50 port=16517
NAT:H225:[0] Setup fastStart PDU length:29
NAT:H245:[0] Processing OpenLogicalChannel message, forward channel
number 1
NAT:H245:[0] found OLC reverse mediaChannel
NAT:H245:[0] fix Transportaddress addr=192.168.122.50 port=16516
NAT:H245:[0] found OLC reverse mediaControlChannel
NAT:H245:[0] fix TransportAddress addr=192.168.122.50 port=16517
NAT:H225:[1] processing an Alerting message
NAT:H225:[1] found Alerting fastStart
NAT:H225:[1] Alerting fastStart PDU length:25
NAT:H245:[1] processing OpenLogicalChannel message, forward channel
number 1
NAT:H323:[0] received pak, payload_len=46
NAT:H323:[0] processed up to new_payload_len 4
NAT:H323:[0] expecting data len=42--payload_len left 42
NAT:H323:[0] try to process tpkt with len 42, payload_len left 42
NAT:H225:processing a Facility message
NAT:H225:pdu_len :31 msg_IE:28
NAT:H323:choice-value:9
NAT:H225:[0] found h245Tunneling
NAT:H225:[0] found h245Control
NAT:H225:[0] h245control PDU length:20
NAT:H245:[0] processing OpenLogicalChannel message, forward channel
number 2
NAT:H245:[0] found OLC forward mediaControlChannel
NAT:H245:[0] fix TransportAddress addr=192.168.122.50 port=51001
NAT:H245:[0] TransportAddress addr changed 192.168.122.50->172.31.122.129
NAT:H245:[0] message changed, encoding back
NAT:H245:exit process tpkt with new_len 20
NAT:H225:message changed, encoding back
NAT:H323:[0] processed up to new_payload_len 46
NAT:H323:[0] new pak payload len is 46
The table below describes the significant fields shown in the display.
Table 15. debug ip nat h323 Field Descriptions
Field
|
Description
|
NAT
|
Indicates that the packet is being translated by NAT.
|
H.225, H.245, and H.323
|
Protocol of the packet.
|
[0]
|
Indicates that the packet is moving from a host outside the network to one host inside the network.
|
[1]
|
Indicates that the packet is moving from a host inside the network to one host outside the network.
|
The following is sample output from the
debug
ip
nat
ipsec command. The output fields are self-explanatory.
Router# debug ip nat ipsec
5d21h:NAT:new IKE going In->Out, source addr 192.168.122.35, destination addr 192.168.22.20, initiator cookie
0x9C42065D
5d21h:NAT:IPSec:created In->Out ESP translation IL=192.168.122.35 SPI=0xAAE32A0A, IG=192.168.22.40, OL=192.168.22.20,
OG=192.168.22.20
5d21h:NAT:IPSec:created Out->In ESP translation OG=192.168.22.20 SPI=0xA64B5BB6, OL=192.168.22.20, IG=192.168.22.40,
IL=192.168.122.35
5d21h:NAT:new IKE going In->Out, source addr 192.168.122.20, destination addr 192.168.22.20, initiator cookie
0xC91738FF
5d21h:NAT:IPSec:created In->Out ESP translation IL=192.168.122.20 SPI=0x3E2E1B92, IG=192.168.22.40, OL=192.168.22.20,
OG=192.168.22.20
5d21h:NAT:IPSec:Inside host (IL=192.168.122.20) trying to open an ESP connection to Outside host (OG=192.168.22.20),
wait for Out->In reply
5d21h:NAT:IPSec:created Out->In ESP translation OG=192.168.22.20 SPI=0x1B201366, OL=192.168.22.20, IG=192.168.22.40,
IL=192.168.122.20
The following is sample output from the
debug
ip
nat
sip command. In this example, one IP phone registers with a Cisco SIP proxy and then calls another IP phone. The debugging output
displays the SIP messages that NAT recognizes and the embedded IP addresses contained in those messages.
Router# debug ip nat sip
NAT:SIP:[0] processing REGISTER message
NAT:SIP:[0] translated embedded address
192.168.122.3->10.1.1.1
NAT:SIP:[0] translated embedded address
192.168.122.3->10.1.1.1
NAT:SIP:[0] message body found
NAT:SIP:[0] found address/port in SDP body:192.168.122.20
20332
NAT:SIP:[1] processing SIP/2.0 100 Trying reply message
NAT:SIP:[1] translated embedded address
10.1.1.1->192.168.122.3
NAT:SIP:[1] processing SIP/2.0 200 OK reply message
NAT:SIP:[1] translated embedded address
10.1.1.1->192.168.122.3
NAT:SIP:[1] translated embedded address
10.1.1.1->192.168.122.3
NAT:SIP:[1] processing INVITE message
NAT:SIP:[1] translated embedded address
10.1.1.1->192.168.122.3
NAT:SIP:[1] message body found
NAT:SIP:[1] found address/port in SDP body:192.168.22.20
The table below describes the significant fields shown in the display.
Table 16. debug ip nat sip Field Descriptions
Field
|
Description
|
NAT
|
Indicates that the packet is being translated by NAT.
|
SIP
|
Protocol of the packet.
|
[0]
|
Indicates that the packet is moving from a host outside the network to one host inside the network.
|
[1]
|
Indicates that the packet is moving from a host inside the network to one host outside the network.
|
The following is sample output from the
debug
ip
nat
tcp-alg command:
Router# debug ip nat tcp-alg
*Oct 6 04:56:13.411: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:13.411: NAT-L4F : Still in the spoofing mode, tcpflags = 0x4
*Oct 6 04:56:13.411: NAT-L4F : Close notify from L4F
*Oct 6 04:56:13.427: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:23.807: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:23.807: NAT-L4F: Policy check successful
*Oct 6 04:56:23.807: NAT-L4F: received fd1: 1073741825 and
tcp flags = 0x2, payload_len = 0
*Oct 6 04:56:23.811: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:23.811: NAT-L4F: received fd2: 1073741826 and
tcp flags = 0x12,payload_len = 0
*Oct 6 04:56:23.811: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:23.811: NAT-L4F: Received final ACK from fd1 : 1073741825 and
tcp flags = 0x10
*Oct 6 04:56:23.811: NAT-L4F:Transistioning to proxy: rc 0 error 0
*Oct 6 04:56:23.811: NAT-ALG: H.225/H.245 ASN encode/decode library initialized
*Oct 6 04:56:23.811: NAT-L4F: Successfully proxied this flow
*Oct 6 04:56:23.811: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:23.811: NAT-ALG: lookup=0 l7_bytes_recd=12 appl_type=5
*Oct 6 04:56:23.811: NAT-ALG: Skinny l7_msg_size = 12
*Oct 6 04:56:23.811: NAT-ALG: after state machine:
*Oct 6 04:56:23.811: NAT-ALG: remaining_hdr_sz=0
*Oct 6 04:56:23.811: NAT-ALG: remaining_payl_sz=0
*Oct 6 04:56:23.811: NAT-ALG: tcp_alg_state=0
*Oct 6 04:56:23.811: NAT-ALG: complete_msg_len=12
*Oct 6 04:56:23.811: l4f_send returns 12 bytes
*Oct 6 04:56:23.811: Complete buffer written to proxy
*Oct 6 04:56:23.811: NAT-L4F:NO DATA to read
*Oct 6 04:56:23.815: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:24.027: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:24.027: NAT-ALG: lookup=0 l7_bytes_recd=56 appl_type=5
*Oct 6 04:56:24.027: NAT-ALG: Skinny l7_msg_size = 56
*Oct 6 04:56:24.027: NAT-ALG: after state machine:
*Oct 6 04:56:24.027: NAT-ALG: remaining_hdr_sz=0
*Oct 6 04:56:24.027: NAT-ALG: remaining_payl_sz=0
*Oct 6 04:56:24.027: NAT-ALG: tcp_alg_state=0
*Oct 6 04:56:24.027: NAT-ALG: complete_msg_len=56
*Oct 6 04:56:24.027: l4f_send returns 56 bytes
*Oct 6 04:56:24.027: Complete buffer written to proxy
*Oct 6 04:56:24.027: NAT-L4F:NO DATA to read
*Oct 6 04:56:24.035: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:24.239: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:24.239: NAT-ALG: lookup=0 l7_bytes_recd=16 appl_type=5
*Oct 6 04:56:24.239: NAT-ALG: Skinny l7_msg_size = 16
*Oct 6 04:56:24.239: NAT-ALG: after state machine:
*Oct 6 04:56:24.239: NAT-ALG: remaining_hdr_sz=0
*Oct 6 04:56:24.239: NAT-ALG: remaining_payl_sz=0
*Oct 6 04:56:24.239: NAT-ALG: tcp_alg_state=0
*Oct 6 04:56:24.239: NAT-ALG: complete_msg_len=16
*Oct 6 04:56:24.239: l4f_send returns 16 bytes
*Oct 6 04:56:24.239: Complete buffer written to proxy
*Oct 6 04:56:24.239: NAT-L4F:NO DATA to read
*Oct 6 04:56:24.239: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:24.239: NAT-ALG: lookup=1 l7_bytes_recd=116 appl_type=5
*Oct 6 04:56:24.239: NAT-ALG: Skinny l7_msg_size = 116
*Oct 6 04:56:24.239: NAT-ALG: after state machine:
*Oct 6 04:56:24.239: NAT-ALG: remaining_hdr_sz=0
*Oct 6 04:56:24.239: NAT-ALG: remaining_payl_sz=0
*Oct 6 04:56:24.239: NAT-ALG: tcp_alg_state=0
*Oct 6 04:56:24.239: NAT-ALG: complete_msg_len=116
*Oct 6 04:56:24.239: l4f_send returns 116 bytes
*Oct 6 04:56:24.239: Complete buffer written to proxy
*Oct 6 04:56:24.239: NAT-L4F:NO DATA to read
*Oct 6 04:56:24.239: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:24.239: NAT-ALG: lookup=0 l7_bytes_recd=32 appl_type=5
*Oct 6 04:56:24.239: NAT-ALG: Skinny l7_msg_size = 32
*Oct 6 04:56:24.239: NAT-ALG: after state machine:
*Oct 6 04:56:24.239: NAT-ALG: remaining_hdr_sz=0
*Oct 6 04:56:24.239: NAT-ALG: remaining_payl_sz=0
*Oct 6 04:56:24.239: NAT-ALG: tcp_alg_state=0
*Oct 6 04:56:24.239: NAT-ALG: complete_msg_len=32
*Oct 6 04:56:24.239: l4f_send returns 32 bytes
*Oct 6 04:56:24.239: Complete buffer written to proxy
*Oct 6 04:56:24.239: NAT-L4F:NO DATA to read
*Oct 6 04:56:24.243: NAT-L4F:setting ALG_NEEDED flag in subblock
*Oct 6 04:56:24.243: NAT-L4F:read RST, aborting
*Oct 6 04:56:24.243: NAT-L4F:Buffer list is empty
*Oct 6 04:56:24.243: NAT-L4F : Close notify from L4F
The table below describes the significant fields shown in the display.
Table 17. debug ip nat tcp-alg Field Descriptions
Field
|
Description
|
NAT-L4F
|
Indicates that the packet is being processed by the NAT-ALG interface with Layer 4 forwarding.
|
NAT-ALG
|
Indicates that the packet is being processed by NAT-ALG.
|
The following is sample output from the
debug
ip
nat
vrf command:
Router# debug ip nat vrf
6d00h:NAT:address not stolen for 192.168.121.113, proto 1 port 7224
6d00h:NAT:creating portlist proto 1 globaladdr 10.1.1.10
6d00h:NAT:Allocated Port for 192.168.121.113 -> 10.1.1.10:wanted 7224 got 7224
6d00h:NAT:i:icmp (192.168.121.113, 7224) -> (172.28.88.2, 7224) [2460]
6d00h:NAT:s=192.168.121.113->10.1.1.10, d=172.28.88.2 [2460] vrf=> shop
6d00h:NAT*:o:icmp (172.28.88.2, 7224) -> (10.1.1.10, 7224) [2460] vrf=> shop
6d00h:NAT*:s=172.28.88.2, d=10.1.1.10->192.168.121.113 [2460] vrf=> shop
6d00h:NAT:Allocated Port for 192.168.121.113 -> 10.1.1.10:wanted 7225 got 7225
6d00h:NAT:i:icmp (192.168.121.113, 7225) -> (172.28.88.2, 7225) [2461]
6d00h:NAT:s=192.168.121.113->10.1.1.10, d=172.28.88.2 [2461] vrf=> shop
6d00h:NAT*:o:icmp (172.28.88.2, 7225) -> (10.1.1.10, 7225) [2461] vrf=> shop
6d00h:NAT*:s=172.28.88.2, d=10.1.1.10->192.168.121.113 [2461] vrf=> shop
6d00h:NAT:Allocated Port for 192.168.121.113 -> 10.1.1.10:wanted 7226 got 7226
6d00h:NAT:i:icmp (192.168.121.113, 7226) -> (172.28.88.2, 7226) [2462]
6d00h:NAT:s=192.168.121.113->10.1.1.10, d=172.28.88.2 [2462] vrf=> shop
The table below describes the significant fields shown in the display.
Table 18. debug ip nat vrf Field Descriptions
Field
|
Description
|
NAT
|
Indicates that the packet is being translated by NAT.
|
s=192.168.121.113->10.1.1.10
|
Source address of the packet and how it is being translated.
|
d=172.28.88.2
|
Destination address of the packet.
|
[2460]
|
IP identification number of the packet.
|
vrf=>
|
Indicates that NAT is applied to a particular VPN.
|
The following is sample output from the
debug
ip
nat
wlan-nat command:
Router# debug ip nat wlan-nat
WLAN-NAT: Creating secure ARP entry (10.1.1.1,0010.7bc2.9ff6)
WLAN-NAT: Triggered Acct Start for (209.165.201.1,0010.7bc2.9ff6)
WLAN-NAT: Extracting addr:209.165.201.1,input_idb:Ethernet1/2 from pak
WLAN-NAT: Saving address:209.165.201.1,input_idb:Ethernet1/2 in pak
After the WLAN-entry times out, the following debugs will be seen:
WLAN-NAT: Removing secure arp entry (10.1.1.1,0010.7bc2.9ff6)
WLAN-NAT: triggered Acct Stop for (209.165.201.1,0010.7bc2.9ff6)
The table below describes the significant fields shown in the display.
Table 19. debug ip nat wlan-nat Field Descriptions
Field
|
Description
|
WLAN
|
Indicates that a wireless LAN is being translated.
|
NAT
|
Indicates that the packet is being translated using NAT.
|