双栈技术产生
在IPv4 Internet向IPv6 Internet过渡的初期,IPv4网络已被大量部署,而IPv6网络只是散布在世界各地的一些孤岛。故而需要一些技术实现IPv6孤岛之间的互联以及IPv4节点和IPv6节点之间的互通。
双栈协议概念
双栈协议是指所有设备必须支持IPv4、IPv6协议栈,连接双栈网络的接口必须同时设置IPv4地址和IPv6地址。
双栈协议是所有过渡技术的基础。
双协议栈指的是IPv6节点同时完整地实现IPv4和IPv6的协议栈,它可以同时和两种节点通信。双协议栈是所有过渡技术的基础,它实现了两种协议的转换,同时在IP层实现IPv6和IPv4两种协议,不影响上下层协议模块,根据上层应用自动决定使用那一种协议地址结构。
优点:互通性好,易于理解,实现简单。
缺点:对每个IPv4节点都要升级,成本较大,没有解决IPv4地址紧缺问题。
双栈技术配置
1.IP地址与IPv6配置
在各设备及PC端配置IPv4地址和IPv6地址。
<Huawei>system-view
[Huawei]sysname AR1
[AR1]ipv6
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ipv6 enable
[AR1-GigabitEthernet0/0/0]ipv6 address 2001:1:12::1 64
[AR1-GigabitEthernet0/0/0]ip address 10.1.12.1 24
[AR1-GigabitEthernet0/0/0]quit
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ipv6 enable
[AR1-GigabitEthernet0/0/1]ipv6 address 2000:1:10::1 64
[AR1-GigabitEthernet0/0/1]ip address 192.168.1.1 24
[AR1-GigabitEthernet0/0/1]quit
[AR1]<Huawei>system-view
[Huawei]sysname AR2
[AR2]ipv6
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ipv6 enable
[AR2-GigabitEthernet0/0/0]ipv6 address 2001:1:12::2 64
[AR2-GigabitEthernet0/0/0]ip address 10.1.12.2 24
[AR2-GigabitEthernet0/0/0]quit
[AR2]interface GigabitEthernet 0/0/2
[AR2-GigabitEthernet0/0/2]ipv6 enable
[AR2-GigabitEthernet0/0/2]ipv6 address 2001:1:23::2 64
[AR2-GigabitEthernet0/0/2]ip address 10.1.23.2 24
[AR2-GigabitEthernet0/0/2]quit
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ipv6 enable
[AR2-GigabitEthernet0/0/1]ipv6 address 2001:1:23::2 64
[AR2-GigabitEthernet0/0/1]ip address 10.1.23.2 24
[AR2-GigabitEthernet0/0/1]quit
[AR2]<Huawei>system-view
[Huawei]sysname AR3
[AR3]IPv6
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ipv6 enable
[AR3-GigabitEthernet0/0/1]ipv6 address 2001:1:23::3 64
[AR3-GigabitEthernet0/0/1]ip address 10.1.23.3 24
[AR3-GigabitEthernet0/0/1]qui
[AR3]interface GigabitEthernet 0/0/2
[AR3-GigabitEthernet0/0/2]ipv6 enable
[AR3-GigabitEthernet0/0/2]ipv6 address 2000:1:20::1 64
[AR3-GigabitEthernet0/0/2]ip address 192.168.2.1 24
[AR3-GigabitEthernet0/0/2]quit
[AR3]
2.配置动态路由协议
OSPFv2版本配置。
[AR1]ospf 1 router-id 1.1.1.1
[AR1-ospf-1]area 0
[AR1-ospf-1-area-0.0.0.0]network 10.1.12.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[AR1-ospf-1-area-0.0.0.0]quit
[AR1-ospf-1][AR2]ospf 1 router-id 2.2.2.2
[AR2-ospf-1]area 0
[AR2-ospf-1-area-0.0.0.0]network 10.1.12.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]network 10.1.23.0 0.0.0.255
[AR2-ospf-1-area-0.0.0.0]quit
[AR2-ospf-1][AR3]ospf 1 router-id 3.3.3.3
[AR3-ospf-1]area 0
[AR3-ospf-1-area-0.0.0.0]network 10.1.23.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[AR3-ospf-1-area-0.0.0.0]quit
[AR3-ospf-1]
OSPFv3路由配置。
[AR1]ospfv3 1
[AR1-ospfv3-1]router-id 11.1.1.1
[AR1-ospfv3-1]quit
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]ospfv3 1 area 0
[AR1-GigabitEthernet0/0/0]quit
[AR1]interface GigabitEthernet 0/0/1
[AR1-GigabitEthernet0/0/1]ospfv3 1 area 0
[AR1-GigabitEthernet0/0/1]quit
[AR1][AR2]ospfv3 1
[AR2-ospfv3-1]router-id 22.2.2.2
[AR2-ospfv3-1]quit
[AR2]interface GigabitEthernet 0/0/0
[AR2-GigabitEthernet0/0/0]ospfv3 1 area 0
[AR2-GigabitEthernet0/0/0]quit
[AR2]interface GigabitEthernet 0/0/1
[AR2-GigabitEthernet0/0/1]ospfv3 1 area 0
[AR2-GigabitEthernet0/0/1]quit
[AR2][AR3]ospfv3 1
[AR3-ospfv3-1]router-id 33.3.3.3
[AR3-ospfv3-1]quit
[AR3]interface GigabitEthernet 0/0/1
[AR3-GigabitEthernet0/0/1]ospfv3 1 area 0
[AR3-GigabitEthernet0/0/1]quit
[AR3]interface GigabitEthernet 0/0/2
[AR3-GigabitEthernet0/0/2]ospfv3 1 area 0
[AR3-GigabitEthernet0/0/2]quit
[AR3]
3.查看路由协议邻居关系
查看OSPFv2邻居关系。
[AR2]display ospf peer brief OSPF Process 1 with Router ID 2.2.2.2Peer Statistic Information----------------------------------------------------------------------------Area Id Interface Neighbor id State 0.0.0.0 GigabitEthernet0/0/0 1.1.1.1 Full 0.0.0.0 GigabitEthernet0/0/1 3.3.3.3 Full ----------------------------------------------------------------------------
[AR2]
查看OSPFv3邻居关系。
[AR2]display ospfv3 peer
OSPFv3 Process (1)
OSPFv3 Area (0.0.0.0)
Neighbor ID Pri State Dead Time Interface Instance ID
11.1.1.1 1 Full/DR 00:00:38 GE0/0/0 0
33.3.3.3 1 Full/DR 00:00:40 GE0/0/1 0[AR2]
4.测试连通