1.6 over 4
拓补图
1.配置IP地址
[R1]ipv6
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ipv6 enable
[R1-GigabitEthernet0/0/1]ipv6 add fc00::254 64
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R2]ipv6
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ipv6 enable
[R2-GigabitEthernet0/0/1]ipv6 add fc01::254 64
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
2.新建虚拟隧道
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]tunnel-protocol ipv6-ipv4
[R1-Tunnel0/0/0]source g0/0/0
[R1-Tunnel0/0/0]destination 10.1.1.2
[R1-Tunnel0/0/0]ipv6 enable
[R1-Tunnel0/0/0]ipv6 add 2000::1 64
[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]tunnel-protocol ipv6-ipv4
[R2-Tunnel0/0/0]source g0/0/0
[R2-Tunnel0/0/0]destination 10.1.1.1
[R2-Tunnel0/0/0]ipv6 add 2000::2 64
3.配置静态路由
[R1]ipv6 route-static FC01:: 64 Tunnel0/0/0
[R2]ipv6 route-static FC00:: 64 Tunnel0/0/0
验证结果
查看抓包(发现有两层IP地址)
2.6 to 4
拓补图
1.配置IP地址
[R1]ipv6
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ipv6 enable
[R1-GigabitEthernet0/0/1]ipv6 add fc00::254 64
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R2]ipv6
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ipv6 enable
[R2-GigabitEthernet0/0/1]ipv6 add fc01::254 64
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 10.1.1.2 24
2.新建虚拟隧道
[R1]int Tunnel 0/0/0
[R1-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4
[R1-Tunnel0/0/0]source g0/0/0
[R1-Tunnel0/0/0]ipv6 enable
[R1-Tunnel0/0/0]ipv6 add 2002:a01:101::1 64
[R2]int Tunnel 0/0/0
[R2-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4
[R2-Tunnel0/0/0]source g0/0/0
[R2-Tunnel0/0/0]ipv6 add 2002:a01:102::1 64
3.配置静态路由
[R1]ipv6 route-static fc01:: 64 2002:a01:102::1
[R1]ipv6 route-static 2002:: 16 Tunnel 0/0/0
[R2]ipv6 route-static fc00:: 64 2002:a01:101::1
[R2]ipv6 route-static 2002:: 16 Tunnel 0/0/0
验证效果:
2.1:多增加一个站点的配置
拓补图
1.配置IP地址
[R2]int g0/0/2
[R2-GigabitEthernet0/0/2]ip add 10.1.12.2 24
[R3]ipv6
[R3]int g0/0/0
[R3-GigabitEthernet0/0/1]ipv6 add fc02::254 64
2.实现R1和R3之间的通信
[R1]ip route-static 10.1.12.0 24 10.1.1.2
[R3]ip route-static 10.1.1.0 24 10.1.12.2
3.新建虚拟通道
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 6to4[R3-Tunnel0/0/0]ipv6 enable
[R3-Tunnel0/0/0]ipv6 add 2002:a01:c03::1 64
4.建立静态路由
[R1]ipv6 route-static fc02:: 64 2002:a01:c03::1
[R2]ipv6 route-static fc02:: 64 2002:a01:c03::1
[R3]ipv6 route-static fc00:: 64 2002:a01:101::1
[R3]ipv6 route-static fc01:: 64 2002:a01:102::1
[R3]ipv6 route-static 2002:: 16 Tunnel 0/0/0
验证效果: