1. 实验目的
熟悉6to4隧道的应用场景
掌握6to4隧道的配置方法
2. 实验拓扑
实验拓扑如图所示:
想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!
3. 实验步骤
(1)配置IP地址
AR1的配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname AR1
[AR1]ipv6 //全局启用IPV6
[AR1]interface g0/0/1
[AR1-GigabitEthernet0/0/1]ipv6 address 2001::2/64
[AR1-GigabitEthernet0/0/1]quit
[AR1]interface g0/0/0
[AR1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[AR1-GigabitEthernet0/0/0]quit
AR2的配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname AR2
[AR2]interface g0/0/1
[AR2-GigabitEthernet0/0/1]ip address 12.1.1.2 24
[AR2-GigabitEthernet0/0/1]quit
[AR2]interface g0/0/0
[AR2-GigabitEthernet0/0/0]ip address 23.1.1.2 24
[AR2-GigabitEthernet0/0/0]quit
AR3的配置
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sysname AR3
[AR3]ipv6
[AR3]interface g0/0/0
[AR3-GigabitEthernet0/0/0]ipv6 enable
[AR3-GigabitEthernet0/0/0]ipv6 address 2002::2/64
[AR3-GigabitEthernet0/0/0]quit
[AR3]interface g0/0/1
[AR3-GigabitEthernet0/0/1]ip address 23.1.1.3 24
[AR3-GigabitEthernet0/0/1]quit
PC1的配置
PC1的配置如图所示:
PC2的配置
PC2的配置如图所示:
(2)运行IGP路由协议
AR1的配置
[R1]ospf router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]quit
AR2的配置
[AR2]ospf router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 12.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]quit
AR3的配置
[AR3]ospf router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]quit
(3)配置6to4的隧道
AR1的配置
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]tunnel-protocol ipv6-ipv4 //隧道协议为ipv6-ipv4
[R1-Tunnel0/0/0]source 12.1.1.1 //隧道的源为12.1.1.1
[R1-Tunnel0/0/0]destination 23.1.1.3 //隧道的目的为23.1.1.3
[R1-Tunnel0/0/0]ipv6 enable //启用IPV4
[R1-Tunnel0/0/0]ipv6 address 2022::1/64 //隧道的IPV6地址为2022::1
[R1-Tunnel0/0/0]quit
AR2的配置
[AR3]interface Tunnel 0/0/0
[AR3-Tunnel0/0/0]tunnel-protocol ipv6-ipv4
[AR3-Tunnel0/0/0]source 23.1.1.3
[AR3-Tunnel0/0/0]destination 12.1.1.1
[AR3-Tunnel0/0/0]ipv6 enable
[AR3-Tunnel0/0/0]ipv6 address 2022::3/64
[AR3-Tunnel0/0/0]quit
【技术要点】
隧道协议如果用IPV6-IPV4它只能传递IPV6的信息,如果要传传输其它数据建议使用gre
配置如下:
AR1的配置
[R1]interface Tunnel 0/0/0
[R1-Tunnel0/0/0]tunnel-protocol gre //隧道协议为gre
[R1-Tunnel0/0/0]source 12.1.1.1 //隧道的源为12.1.1.1
[R1-Tunnel0/0/0]destination 23.1.1.3 //隧道的目的为23.1.1.3
[R1-Tunnel0/0/0]ipv6 enable //启用IPV4
[R1-Tunnel0/0/0]ipv6 address 2022::1/64 //隧道的IPV6地址为2022::1
[R1-Tunnel0/0/0]quit
AR2的配置
[AR3]interface Tunnel 0/0/0
[AR3-Tunnel0/0/0]tunnel-protocol gre
[AR3-Tunnel0/0/0]source 23.1.1.3
[AR3-Tunnel0/0/0]destination 12.1.1.1
[AR3-Tunnel0/0/0]ipv6 enable
[AR3-Tunnel0/0/0]ipv6 address 2022::3/64
[AR3-Tunnel0/0/0]quit
(4)配置IPV6的静态路由
AR1的配置
[R1]ipv6 route-static 2002:: 64 2022::3 //目标的网络为2002:: 下一跳为2002::3
AR2的配置
[AR3]ipv6 route-static 2001:: 64 2022::1
想要华为数通配套实验拓扑和配置笔记的朋友们点赞+关注,评论区留下邮箱发给你!
4. 实验调试
(1)测试PC1是否可以访问PC2
PC1的配置如图所示:
(2)在AR1的接口抓包
隧道协议为ipv6-ipv4包文结构如图所示:
隧道协议为GRE的包文结构如图所示: