簡介
本文件說明如何在 NAT 環境中疑難排解 IP 連線問題。
必要條件
需求
本文件沒有特定需求。
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
慣例
如需文件慣例的詳細資訊,請參閱思科技術提示慣例。
問題
本文檔介紹如何透過檢視以下兩個示例來對NAT環境中的IP連線問題進行故障排除:
- 對一台路由器執行Ping操作,對另一台路由器不執行ping操作
- 外部網路裝置無法與內部路由器通訊
以下基本步驟有助於確定NAT操作中是否存在問題:
-
檢驗配置,並明確定義NAT應該實現的目標。根據檢查,您可以確定配置是否存在問題。有關NAT配置的資訊,請參閱配置網路地址轉換。
-
檢驗轉換表中是否存在正確的轉換。
-
使用show和debug命令驗證是否進行了轉換。
-
詳細檢視資料包發生的情況,並檢驗路由器是否具有轉發資料包所需的正確路由資訊。
對一台路由器執行Ping操作,對另一台路由器不執行ping操作
在第一種場景中,路由器4可以ping路由器5 (172.16.6.5)但不能ping通路由器7 (172.16.11.7):
NAT拓撲
Router4#ping 172.16.6.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.6.5, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
Router4#ping 172.16.11.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.11.7, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Router4#
關於此情況的重要考慮事項:
- 路由器上未配置動態路由協定,僅使用靜態路由。
- Router 4的預設網關是Router 6。
- 路由器6配置了NAT。
interface GigabitEthernet1
ip address 172.16.11.6 255.255.255.0
ip nat outside
negotiation auto
no mop enabled
no mop sysid
!
interface GigabitEthernet2
ip address 172.16.6.6 255.255.255.0
ip nat outside
negotiation auto
no mop enabled
no mop sysid
!
interface GigabitEthernet3
ip address 10.10.10.6 255.255.255.0
ip nat inside
negotiation auto
no mop enabled
no mop sysid
!
!
ip nat pool test 172.16.11.70 172.16.11.71 prefix-length 24 ip nat inside source static 10.10.10.4 172.16.6.14 ip nat inside source list 7 pool test
!
ip access-list standard 7
10 permit 10.10.50.4
20 permit 10.10.60.4
30 permit 10.10.70.4
疑難排解
1. 首先,您需要確定NAT是否工作正常。根據先前的配置,可以確定路由器4的IP地址10.10.10.4被靜態轉換為172.16.6.14。透過在路由器6上使用show ip nat translation命令,您可以檢驗轉換表中是否存在該轉換:
NAT-Router#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 172.16.6.14 10.10.10.4 --- ---
Total number of translations: 1
NAT-Router#
2. 確保當Router 4生成IP流量時進行此轉換。您可以從Router 6採用兩種方式來執行此操作。使用show ip nat statistics命令運行NAT調試或監控NAT統計資料。由於debug命令是最後手段,因此請先使用show命令。
3. 監控計數器,確保它在接收來自Router 4的流量時增加。每次使用轉換表來轉換地址時,計數器都會增加。
4. 清除統計資訊,然後顯示統計資訊,然後嘗試從路由器4 ping路由器7,然後再次顯示統計資訊。
NAT-Router#clear ip nat statistics
NAT-Router#
NAT-Router#show ip nat statistics
Total active translations: 1 (1 static, 0 dynamic; 0 extended)
Outside interfaces:
GigabitEthernet1, GigabitEthernet2
Inside interfaces:
GigabitEthernet3
Hits: 0 Misses: 0
Expired translations: 0
Dynamic mappings:
-- Inside Source
[Id: 1] access-list 7 pool test refcount 0
pool test: id 1, netmask 255.255.255.0
start 172.16.11.70 end 172.16.11.71
type generic, total addresses 2, allocated 0 (0%), misses 0
nat-limit statistics:
max entry: max allowed 0, used 0, missed 0
In-to-out drops: 0 Out-to-in drops: 0
Pool stats drop: 0 Mapping stats drop: 0
Port block alloc fail: 0
IP alias add fail: 0
Limit entry add fail: 0
NAT-Router#
在路由器4上使用ping 172.16.11.7命令後,路由器6上的NAT統計資料如下:
Router4#ping 172.16.11.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.11.7, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
Router4#
NAT-Router#show ip nat statistics
Total active translations: 2 (1 static, 1 dynamic; 1 extended)
Outside interfaces:
GigabitEthernet1, GigabitEthernet2
Inside interfaces:
GigabitEthernet3
Hits: 4 Misses: 1
Expired translations: 0
Dynamic mappings:
-- Inside Source
[Id: 1] access-list 7 pool test refcount 0
pool test: id 1, netmask 255.255.255.0
start 172.16.11.70 end 172.16.11.71
type generic, total addresses 2, allocated 0 (0%), misses 0
nat-limit statistics:
max entry: max allowed 0, used 0, missed 0
In-to-out drops: 0 Out-to-in drops: 0
Pool stats drop: 0 Mapping stats drop: 0
Port block alloc fail: 0
IP alias add fail: 0
Limit entry add fail: 0
NAT-Router#
從show命令輸出中可以看到,命中數增加。在思科路由器的一次成功ping操作中,命中數增加10。轉換源路由器(路由器4)傳送的網際網路控制消息協定(ICMP)響應,並且還需要轉換來自目標路由器(路由器7)的響應應答資料包,總共有10次命中。5次命中的丟失是因為沒有轉換回應應答,或者不是從路由器7傳送。
接下來,看看您是否能找到路由器7不向路由器4傳送應答資料包的任何原因。此時此刻,下一步已經展開:
- Router 4傳送來源位址為10.10.10.4,目的地位址為172.16.11.7的ICMP回應封包。
- 執行NAT後,路由器7收到的資料包的源地址為172.16.6.14,目的地址為172.16.11.7。
- 路由器7需要回覆172.16.6.14,並且由於172.16.6.14未直接連線到路由器7,因此它需要此網路的路由才能做出響應。
注意:確認資料包是否到達目的地路由器的另一個選項是使用嵌入式資料包捕獲(EPC)或使用帶有訪問清單(ACL)的debug ip icmp/debug ip資料包。
現在,您需要檢查Router 7的路由表,以檢驗是否存在通往172.16.6.14的路由:
Router7#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C 172.16.11.0/24 is directly connected, GigabitEthernet1
L 172.16.11.7/32 is directly connected, GigabitEthernet1
Router7#
在前面的輸出中,您可以觀察到,路由器7的路由表中沒有通往172.16.6.14子網的路由。更正後,如果向配置中增加了路由,ping就會起作用。 使用show ip nat statistics命令監控NAT統計資訊是很有用的。但是,在有多個轉換的更複雜的NAT環境中,該show命令不再有用,需要在路由器上使用調試。
Router7#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router7(config)#ip route 172.16.6.0 255.255.255.0 172.16.11.6
Router7(config)#end
Router7#
Router4#ping 172.16.11.7
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.11.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/8 ms
Router4#
NAT-Router#show ip nat statistics
Total active translations: 2 (1 static, 1 dynamic; 1 extended)
Outside interfaces:
GigabitEthernet1, GigabitEthernet2
Inside interfaces:
GigabitEthernet3
Hits: 9 Misses: 1
Expired translations: 0
Dynamic mappings:
-- Inside Source
[Id: 1] access-list 7 pool test refcount 0
pool test: id 1, netmask 255.255.255.0
start 172.16.11.70 end 172.16.11.71
type generic, total addresses 2, allocated 0 (0%), misses 0
nat-limit statistics:
max entry: max allowed 0, used 0, missed 0
In-to-out drops: 0 Out-to-in drops: 0
Pool stats drop: 0 Mapping stats drop: 0
Port block alloc fail: 0
IP alias add fail: 0
Limit entry add fail: 0
NAT-Router#
外部網路裝置無法與內部路由器通訊
在此問題中,路由器4可以ping通路由器5和路由器7,但10.10.50.0網路中的裝置無法與路由器5或路由器7通訊。
Router4#ping 172.16.11.7 source 10.10.50.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.11.7, timeout is 2 seconds:
Packet sent with a source address of 10.10.50.4
.....
Success rate is 0 percent (0/5)
Router4#ping 172.16.6.5 source 10.10.50.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.6.5, timeout is 2 seconds:
Packet sent with a source address of 10.10.50.4
.....
Success rate is 0 percent (0/5)
Router4#
此問題的網路圖保持不變:
NAT拓撲
interface GigabitEthernet1
ip address 172.16.11.6 255.255.255.0
ip nat outside
negotiation auto
no mop enabled
no mop sysid
!
interface GigabitEthernet2
ip address 172.16.6.6 255.255.255.0
ip nat outside
negotiation auto
no mop enabled
no mop sysid
!
interface GigabitEthernet3
ip address 10.10.10.6 255.255.255.0
ip nat inside
negotiation auto
no mop enabled
no mop sysid
!
!
ip nat pool test 172.16.11.70 172.16.11.71 prefix-length 24
ip nat inside source static 10.10.10.4 172.16.6.14
ip nat inside source list 7 pool test
!
ip access-list standard 7
10 permit 10.10.50.4
20 permit 10.10.60.4
30 permit 10.10.70.4
疑難排解
從Router 6的配置,您可以看到NAT應該將10.10.50.4動態轉換為NAT池(稱為test)中的第一個可用地址。地址池由地址172.16.11.70和172.16.11.71組成。透過此問題,您可以瞭解路由器5和路由器7接收的資料包的源地址是172.16.11.70或172.16.11.71。這些地址與Router 7位於同一子網上,因此Router 7必須有一條直接連線到該子網的路由,但是,如果它還沒有這條路由,Router 5需要通往該子網的路由。
您可以使用show ip route命令檢視路由器5的路由表是否列出172.16.11.0:
Router5#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
C 172.16.6.0/24 is directly connected, GigabitEthernet1
L 172.16.6.5/32 is directly connected, GigabitEthernet1
S 172.16.11.0/24 [1/0] via 172.16.6.6
您可以使用show ip route命令檢視路由器7的路由表是否將172.16.11.0列為直接連線的子網:
Router7#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
S 172.16.6.0/24 [1/0] via 172.16.11.6
C 172.16.11.0/24 is directly connected, GigabitEthernet1
L 172.16.11.7/32 is directly connected, GigabitEthernet1
檢查NAT轉換表,並檢驗所需的轉換是否存在。由於所需的轉換是動態建立的,因此您必須首先傳送來自相應地址的IP流量。傳送來源為10.10.50.4,目標為172.16.11.7的ping後,路由器6(NAT路由器)中的轉換表將顯示以下輸出:
NAT-Router#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 172.16.6.14 10.10.10.4 --- ---
--- 172.16.11.70 10.10.50.4 --- ---
Total number of translations: 2
由於所需的轉換位於轉換表中,因此您知道ICMP回應資料包已正確轉換。一個選項是您可以監控NAT統計資料,但在複雜的環境中該選項並不有用。另一個選項是在NAT路由器(路由器6)上運行NAT調試。您可以在傳送來源為10.10.50.4,目標為172.16.11.7的ping時運行debug ip nat。調試結果位於下一個代碼示例中。
注意:在路由器上使用任何debug命令時,都可能導致路由器過載,從而導致路由器無法運行。在沒有Cisco技術支援工程師的監督下,儘量不要對重要的生產路由器運行調試。
NAT-Router#show logging
Syslog logging: enabled (0 messages dropped, 0 flushes, 0 overruns)
Console logging: level debugging, 39 messages logged
Monitor logging: level debugging, 0 messages logged
Buffer logging: level debugging, 39 messages logged
Trap logging: level informational, 33 message lines logged
Log Buffer (4096 bytes):
05:32:23: NAT: s=10.10.50.4->172.16.11.70, d=172.16.11.7 [70]
05:32:23: NAT*: s=172.16.11.7, d=172.16.11.70->10.10.50.4 [70]
05:32:25: NAT*: s=10.10.50.4->172.16.11.70, d=172.16.11.7 [71]
05:32:25: NAT*: s=172.16.11.7, d=172.16.11.70->10.10.50.4 [71]
05:32:27: NAT*: s=10.10.50.4->172.16.11.70, d=172.16.11.7 [72]
05:32:27: NAT*: s=172.16.11.7, d=172.16.11.70->10.10.50.4 [72]
05:32:29: NAT*: s=10.10.50.4->172.16.11.70, d=172.16.11.7 [73]
05:32:29: NAT*: s=172.16.11.7, d=172.16.11.70->10.10.50.4 [73]
05:32:31: NAT*: s=10.10.50.4->172.16.11.70, d=172.16.11.7 [74]
05:32:31: NAT*: s=172.16.11.7, d=172.16.11.70->10.10.50.4 [74]
Router7#show monitor capture cap buffer brief
----------------------------------------------------------------------------
# size timestamp source destination dscp protocol
----------------------------------------------------------------------------
0 114 0.000000 172.16.11.70 -> 172.16.11.7 0 BE ICMP
1 114 2.000000 172.16.11.70 -> 172.16.11.7 0 BE ICMP
2 114 4.000000 172.16.11.70 -> 172.16.11.7 0 BE ICMP
3 114 6.001999 172.16.11.70 -> 172.16.11.7 0 BE ICMP
4 114 8.001999 172.16.11.70 -> 172.16.11.7 0 BE ICMP
從前面的調試輸出中可以看到,第一行顯示源地址10.10.50.4已轉換為172.16.11.70。第二行顯示目的地址172.16.11.70已轉換回10.10.50.4。在調試的其餘部分中,此模式會重複出現。這意味著NAT路由器在兩個方向轉換資料包。此外,從封包擷取中可以看到,路由器7確實收到來源為172.16.11.70,目的地為172.16.11.7的ICMP封包。
後續步驟是此問題目前狀態的摘要:
1. Router 4傳送來源為10.10.50.4、目標為172.16.11.7(或172.16.6.5,具體取決於所執行的測試)的資料包。
2. NAT路由器對資料包執行NAT轉換,並將它轉發到源172.16.11.70和目的地172.16.11.7。
3. 路由器7傳送一個響應,其源地址為172.16.11.7,目的地址為172.16.11.70。
4. NAT路由器(路由器6)對資料包執行NAT,結果得到源地址為172.16.11.7、目的地址為10.10.50.4的資料包。
5. NAT路由器(路由器6)根據路由表中的資訊將資料包路由到10.10.50.4。
此時,您需要使用show ip route和show ip cef命令來確認NAT路由器(路由器6)在路由表中有必需的路由。
NAT-Router#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR
& - replicated local route overrides by connected
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.10.10.0/24 is directly connected, GigabitEthernet3
L 10.10.10.6/32 is directly connected, GigabitEthernet3
172.16.0.0/16 is variably subnetted, 6 subnets, 2 masks
C 172.16.6.0/24 is directly connected, GigabitEthernet2
L 172.16.6.6/32 is directly connected, GigabitEthernet2
L 172.16.6.14/32 is directly connected, GigabitEthernet2
C 172.16.11.0/24 is directly connected, GigabitEthernet1
L 172.16.11.6/32 is directly connected, GigabitEthernet1
L 172.16.11.70/32 is directly connected, GigabitEthernet1
NAT-Router#show ip route 10.10.50.4
% Subnet not in table
NAT-Router#show ip cef 10.10.50.4
0.0.0.0/0
no route
NAT-Router#
在NAT路由器中增加缺失的路由後,ping操作現在成功:
NAT-Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
NAT-Router(config)#ip route 10.10.50.4 255.255.255.255 10.10.10.4
NAT-Router(config)#end
NAT-Router#
Router4#ping 172.16.11.7 source 10.10.50.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.11.7, timeout is 2 seconds:
Packet sent with a source address of 10.10.50.4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms
Router4#ping 172.16.6.5 source 10.10.50.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.6.5, timeout is 2 seconds:
Packet sent with a source address of 10.10.50.4
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
Router4#
常見問題核對清單
請使用以下核對表對常見問題進行故障排除:
轉換表中未安裝轉換
如果您發現轉換表中沒有安裝適當的轉換,請驗證:
- 配置正確。有時很難讓NAT獲得您想要的東西。有關配置幫助,請參閱配置網路地址轉換。
- 沒有任何入站訪問清單拒絕來自NAT路由器的資料包進入。
- 如果資料包從內部傳到外部,則NAT路由器在路由表中具有相應的路由。有關詳細資訊,請參閱NAT運行順序。
- NAT命令引用的訪問清單允許所有必需的網路。
- NAT池中有足夠的地址。只有在NAT未針對擁塞進行配置時,才會出現此問題。
- 路由器介面被正確地定義為NAT內部介面或NAT外部介面。
- 要轉換域名系統(DNS)資料包的負載,請確保在資料包的IP報頭中的地址上進行轉換。如果未發生這種情況,則NAT不會檢查資料包的負載。
未使用正確的轉換條目
如果在轉換表中安裝了正確的轉換條目,但未使用,請檢查:
- 驗證沒有任何入站訪問清單拒絕來自NAT路由器的資料包條目。
- 對於從內部到外部的資料包,驗證是否存在通向目的地的路由,因為轉換之前會檢查此路由。有關詳細資訊,請參閱NAT運行順序。
NAT運行正常,但仍存在連線問題
排除連線故障:
- 檢驗第2層連通性。
- 檢驗第3層路由資訊。
- 搜尋導致問題的資料包過濾器。
埠80的NAT轉換不起作用
這意味著埠80的NAT轉換不起作用,但其他埠的轉換正常工作。
若要解決此問題:
- 運行debug ip nat translations和debug ip packet命令,以檢視轉換是否正確並且是否在轉換表中安裝了正確的轉換條目。
- 驗證伺服器是否響應。
- 停用HTTP伺服器。
- 清除NAT和ARP表。
%NAT系統忙碌-請稍後再試
當執行與NAT相關的show命令或執行show running-config或write memory命令時,將顯示try later錯誤消息。這是由NAT表的大小增加引起的。當NAT表的大小增加時,路由器會耗盡記憶體。
- 重新載入路由器以解決此問題。
- 如果在配置HSRP SNAT時出現錯誤消息,請配置以下命令以解決該問題:
- Router(config)#standby delay minimum 20 reload 20
- Router(config)#standby 2 preempt delay minimum 20 reload 20 sync 10
大型轉換表會增加CPU
主機可以傳送數百個轉換,這會導致CPU使用率較高。換句話說,它可能會使表變大,導致CPU以100%的速度運行。ip nat translation max-entries 300 命令對每個主機建立300個條目的限制,或對路由器建立轉換數量的聚合限制。解決方法是使用ip nat translation max-entries all-hosts 300命令。
%公共Ip地址已對映(內部Ip地址>公共Ip地址)
當您嘗試將兩個內部IP地址配置為可在同一埠上偵聽的公有IP地址時,會出現此消息。
% X.X.X.X already mapped (172.30.62.101 -> X.X.X.X)
要更正此問題,請將公用IP地址配置為具有兩個內部IP地址,並在DNS中使用兩個公用IP地址。
ARP表中沒有條目
這是對NAT條目執行 no-alias 選項的結果。 no-alias 選項表示路由器不響應這些地址,也不安裝ARP條目。如果另一台路由器使用NAT池作為內部全局池,該全局池由所連線的子網上的地址組成,則會為該地址生成別名,以便路由器能夠響應這些地址的地址解析協定(ARP)請求。這會導致路由器具有虛假地址的ARP條目。
錯誤的標籤0需要TOK_NUMBER|TOK_PUNCT
此錯誤消息只是參考性消息,對裝置的正常行為沒有任何影響。
Bad token 0, wanted TOK_NUMBER|TOK_PUNCT
此錯誤意味著NAT嘗試對FTP開放中的地址進行第4層修復,但找不到它在資料包中轉換所需的IP地址。 消息中包含令牌的原因在於透過在IP資料包中搜尋令牌或一組符號來查詢資料包中的IP地址,以便找到轉換所需的詳細資訊。
當啟動FTP會話時,它將協商兩個通道,一個命令通道和一個資料通道。這兩個IP地址具有不同的埠號。FTP使用者端和伺服器會交涉第二個資料通道,以便將檔案傳輸到。透過控制通道交換的資料包格式為「PORT,i,i,i,i,p,p」,其中i,i,i,i是IP地址的四個位元組,p,p指定埠。NAT會嘗試匹配此模式並在必要時轉換地址/埠。NAT必須轉換兩個通道方案。NAT會掃描命令流中的數字,直到它認為找到需要轉換的埠命令為止。然後解析轉換,以相同的格式進行計算。
如果資料包已損壞,或者FTP伺服器或客戶端的命令格式不正確,則NAT無法正確計算轉換並生成該錯誤。您可以將FTP客戶端設定為被動,以便其啟動兩個通道。
相關資訊