1. 問題の概要
設定例) ip nat outside source static 10.10.10.10 10.1.1.3 add-route
上記のように add-route option を設定すると、指定した NAT に応じた static route が動的に作成され、
ルーティングテーブルにインストールされますが、Overlapping Network では、期待通りにstatic route
がインストールされない事例が報告されております。
2. Topology

3. Routerの設定
R1(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2
R3(config)#ip route 0.0.0.0 0.0.0.0 10.2.2.1
NAT_Router の設定
interface Ethernet0/0
ip nat inside
!
interface Ethernet1/0
ip nat outside
!
ip nat outside source static 10.10.10.10 10.1.1.3 add-route
!
ip route 0.0.0.0 0.0.0.0 10.2.2.2
4. 問題発生時のログ
R1からOutside local(10.1.1.3) へPingを実施し、”debug ip icmp” 、”debug ip nat” で出力をみます。
R1#ping 10.1.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms
“debug ip nat” の出力はなく、R1 にecho reply が送られています。
これは、NAT outside local address 等がRouting Table にてLocal route として学習されるため、NAT Router
がこのアドレスに応答しているためです。
(参照) NAT address が Local Route として学習され通信が出来ない問題への対処
https://supportforums.cisco.com/ja/document/12228571?rate=ENhBeSAF8HAlisRkGHO9iOr_7Pv1-auAnLMw1ZXLRlI
NAT_Router#
*Jun 30 13:03:15.327: ICMP: echo reply sent, src 10.1.1.3, dst 10.1.1.1, topology BASE, dscp 0 topoid 0
*Jun 30 13:03:15.331: ICMP: echo reply sent, src 10.1.1.3, dst 10.1.1.1, topology BASE, dscp 0 topoid 0
*Jun 30 13:03:15.335: ICMP: echo reply sent, src 10.1.1.3, dst 10.1.1.1, topology BASE, dscp 0 topoid 0
*Jun 30 13:03:15.335: ICMP: echo reply sent, src 10.1.1.3, dst 10.1.1.1, topology BASE, dscp 0 topoid 0
*Jun 30 13:03:15.340: ICMP: echo reply sent, src 10.1.1.3, dst 10.1.1.1, topology BASE, dscp 0 topoid 0
NAT_Router#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
--- --- --- 10.1.1.3 10.10.10.10
NAT_Router#sh ip aliases
Address Type IP Address Port
Interface 10.1.1.2
Dynamic 10.1.1.3
Interface 10.2.2.1
NAT_Router のルーティングテーブルを確認します。Outside Global (10.10.10.10) のStatic routeが作られていません。
NAT_Router#sh ip route
(snip)
Gateway of last resort is 10.2.2.2 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.2.2.2
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/0
L 10.1.1.2/32 is directly connected, Ethernet0/0
C 10.2.2.0/24 is directly connected, Ethernet1/0
L 10.2.2.1/32 is directly connected, Ethernet1/0
NAT_Router#sh ip route 10.10.10.10
% Subnet not in table
ip nat outside source static 10.10.10.10 10.1.1.3 no-alias add-routeに変更した場合も、Outside Global
(10.10.10.10) のStatic routeは作られません。
NAT_Router#sh ip route
(snip)
Gateway of last resort is 10.2.2.2 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.2.2.2
10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/0
L 10.1.1.2/32 is directly connected, Ethernet0/0
C 10.2.2.0/24 is directly connected, Ethernet1/0
L 10.2.2.1/32 is directly connected, Ethernet1/0
NAT_Router#sh ip route 10.10.10.10
% Subnet not in table
5. 問題の原因
Outside NATの場合、add-route オプションを設定したとき、outside local address のための、static routeを追加しようとします。しかし、10.1.1.3/32とoutside global address の10.10.10.10がdefault routeは循環参照できないため、Static Routeのインストールに失敗します。
*Jun 30 13:13:33.532: IP NAT: Trying to add a static route for 10.1.1.3
*Jun 30 13:13:33.532: ipnat_add_static_cfg: id 11, flag 6
*Jun 30 13:13:33.532: id 11, flags 0, domain 1, lookup 1, from_addr A0A0A0A, from_mask FFFFFFFF, from_port 0, to_addr A010103, to_port 0 to_mask FFFFFFFF, proto 0
*Jun 30 13:13:33.536: NAT: installing alias for address 10.1.1.3, addr_flags 0x22
*Jun 30 13:13:33.536: IP-ST(default): updating same distance on 10.1.1.3/32
*Jun 30 13:13:33.536: IP-ST(default): 10.1.1.3/32 [1], 10.10.10.10 Path = 8, no change, not active state
*Jun 30 13:13:33.536: IP-ST(default): NOT deleted
*Jun 30 13:13:33.536: IP-ST(default):updating same distance on 10.1.1.3/32
*Jun 30 13:13:33.536: IP-ST(default): 10.1.1.3/32 [1], 10.10.10.10 Path = 8, no change, not active state
*Jun 30 13:13:33.536: IP-ST(default): ipstatic_process_nexthop_internal() on 10.10.10.10 total 1 count, elapsed 0 ms
6. Troubleshooting
outside global address のルートを追加します。
NAT_Router(config)#ip route 10.10.10.10 255.255.255.255 10.2.2.2
Add-route により、outside local address のstatic route が作成されます。
NAT_Router#sh ip route
(snip)
Gateway of last resort is 10.2.2.2 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.2.2.2
10.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/0
L 10.1.1.2/32 is directly connected, Ethernet0/0
S 10.1.1.3/32 [1/0] via 10.10.10.10
C 10.2.2.0/24 is directly connected, Ethernet1/0
L 10.2.2.1/32 is directly connected, Ethernet1/0
S 10.10.10.10/32 [1/0] via 10.2.2.2
再び、R1からOutside local(10.1.1.3) へPingを実施し、”debug ip icmp” 、”debug ip nat”、”show ip nat translations”
で出力をみます。NAT が成功していることがわかります。
*Jun 30 13:18:21.917: NAT: s=10.1.1.1, d=10.1.1.3->10.10.10.10 [55]
*Jun 30 13:18:21.917: NAT*: s=10.10.10.10->10.1.1.3, d=10.1.1.1 [55]
*Jun 30 13:18:21.921: NAT: s=10.1.1.1, d=10.1.1.3->10.10.10.10 [56]
*Jun 30 13:18:21.921: NAT*: s=10.10.10.10->10.1.1.3, d=10.1.1.1 [56]
*Jun 30 13:18:21.922: NAT: s=10.1.1.1, d=10.1.1.3->10.10.10.10 [57]
*Jun 30 13:18:21.922: NAT*: s=10.10.10.10->10.1.1.3, d=10.1.1.1 [57]
*Jun 30 13:18:21.922: NAT: s=10.1.1.1, d=10.1.1.3->10.10.10.10 [58]
*Jun 30 13:18:21.922: NAT*: s=10.10.10.10->10.1.1.3, d=10.1.1.1 [58]
*Jun 30 13:18:21.922: NAT: s=10.1.1.1, d=10.1.1.3->10.10.10.10 [59]
NAT_Router#sh ip nat translations
Pro Inside global Inside local Outside local Outside global
--- --- --- 10.1.1.3 10.10.10.10
icmp 10.1.1.1:10 10.1.1.1:10 10.1.1.3:10 10.10.10.10:10