首先划分区域以及配置IP地址和环回地址:
r3,r5,r6,r7分别配置缺省路由:
[r3]ip route-static 0.0.0.0 0 34.0.0.2
[r5]ip route-static 0.0.0.0 0 45.0.0.2
[r6]ip route-static 0.0.0.0 0 46.0.0.2
[r7]ip route-static 0.0.0.0 0 47.0.0.2
使用其中一个ping通另一个:
MGRE环境设置:
可以使用display nhrp peer all 来查看nhrp邻居表
更改隧道接口类型:
[r3-Tunnel0/0/0]ospf network-type p2mp
[r5-Tunnel0/0/0]ospf network-type p2mp
[r6-Tunnel0/0/0]ospf network-type p2mp
[r7-Tunnel0/0/0]ospf network-type p2mp
配置OSPF和RIP
[r1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[r2-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255
[r3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255
[r3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0
[r5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255
[r6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
[r6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0
[r7-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.7.255
[r7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0
[r8-ospf-1-area-0.0.0.3]network 172.16.0.0 0.0.255.255
[r9-ospf-1-area-0.0.0.3]network 172.16.97.10 0.0.0.0
[r9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.3.255
[r10-ospf-1-area-0.0.0.4]network 172.16.0.0 0.0.255.255
[r11-ospf-1-area-0.0.0.2]network 172.16.0.0 0.0.255.255
[r12-ospf-1-area-0.0.0.2]network 172.16.65.10 0.0.0.0
[r12]rip
[r12-rip-1]v 2
[r12-rip-1]network 172.16.0.0
将rip和area 4重发布到ospf中:
在r9上ospf1中导入ospf2
减少LSA的更新量(路由汇总和特殊区域)
ospf路由汇总:
[r3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0
[r6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0
[r7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0
[r9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
[r12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
为area1、area2、area3做特殊区域
1.完全末梢区域stub
2.存在ABSA规划成完全NSSA区域,拒绝三类四类五类的路由信息,产生一个7类缺省
3.完全NSSA区域
1.[r1-ospf-1-area-0.0.0.1]stub
[r2-ospf-1-area-0.0.0.1]stub
[r3-ospf-1-area-0.0.0.1]stub no-summary
2.[r6-ospf-1-area-0.0.0.2]nssa no-summary
[r11-ospf-1-area-0.0.0.2]nssa
[r12-ospf-1-area-0.0.0.2]nssa
3.[r7-ospf-1-area-0.0.0.3]nssa no-summary
[r8-ospf-1-area-0.0.0.3]nssa
[r9-ospf-1-area-0.0.0.3]nssa
设置接口防环:
[r3]ip route-static 172.16.32.0 19 NULL 0
[r6]ip route-static 172.16.64.0 19 NULL 0
[r7]ip route-static 172.16.96.0 19 NULL 0
[r9]ip route-static 172.16.128.0 19 NULL 0
[r12]ip route-static 172.16.160.0 19 NULL 0
所有设备均可访问R4的环回,则需要配置NAT:
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r3-acl-basic-2000]q
[r3]int Serial 4/0/0
[r3-Serial4/0/0]nat outbound 2000
[r6]acl 2000
[r6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r6-acl-basic-2000]q
[r6]int Serial 4/0/0
[r6-Serial4/0/0]nat outbound 2000
[r7]acl 2000
[r7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[r7-acl-basic-2000]q
[r7]int GigabitEthernet 0/0/0
[r7-GigabitEthernet0/0/0]nat outbound 2000
即全网可达,其中一个测试:
加快收敛速度:
[r3]int Tunnel 0/0/0
[r3-Tunnel0/0/0]ospf timer hello 10
[r5]int t 0/0/0
[r5-Tunnel0/0/0]ospf timer hello 10
[r6]int t 0/0/0
[r6-Tunnel0/0/0]ospf timer hello 10
[r7]int t 0/0/0
[r7-Tunnel0/0/0]ospf timer hello 10
保障更新安全,即做认证:
[r1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
[r3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r5-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r6-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r6-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123456
[r7-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
[r7-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
[r8-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
[r9-ospf-1-area-0.0.0.3]authentication-mode md5 1 cipher 123456
[r9-ospf-2-area-0.0.0.4]authentication-mode md5 1 cipher 123456
[r10-ospf-1-area-0.0.0.4]authentication-mode md5 1 cipher 123456
[r11-ospf-1-area-0.0.0.2]authentication-mode md5 1 cipher 123456
[r12-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456