-
实验要求
-
实验拓扑
-
实验流程
1.配置路由器接口IP地址
例R1
[r1-GigabitEthernet0/0/1]ip add 16.1.1.1 24
[r1-GigabitEthernet0/0/0]ip add 61.1.1.1 24
[r1-LoopBack0]ip add 192.168.1.1 24
查看结果
R1
R2
R3
R4
R5
R6
2.构建R1-R5指向R6的缺省路由
例R1
[r1]ip route-static 0.0.0.0 0 16.1.1.2
[r1]ip route-static 0.0.0.0 0 61.1.1.2
查看结果
测试
分别用R1-R5路由器来pingR6的环回6.6.6.6
3.配置R1 R2 R3 MGRE
R1
[r1]interface Tunnel 0/0/0 创建逻辑接口
[r1-Tunnel0/0/0]ip address 10.1.1.1 24 添加虚拟IP
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp 修改接口模式
[r1-Tunnel0/0/0]source 16.1.1.1 定义公有源IP
[r1-Tunnel0/0/0]nhrp entry multicast dynamic 配置为中心站点
[r1-Tunnel0/0/0]nhrp network-id 100
R2
[r2]interface Tunnel 0/0/0 创建逻辑接口
[r2-Tunnel0/0/0]ip address 10.1.1.2 24 添加虚拟IP
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp 修改接口模式
[r2-Tunnel0/0/0]source GigabitEthernet 0/0/0 分支站点IP不固定
[r2-Tunnel0/0/0]nhrp network-id 100
[r2-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register
定义为分支站点,并向R1进行注册
R3同 R2
查看结果
创建OSPF
R1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 10.1.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0
R2
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 10.1.1.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.2.1 0.0.0.0
R3
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]network 10.1.1.3 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0
修改接口的默认工作方式:
在tunnel接口上,ospf的默认工作方式为P2P,这种工作方式,只能建立一个邻居关系,故在MGRE环境中将无法正常工作;
例R1
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast
R2 R3同理
中心站点为DR,取消BDR:
R2
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
R3
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ospf dr-priority 0
修改成功重启OSPF
reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
查看结果
display ospf peer 查看邻居表
测试
使用R1-R3的环回接口相互之间ping对方的环回
4.配置 R1 R4 R5 全连MGRE
R1
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip address 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 61.1.1.1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nhrp network-id 100
R4
[r4]interface Tunnel 0/0/0
[r4-Tunnel0/0/0]ip address 10.1.2.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r4-Tunnel0/0/0]nhrp network-id 100
[r4-Tunnel0/0/0]nhrp entry 10.1.2.1 61.1.1.1 register
[r4-Tunnel0/0/0]nhrp entry multicast dynamic
R5
[r5]interface Tunnel 0/0/0
[r5-Tunnel0/0/0]ip address 10.1.2.3 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.2.1 61.1.1.1 register
[r5-Tunnel0/0/0]nhrp entry 10.1.2.2 46.1.1.1 register
修改接口的默认工作方式:
在tunnel接口上,ospf的默认工作方式为P2P,这种工作方式,只能建立一个邻居关系,故在MGRE环境中将无法正常工作;
例R1
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ospf network-type broadcast
R4 R5同理
创建OSPF
R1
[r1-ospf-1-area-0.0.0.0]network 10.1.2.1 0.0.0.0
R4
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 192.168.4.1 0.0.0.0
[r4-ospf-1-area-0.0.0.0]network 10.1.2.2 0.0.0.0
R5
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 192.168.5.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 10.1.2.3 0.0.0.0
查看结果
测试
使用R1 R4 R5的环回接口相互之间ping对方的环回