实验拓扑
实验要求:
1、左边三台设备配置OSPF 10,区域0;
2、右边为OSPF 1 中间是Area0,下挂Area1和Area2;
3、两个进程之间有ISP设备,需要访问公网。
4、OSPF 1区域零中,中心设备不启动动态路由协议,配置MGRE。
实验分析:
首先分配IP地址。
在左边启动OSPF,并宣告,配置R3指向ISP的缺省,并下放缺省,配置NAT
在右边,先配置MGRE环境,配置mgre环境之间的路由,然后再将各路由器(除R7)启动OSPF,在r5上配置指向ISP的缺省,并下放,在R5上配置NAT
在R3和R5之间配置VPN,并选择配置左右两边需要通信的路由。
实验配置
IP配置按图上所示
在左侧区域启动OSPF
在R3配置缺省并下放
在R3上配置NAT
在R6、R8、R10、R12上配置MGRE环境
修改tunnel接口的网络类型为broadcast或者p2mp。broadcast需要进行DR和BDR的选举,hello时间为10S,P2MP不需要进行DR和BDR选举,hello时间为30S。MGRE环境下,broadcast可以能因为DR和BDR身份认知不同,导致缺失路由,所以选择P2MP,并将hello时间改回10S。
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source 192.168.4.2
[r6-Tunnel0/0/0]nhrp entry multicast dynamic
[r6-Tunnel0/0/0]ospf network-type p2mp
[r6-Tunnel0/0/0]ospf timer hello 10
[r8-Tunnel0/0/0]tunnel-protocol gre p2mp
[r8-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r8-Tunnel0/0/0]nhrp entry 192.168.16.1 192.168.4.1 register
[r8-Tunnel0/0/0]ospf network-type p2mp
[r8-Tunnel0/0/0]ospf timer hello 10
[r10-Tunnel0/0/0]tunnel-protocol gre p2mp
[r10-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r10-Tunnel0/0/0]nhrp entry 192.168.16.1 192.168.4.1 register
[r10-Tunnel0/0/0]ospf network-type p2mp
[r8-Tunnel0/0/0]ospf timer hello 10
[r12-Tunnel0/0/0]tunnel-protocol gre p2mp
[r12-Tunnel0/0/0]source GigabitEthernet 0/0/0
[r12-Tunnel0/0/0]nhrp entry 192.168.16.1 192.168.4.1 register
[r12-Tunnel0/0/0]ospf network-type p2mp
[r12-Tunnel0/0/0]ospf timer hello 10
因为需要在边界下放缺省,所以MGRE之间的路由选择使用静态。
在各路由器上启动OSPF
在R5上配置指向ISP的缺省,并下放
在R5上配置NAT
在R3和R5上配置VPN
[r3-Tunnel0/0/0]ip add 192.168.15.1 24
[r3-Tunnel0/0/0]tunnel-protocol gre
[r3-Tunnel0/0/0]source 4.4.1.1
[r3-Tunnel0/0/0]destination 4.4.2.2
[r5-Tunnel0/0/0]ip add 192.168.15.2 24
[r5-Tunnel0/0/0]tunnel-protocol gre
[r5-Tunnel0/0/0]source 4.4.2.2
[r5-Tunnel0/0/0]destination 4.4.1.2
最后选择需要开放的配置静态路由,下一跳写VPN隧道。