实验目的:
配置OSPFv3使AR1的与AR4互通
实验环境:
AR1-AR4均使用AR2220
实验过程:
规划拓扑:
IP地址规划:
R1
interface GigabitEthernet0/0/0 1001::1/64
interface LoopBack0 2001::1/64
R2
interface GigabitEthernet0/0/0 1001::2/64
interface GigabitEthernet0/0/1 1000::2/64
interface LoopBack0 10.1.2.2
R3
interface GigabitEthernet0/0/0 1000::3/64
interface GigabitEthernet0/0/1 1002::3/64
interface LoopBack0 10.1.3.3
R4
interface GigabitEthernet0/0/0 1002::4/64
interface LoopBack0 10.1.4.4/32
配置接口IP:
[R1]ipv6 #使能ipv6方便后续互联
[R1]interface GigabitEthernet0/0/0
[R1-GigabitEthernet0/0/0] ipv6 enable 在接口使能ipv6,否则无法配置ipv6地址
[R1-GigabitEthernet0/0/0] ipv6 address 1001::1/64
[R1-GigabitEthernet0/0/0]interface LoopBack0
[R1-LoopBack0] ipv6 address 2001::1/64
[R2]ipv6
[R2]interface GigabitEthernet0/0/0
[R2-GigabitEthernet0/0/0] ipv6 enable
[R2-GigabitEthernet0/0/0] ipv6 address 1001::2/64
[R2-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ipv6 enable
[R2-GigabitEthernet0/0/1] ipv6 address 1000::2/64
[R2-GigabitEthernet0/0/1]interface LoopBack0
[R2-LoopBack0] ip address 10.1.2.2 255.255.255.255
[R3]ipv6
[R3]interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0] ipv6 enable
[R3-GigabitEthernet0/0/0] ipv6 address 1000::3/64
[R3-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] ipv6 enable
[R3-GigabitEthernet0/0/1] ipv6 address 1002::3/64
[R3-GigabitEthernet0/0/1]interface LoopBack0
[R3-LoopBack0] ip address 10.1.3.3 255.255.255.255
[R4]ipv6
[R4]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0] ipv6 enable
[R4-GigabitEthernet0/0/0] ipv6 address 1002::4/64
[R4-GigabitEthernet0/0/0]interface LoopBack0
[R4-LoopBack0] ip address 10.1.4.4 255.255.255.255
配置OSPFv3
[R2]ospfv3 1
[R2-ospfv3-1] router-id 10.1.2.2 #router-id只是为了建立邻居使用
[R2-ospfv3-1] import-route direct
#引入直连(本实验是为了发布1001::0/64网段,也可使能g0/0/0的OSPFv3)
[R2-ospfv3-1] import-route static
#引入静态(为互连后期做铺垫)
[R2-ospfv3-1]interface GigabitEthernet0/0/1
[R2-GigabitEthernet0/0/1] ospfv3 1 area 0.0.0.0
#在接口下使能OPSFv3
[R3]ospfv3 1
[R3-ospfv3-1] router-id 10.1.3.3
[R3-ospfv3-1]interface GigabitEthernet0/0/0
[R3-GigabitEthernet0/0/0] ospfv3 1 area 0.0.0.0
[R3-GigabitEthernet0/0/0]interface GigabitEthernet0/0/1
[R3-GigabitEthernet0/0/1] ospfv3 1 area 0.0.0.1
[R4]ospfv3 1
[R4-ospfv3-1] router-id 10.1.4.4
[R4-ospfv3-1]interface GigabitEthernet0/0/0
[R4-GigabitEthernet0/0/0] ospfv3 1 area 0.0.0.1
配置静态路由
[R1]ipv6 route-static :: 0 GigabitEthernet0/0/0 1001::2
#为R1指另外两个网段的路由
[R2]ipv6 route-static 2001:: 64 GigabitEthernet0/0/0 1001::1
#为R2-R4指到R1的LoopBack0接口
实验结果:
使用R1的LoopBack0地址PING测试R4的int g0/0/0口
完整脚本
R1
sy
ipv6
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 1001::1/64
interface LoopBack0
ipv6 enable
ipv6 address 2001::1/64
ipv6 route-static :: 0 GigabitEthernet0/0/0 1001::2
R2
sy
ipv6
ospfv3 1
router-id 10.1.2.2
import-route direct
import-route static
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 1001::2/64
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 1000::2/64
ospfv3 1 area 0.0.0.0
interface LoopBack0
ip address 10.1.2.2 255.255.255.255
ipv6 route-static 2001:: 64 GigabitEthernet0/0/0 1001::1
R3
sy
ipv6
ospfv3 1
router-id 10.1.3.3
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 1000::3/64
ospfv3 1 area 0.0.0.0
interface GigabitEthernet0/0/1
ipv6 enable
ipv6 address 1002::3/64
ospfv3 1 area 0.0.0.1
interface LoopBack0
ip address 10.1.3.3 255.255.255.255
R4
sy
ipv6
ospfv3 1
router-id 10.1.4.4
interface GigabitEthernet0/0/0
ipv6 enable
ipv6 address 1002::4/64
ospfv3 1 area 0.0.0.1
interface LoopBack0
ip address 10.1.4.4 255.255.255.255