拓扑图
IP地址分配
一共有5个OSPF区域和一个RIP区域,所以借三位
172.16.0.0/19 A0
172.16.32.0/19 A1
172.16.64.0/19 A2
172.16.96.0/19 A3
172.16.128.0/19 A4
172.16.160.0/19 RIP
然后测试一下连通性
3在Area 0上指缺省路由
[R3]ip route-static 0.0.0.0 0 34.1.1.2
[R5]ip route-static 0.0.0.0 0 45.1.1.1
[R6]ip route-static 0.0.0.0 0 46.1.1.1
[R7]ip route-static 0.0.0.0 0 47.1.1.1
4.在R3、5、6、7上做NAT配置
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
5.R3-R5/6/7为MGRE环境,R3为中心站点;
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
……
同理
**6.在ASBR路由器R12启动rip进程,将两条环回宣告进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
然后给直连路由器写上缺省路由下一跳为ISP接口IP
然后我们开始优化
首先在R3上 因为是完全末梢
[r3]ospf 1
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]stub no-summary
R1为末梢
[r1]ospf
[r1-ospf-1]area 1
[r1-ospf-1-area-0.0.0.1]stub
再给R12 R11写上NSSA
[r11]OSPF
[r11-ospf-1]area 2
[r11-ospf-1-area-0.0.0.2]nssa
[r12]OSPF
[r12-ospf-1]area 2
[r12-ospf-1-area-0.0.0.2]nssa
再给R6写上完全末梢
[r6]ospf
[r6-ospf-1]area 2
[r6-ospf-1-area-0.0.0.2]nssa no-import-route
同理在下面也做 再给R9上写OSPF 的缺省
之后给骨干路由器写上ACL 和NAT
7.减少LSA的更新
R3/5/612进行同样的操作
例:
[r3]ospf 10
[r3-ospf-10]area 1
[r3-ospf-10-area-0.0.0.1]abr-summary 172.16.32.0 255.255.255.224
R1/2/3/4
例:
[r1]ospf 10
[r1-ospf-10]area 1
[r1-ospf-10-area-0.0.0.1]stub
R3例外
例:
[r3]ospf 10
[r3-ospf-10]area 1
[r3-ospf-10-area-0.0.0.1]stub no-summary
R6例外
例:
[r6]ospf 10
[r6-ospf-10]area 2
[r6-ospf-10-area-0.0.0.2]nssa no-summary
**8.做NAT,可以访问R4的环回
**9测试结果