ipv6和ipv4互访的推荐方式当ipv6地址fc00:1::1需要访问ipv4地址3.3.3.1时,需要将3.3.3.1写成2001::303:301(2001是通过PRefix配置的)。这种方式只适用与ipv6端初始连接。当然在实际的运营环境中还需要做一条ipv6的static map,这个static map就是专门给ipv6 dns预备的。
R1
hostname R1
!
ipv6 unicast-routing
!
interface Loopback1
ip address 1.1.1.1 255.255.255.255
ipv6 address FC00:1::1/128
ipv6 enable
!
interface Loopback2
no ip address
ipv6 address FC00:1::2/128
ipv6 enable
!
interface Loopback3
no ip address
ipv6 address FC00:1::3/128
ipv6 enable
!
interface Ethernet1/2
no ip address
duplex full
ipv6 address FC00:12::1/32
ipv6 enable
!
ipv6 route ::/0 FC00:12::2
R2
hostname R2
!
ipv6 unicast-routing
!
interface Ethernet1/1
no ip address
duplex full
ipv6 address FC00:12::2/32
ipv6 enable
ipv6 nat
!
interface Ethernet1/3
ip address 192.168.23.2 255.255.255.0
duplex full
ipv6 nat
!
ip route 3.3.3.0 255.255.255.0 192.168.23.3
!
ipv6 route FC00:1::/32 FC00:12::1
ipv6 nat v6v4 source list listv6 pool poolv4
ipv6 nat v6v4 pool poolv4 192.168.12.1 192.168.12.254 prefix-length 24
ipv6 nat prefix 2001::/96 v4-mapped v4map
!
ipv6 access-list v4map
permit ipv6 any 2001::/96
!
ipv6 access-list listv6
permit ipv6 any 2001::/96
R3
hostname R3
!
interface Loopback1
ip address 3.3.3.1 255.255.255.255
!
interface Loopback2
ip address 3.3.3.2 255.255.255.255
!
interface Loopback3
ip address 3.3.3.3 255.255.255.255
!
interface Ethernet1/2
ip address 192.168.23.3 255.255.255.0
duplex full
!
ip route 0.0.0.0 0.0.0.0 192.168.23.2