配置IP地址和环回地址,在r3 5 6 7配置一条指向r4的缺省路由
[r3]ip route-static 0.0.0.0 0.0.0.0 12.1.1.2
[r5]ip route-static 0.0.0.0 0.0.0.0 23.1.1.1
[r6]ip route-static 0.0.0.0 0.0.0.0 34.1.1.1
[r7]ip route-static 0.0.0.0 0.0.0.0 45.1.1.1
r3 5 6 7做mgre,以r3为中心
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ip add 10.1.1.1 255.255.255.0
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]source 12.1.1.1
[r3-Tunnel0/0/0]nhrp entry multicast dynamic
[r3-Tunnel0/0/0]nhrp network-id 100
[r5]int Tunnel 0/0/0
[r5-Tunnel0/0/0]ip add 10.1.1.2 255.255.255.0
[r5-Tunnel0/0/0]tunnel-protocol gre p2mp
[r5-Tunnel0/0/0]source Serial 4/0/0
[r5-Tunnel0/0/0]nhrp network-id 100
[r5-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[r6]int Tunnel 0/0/0
[r6-Tunnel0/0/0]ip add 10.1.1.3 255.255.255.0
[r6-Tunnel0/0/0]tunnel-protocol gre p2mp
[r6-Tunnel0/0/0]source Serial 4/0/0
[r6-Tunnel0/0/0]nhrp network-id 100
[r6-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[r7]int Tunnel 0/0/0
[r7-Tunnel0/0/0]ip add 10.1.1.4 255.255.255.0
[r7-Tunnel0/0/0]tunnel-protocol gre p2mp
[r7-Tunnel0/0/0]source Serial 4/0/0
[r7-Tunnel0/0/0]nhrp network-id 100
[r7-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
给各个网段宣告OSPF,并将ospf在MGRE环境下的工作模式设置成广播模式,然后人工干涉选举DR
宣告跟公网网段无关,例如R3在area0中宣告,只宣告私网,不宣告公网
[r1]ospf 1 router-id 172.16.1.1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]network 172.16.1.1 0.0.0.0
[r1-ospf-1-area-0.0.0.1]network 172.16.3.2 0.0.0.0
[r2]ospf 1 router-id 172.16.2.1
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]network 172.16.2.1 0.0.0.0
[r2-ospf-1-area-0.0.0.1]network 172.16.3.3 0.0.0.0
[r3]ospf 1 router-id 172.16.4.1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]network 172.16.3.1 0.0.0.0
[r3-ospf-1-area-0.0.0.1]network 172.16.4.1 0.0.0.0
[r5]ospf 1 router-id 172.16.5.1
[r5-ospf-1]area0
[r5-ospf-1-area-0.0.0.0]network 172.16.5.1 0.0.0.0
[r6]ospf 1 router-id 172.16.6.1
[r6-ospf-1]area 0
[r6-ospf-1-area-0.0.0.0]network 172.16.6.1 0.0.0.0
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]network 172.16.7.1 0.0.0.0
[r11]ospf 1 router-id 172.16.8.1
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]network 172.168.8.1 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 172.168.9.1 0.0.0.0
[r11-ospf-1-area-0.0.0.2]network 172.168.7.2 0.0.0.0
[r12]ospf 1 router-id 172.16.18.1
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]network 172.168.9.2 0.0.0.0
[r7]ospf 1 router-id 172.16.11.1
[r7-ospf-1]area 0
[r7-ospf-1-area-0.0.0.0]network 172.16.11.1 0.0.0.0
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.3]network 172.16.12.1 0.0.0.0
[r8]ospf 1 router-id 172.16.13.1
[r8-ospf-1]area 3
[r8-ospf-1-area-0.0.0.3]network 172.16.13.1 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 172.16.14.1 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 172.16.12.2 0.0.0.0
[r9]ospf 2 router-id 172.16.15.1
[r9-ospf-2]area 4
[r9-ospf-2-area-0.0.0.4]network 172.16.15.1 0.0.0.0
[r9-ospf-2-area-0.0.0.4]network 172.16.16.1 0.0.0.0
[r10]ospf 2 router-id 172.16.17.1
[r10-ospf-2]area 4
[r10-ospf-2-area-0.0.0.4]network 172.16.17.1 0.0.0.0
[r10-ospf-2-area-0.0.0.4]network 172.16.16.2 0.0.0.0
[r10-ospf-1]import-route ospf 2
[r10-ospf-1]q
[r10]ospf 2
[r10-ospf-2]import-route ospf 1
在ASBR路由器R12启动rip进程,将两条环回宣告进rip,再重发布 ,将不同协议产生的路由进行双向共享
[r12]rip
[r12-rip-1]version 2
[r12-rip-1]undo summary
[r12-rip-1]network 172.16.0.0
[r12-rip-1]q
[r12]ospf 1
[r12-ospf-1]import-route rip 1
[r12-ospf-1]q
[r12]rip
[r12-rip-1]import-route ospf 1
接下来优化网络,尽量减少LSA更新量
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.0.0 255.255.0.0
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.1]abr-summary 172.16.0.0 255.255.0.0
[r7]ospf 1
[r7-ospf-1]area 3
[r7-ospf-1-area-0.0.0.1]abr-summary 172.16.0.0 255.255.0.0
[r12]ospf 1
[r12-ospf-1]asbr-summary172.16.0.0 255.255.0.0
[r9]ospf 1
[r9-ospf-1]asbr-summary 172.16.0.0 255.255.0.0
将区域一设为末梢
[r1]ospf 1
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]stub
[r2]ospf 1
[r2-ospf-1]area 1
[r2-ospf-1-area-0.0.0.1]stub
[r3ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]stub
然后仅在R3上完全
[r3ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]stub no-summary
这就成了一个完全末梢区域
将区域2与区域3设置NSSA
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.1]nssa
[r11]ospf 1
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.1]nssa
[r12]ospf 1
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.1]nssa
然后仅在R6上完全NSSA
[r6]ospf 1
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.1]nssa no-summary
随后配通NAT,与公网之间全网可达,在R3,6,7上配置静态一对一NAT
完成