ネットワーク備忘録

アラフォーエンジニアのネットワーク系の備忘録。twitter:@deigo25374582

CiscoのIPv6⇔IPv4のNAT検証 NAT-PT

普通のIPv4でのNATは経験あるけど、IPv6IPv4のNATについては未経験だったのでちょっと勉強

 

<構成>

     f:id:klock_3rd:20160313205947p:plain

必要そうなConfigのみ記載

なお、機器は全てCisco 1812J

  

 <R1>

 interface FastEthernet0
ip address 192.168.30.9 255.255.255.0
duplex auto
speed auto

ip route 0.0.0.0 0.0.0.0 192.168.30.10

 

 <R2>

no ip cef
ipv6 unicast-routing
no ipv6 cef
!

interface FastEthernet0
ip address 192.168.30.10 255.255.255.0
duplex auto
speed auto
ipv6 enable
ipv6 nat
!
interface FastEthernet1
no ip address
duplex auto
speed auto
ipv6 address 2001:DB8:3002::9/64
ipv6 enable
!

ipv6 route ::/0 2001:DB8:3002::10
ipv6 nat v4v6 source 192.168.30.9 2000::960B:202
ipv6 nat v6v4 source 3001:11:0:1::1 150.11.3.1
ipv6 nat prefix 2000::/96

  

<R3>

interface Loopback0
no ip address
ipv6 address 3001:11:0:1::1/64 
!
interface FastEthernet1

no ip address
duplex auto
speed auto
ipv6 address 2001:DB8:3002::10/64

 

ipv6 route ::/0 2001:DB8:3002::9

 

この状態で、R1のFa0から、150.11.3.1(R3のLoopback 0)へPingを実行

R1#ping 150.11.3.1 source fa0 repeat 50

→OK

今度は逆にR3のloopbakから、2000::960B:202(R1のFa0)へPingを実行

R3#ping 2000::960B:202 source loop0 repeat 50

→OK

 

注意点としてはNAT-PTを実装するルータではCEFを無効化する必要がある

でないと、パケットDropが発生するっぽい。

 

※R2で「ip cef 」、「ipv6 cef」を有効化した場合

R3#ping 2000::960B:202 source loop0 repeat 10
Type escape sequence to abort.
Sending 10, 100-byte ICMP Echos to 2000::960B:202, timeout is 2 seconds:
Packet sent with a source address of 3001:11:0:1::1
!.!.!.!.!.
Success rate is 50 percent (5/10), round-trip min/avg/max = 0/0/4 ms

 

R1#ping 150.11.3.1 source fa0 repeat 10
Type escape sequence to abort.
Sending 10, 100-byte ICMP Echos to 150.11.3.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.30.9
!.!.!.!.!.
Success rate is 50 percent (5/10), round-trip min/avg/max = 1/1/4 ms
R1#

 

2回に一回は応答がない状況。 調べると、VRFなどの使用も制限されちるっぽいのでNAT-PTを使う際は要注意