R1:
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
ipv6 address 12::1/64
!
ipv6 route ::/0 12::2
R2:
ipv6 unicast-routing
!
interface Loopback0
ip address 10.1.1.2 255.255.255.255
!
interface Tunnel0
no ip address
no ip redirects
ipv6 address 2002:CA01:101::/128 //第一个16位使用6to4隧道保留IP地址2002::/16,第二和三个16位使用的是tunnel souce地址202.1.1.1转换成十六进制
tunnel source FastEthernet1/0
tunnel mode ipv6ip 6to4
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
ipv6 address 12::2/64
!
interface FastEthernet1/0
ip address 202.1.1.1 255.255.255.0
duplex auto
speed auto
!
ip route 0.0.0.0 0.0.0.0 202.1.1.254
!
ipv6 route 45::/64 Tunnel0 2002:4001:101:: //路由器发现目标IP地址为45::/64查找下一跳2002:4001:101::
ipv6 route 2002::/16 Tunnel0 //路由器发现2002::/16的下一跳为tunnel0接口,到达tunnel接口,因为是6to4隧道,隧道自动把第二和三个16位转换成IPv4地址封装进一个IPv4包头发送出去
R3:
interface FastEthernet0/0
ip address 202.1.1.254 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 64.1.1.254 255.255.255.0
duplex auto
speed auto
R4:
ipv6 unicast-routing
!
interface Loopback0
ip address 10.1.1.4 255.255.255.255
!
interface Tunnel0
no ip address
no ip redirects
ipv6 address 2002:4001:101::/128
tunnel source FastEthernet0/0
tunnel mode ipv6ip 6to4
!
interface FastEthernet0/0
ip address 64.1.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet1/0
no ip address
duplex auto
speed auto
ipv6 address 45::4/64
!
ip route 0.0.0.0 0.0.0.0 64.1.1.254
!
ipv6 route 12::/64 Tunnel0 2002:CA01:101::
ipv6 route 2002::/16 Tunnel0
R5:
ipv6 unicast-routing
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
ipv6 address 45::5/64
!
ipv6 route ::/0 45::4
R1PING通R5
经过tunnel口
本文出自 “forest” 博客,转载请与作者联系!