实验需求:
实验拓扑:
实验分析:先配置ip地址,通物理链路,在分别建立GMRE结构,然后起ospf协议,接口工作类型冲突,修改接口工作方式
实验配置:
R1:
[r1]int LoopBack 0
[r1-LoopBack0]ip add 192.168.1.1 24
[r1-LoopBack0]q
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 16.1.1.1 24
[r1-GigabitEthernet0/0/1]int g0/0/2
[r1-GigabitEthernet0/0/2]ip add 16.1.2.1 24
[r1]ip route-static 0.0.0.0 0 16.1.1.2
[r1]ip route-static 0.0.0.0 0 16.1.2.2
Tunnel网段1配置:
设置中心站点
[r1]int Tunnel0/0/0
[r1-Tunnel0/0/0]ip add 10.1.1.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]source 16.1.1.1
[r1-Tunnel0/0/0]nhrp entry multicast dynamic
[r1-Tunnel0/0/0]nhrp network-id 100
手工注册
[r1-Tunnel0/0/0]nhrp entry 10.1.1.2 46.1.1.1 register
[r1-Tunnel0/0/0]nhrp entry 10.1.1.3 56.1.1.1 register
Tunnel网段2配置:
[r1]int t0/0/1
[r1-Tunnel0/0/1]ip add 10.1.2.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 16.1.2.1
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r1-Tunnel0/0/1]nhrp network-id 200
启OSPF服务:
[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.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]q
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 10.1.2.0 0.0.0.255
修改接口工作方式为广播
[r1-Tunnel0/0/0]ospf network-type broadcast
R2:
[r2]int LoopBack 0
[r2-LoopBack0]ip add 192.168.2.1 24
[r2-LoopBack0]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 26.1.1.1 24
[r2]ip route-static 0.0.0.0 0 26.1.1.2
分支站点配置
[r2]int t0/0/0
[r2-Tunnel0/0/0]ip add 10.1.2.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]sou
[r2-Tunnel0/0/0]source g0/0/0
[r2-Tunnel0/0/0]nhrp network-id 200
[r2-Tunnel0/0/0]nhrp entry 10.1.2.1 16.1.2.1 register
启ospf服务:
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 10.1.2.0 0.0.0.255
[r2-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255
修改接口工作方式为广播
[r2-Tunnel0/0/0]ospf network-type broadcast
R3:
[r3]int l0
[r3-LoopBack0]ip add 192.168.3.1 24
[r3-LoopBack0]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 36.1.1.1 24
[r3]ip route-static 0.0.0.0 0 36.1.1.2
分支站点配置
[r3]int t0/0/0
[r3-Tunnel0/0/0]ip add 10.1.2.3 24
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source g0/0/0
[r3-Tunnel0/0/0]nhrp network-id 200
[r3-Tunnel0/0/0]nhrp entry 10.1.2.1 16.1.2.1 register
启ospf服务:
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 10.1.2.0 0.0.0.255
[r3-ospf-1-area-0.0.0.1]network 192.168.3.0 0.0.0.255
修改接口工作方式为广播
[r3-Tunnel0/0/0]ospf network-type broadcast
R4:
[r4]int l0
[r4-LoopBack0]ip add 192.168.4.1 24
[r4-LoopBack0]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 46.1.1.1 24
[r4]ip route-static 0.0.0.0 0 46.1.1.2
设置中心站点
[r4]int Tunnel 0/0/0
[r4-Tunnel0/0/0]ip add 10.1.1.2 24
[r4-Tunnel0/0/0]tunnel-protocol gre p2mp
[r4-Tunnel0/0/0]source 46.1.1.1
[r4-Tunnel0/0/0]nhrp entry multicast dynamic
[r4-Tunnel0/0/0]nhrp network-id 100
手工注册
[r4-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1
[r4-Tunnel0/0/0]nhrp entry 10.1.1.3 56.1.1.1
启ospf服务
[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.0 0.0.0.255
[r4-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
修改接口工作方式为广播
[r4-Tunnel0/0/0]ospf network-type broadcast
R5:
[r5]int l0
[r5-LoopBack0]ip add 192.168.5.1 24
[r5-LoopBack0]int g0/0/0
[r5-GigabitEthernet0/0/0]ip add 56.1.1.1 24
[r5]ip route-static 0.0.0.0 0 56.1.1.2
设置中心站点
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ip add 10.1.1.3 24
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source 56.1.1.1
[r5-Tunnel0/0/0]nhrp entry multicast dynamic
[r5-Tunnel0/0/0]nhrp network-id 100
手工注册
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 16.1.1.1 register
[r5-Tunnel0/0/0]nhrp entry 10.1.1.2 46.1.1.1 register
启ospf服务:
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]area 0
[r5-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[r5-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
修改接口工作方式为广播
[r2-Tunnel0/0/0]ospf network-type broadcast
R6:
[ISP]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip add 16.1.1.2 24
[ISP-GigabitEthernet0/0/0]int g0/0/1
[ISP-GigabitEthernet0/0/1]ip add 16.1.2.2 24
[ISP-GigabitEthernet0/0/1]int g0/0/2
[ISP-GigabitEthernet0/0/2]ip add 56.1.1.2 24
[ISP-GigabitEthernet0/0/2]int g2/0/0
[ISP-GigabitEthernet2/0/0] ip add 26.1.1.2 24
[ISP-GigabitEthernet2/0/0]
[ISP-GigabitEthernet2/0/0]int g3/0/0
[ISP-GigabitEthernet3/0/0]ip add 36.1.1.2 24
[ISP-GigabitEthernet3/0/0]int g4/0/0
[ISP-GigabitEthernet4/0/0]ip add 46.1.1.2 24
[ISP]int LoopBack 0
[ISP-LoopBack0]ip add 6.6.6.6 24
实验验证: