思路:
PC1访问PC2时,会先构造源ipv6为2001:1::2,目的IPV6为2001:2::2的ipv6报文,然后查看PC1的路由表,发送到R1,r1接收后,以目的IPV6地址2001:2::2查询IPV6路由表,出接口为tun0/0/0接口,报文进入tunnel0/0/0进行处理,tun0/0/0接口为隧道gre类型,源地址100.0.0.2至目的地址200.0.0.2,随后将ipv6报文封装到gre再封装到IPV4报文中,新的IPV4头源地址为100.0.0.2,目的地址为200.0.0.2,在r1设备上查询ipv4路由转发到R3,R3收到后发现目的是ipv4自己,进行解封装,读取gre报头,协议类型为0X86DD,继续解封装交给IPV6模块,再查询ipv6路由表进行转发至pc2
R1
ipv6
interface GigabitEthernet0/0/0
ip address 100.0.0.2 255.255.255.252
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2001:1::1/64
interface GigabitEthernet0/0/2
interface NULL0
interface Tunnel0/0/0
ipv6 enable
ipv6 address 2001:12::1/64 //这个地址可以不用配置
tunnel-protocol gre //隧道方式
source 100.0.0.2 //这里的公网地址必须配置
destination 200.0.0.2 //这里的公网地址必须配置
ip route-static 0.0.0.0 0.0.0.0 100.0.0.1
ipv6 route-static 2001:2:: 64 Tunnel0/0/0 //把ipv6引入到隧道
R2
interface GigabitEthernet0/0/0
ip address 100.0.0.1 255.255.255.252
interface GigabitEthernet0/0/1
ip address 200.0.0.1 255.255.255.252
R3
ipv6
interface GigabitEthernet0/0/0
ip address 200.0.0.2 255.255.255.252
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 2001:2::1/64
interface GigabitEthernet0/0/2
interface Tunnel0/0/0
ipv6 enable
ipv6 address 2001:12::2/64
tunnel-protocol gre
source 200.0.0.2
destination 100.0.0.2
ip route-static 0.0.0.0 0.0.0.0 200.0.0.1
ipv6 route-static 2001:1:: 64 Tunnel0/0/0