一,实验要求
1、R4为ISP,其上只能配置IP地址;R4与其他所有直连设备间均使用公有IP。
2、R3、R5、R6、R7为MGRE环境,R3为中心站点。
3、整个OSPF环境IP地址基于172.16.0.0/16划分。
4、减少LSA的更新量,加快收敛,保证更新安全。
5、全网可达。
二,实验思路
1、根据实验要求对172.16.0.0/16网段进行子网划分。
2、对各个设备进行IP地址的配置,及环回接口的配置。
3、对R3、R5、R6、R7设备进行MGRE环境的配置,R3为中心站点,并在这四个路由器上而配置到ISP的缺省路由,实现对边界路由器的私网互通。
4、对各个路由器进行配置OSPF协议并进行宣告。
5、将域外路由通过重发布实现OSPF内可以互通。
6、对需要做特殊区域的区域做特殊区域的配置
7、对边界路由器配置NAT协议从而实现可以对公网的访问
三,对AERA0区域的设备进行IP地址及环回地址和缺省路由的配置
R3
[R3]int s 4/0/0
[R3-Serial4/0/0]ip a 34.0.0.1 24
[R3]ip route-static 0.0.0.0 0 34.0.0.2R4
[ISP]int s 4/0/0
[ISP-Serial4/0/0]ip a 34.0.0.2 24
[ISP-Serial4/0/0]int s 3/0/0
[ISP-Serial3/0/0]ip a 46.0.0.2 24
[ISP-Serial3/0/0]int s 4/0/1
[ISP-Serial4/0/1]ip a 45.0.0.2 24
[ISP-Serial4/0/1]int g0/0/0
[ISP-GigabitEthernet0/0/0]ip a 47.0.0.2 24
[ISP-GigabitEthernet0/0/0]int lo0
[ISP-LoopBack0]ip a 4.4.4.4 24R5
[R5]int s 4/0/0
[r5-Serial4/0/0]ip a 45.0.0.1 24
[R5]ip route-static 0.0.0.0 0 45.0.0.2R6
[R6]int s 4/0/0
[R6-Serial4/0/0]ip a 46.0.0.1 24
[R6]ip route-static 0.0.0.0 0 46.0.0.2R7
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip a 47.0.0.1 24
[R7]ip route-static 0.0.0.0 0 47.0.0.2
四,对R3、R5、R6、R7配置MGRE环境
R3
[R3]int t 0/0/0
[R3-Tunnel0/0/0]ip a 172.16.1.1 29
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 34.0.0.1
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry multicast dynamicR5
[R5]int t0/0/0
[R5-Tunnel0/0/0]ip a 172.16.1.2 29
[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 172.16.1.1 34.0.0.1 register[R5-Serial4/0/0]int lo0
[R5-LoopBack0]ip a 172.16.2.1 24R6
[R6]int t0/0/0
[R6-Tunnel0/0/0]ip a 172.16.1.3 29
[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 172.16.1.1 34.0.0.1 register[R6-Serial4/0/0]int lo0
[R6-LoopBack0]ip a 172.16.3.1 24R7
[R7]int t0/0/0
[R7-Tunnel0/0/0]ip a 172.16.1.4 29
[R7-Tunnel0/0/0]tunnel-protocol gre p2mp
[R7-Tunnel0/0/0]source GigabitEthernet 0/0/0
[R7-Tunnel0/0/0]nhrp network-id 100
[R7-Tunnel0/0/0]nhrp entry 172.16.1.1 34.0.0.1 register[R7-GigabitEthernet0/0/0]int lo0
[R7-LoopBack0]ip a 172.16.4.1 24
五,配置AREA1、AREA2、AREA3、AREA4的IP地址及环回接口
R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip a 172.16.33.1 29
[R1-GigabitEthernet0/0/0]int lo0
[R1-LoopBack0]ip a 172.16.34.1 24R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip a 172.16.33.2 29
[R2-GigabitEthernet0/0/0]int lo0
[R2-LoopBack0]ip a 172.16.35.1 24R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip a 172.16.33.3 29
[R3-GigabitEthernet0/0/0]int lo0
[R3-LoopBack0]ip a 172.16.36.1 24R6
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip a 172.16.65.1 29R7
[R7]int g 0/0/1
[R7-GigabitEthernet0/0/1]ip a 172.16.97.1 29R8
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip a 172.16.97.2 29
[R8-GigabitEthernet0/0/0]int lo0
[R8-LoopBack0]ip a 172.16.98.1 24
[R8-LoopBack0]int g 0/0/1
[R8-GigabitEthernet0/0/1]ip a 172.16.97.9 29R9
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ip a 172.16.97.10 29
[R9-GigabitEthernet0/0/0]int g0/0/1
[R9-GigabitEthernet0/0/1]ip a 172.16.129.1 29
[R9-GigabitEthernet0/0/1]int lo0
[R9-LoopBack0]ip a 172.16.130.1 24R10
[R10]int g0/0/0
[R10-GigabitEthernet0/0/0]ip a 172.16.129.2 29
[R10-GigabitEthernet0/0/0]int lo0
[R10-LoopBack0]ip a 172.16.131.1 24R11
[R11]int g 0/0/0
[R11-GigabitEthernet0/0/0]ip a 172.16.65.2 29
[R11-GigabitEthernet0/0/0]int lo0
[R11-LoopBack0]ip a 172.16.66.1 24
[R11-GigabitEthernet0/0/1]ip a 172.16.65.9 29R12
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ip a 172.16.65.10 29
[R12]int lo0
[R12-LoopBack0]ip a 172.16.160.1 20
[R12-LoopBack0]int lo1
[R12-LoopBack1]ip a 172.16.176.1 20
六,启动每台设备的OSPF协议
R1
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255R2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]network 172.16.0.0 0.0.255.255R3
[R3ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]network 172.16.32.0 0.0.7.255[R3-ospf-1-area-0.0.0.1]a 0
[R3-ospf-1-area-0.0.0.0]net
[R3-ospf-1-area-0.0.0.0]network 172.16.1.1 0.0.0.0R5
[R5]ospf 1 rout
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.255.255R6
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]network 172.16.0.0 0.0.3.255
[R6-ospf-1-area-0.0.0.0]a 2
[R6-ospf-1-area-0.0.0.2]network 172.16.65.1 0.0.0.0R7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 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.0]a 3
[R7-ospf-1-area-0.0.0.3]network 172.16.97.1 0.0.0.0R8
[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]network 172.16.0.0 0.0.255.255R9
[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]network 172.16.97.10 0.0.0.0
[R9ospf-1-area-0.0.0.3]a 4
[R9-ospf-1-area-0.0.0.4]network 172.16.128.0 0.0.3.255R10
[R10]ospf 1 router-id 10.10.10.10
[R10-ospf-1]a 4
[R10-ospf-1-area-0.0.0.4]network 172.16.0.0 0.0.255.255R11
[R11]ospf 1 router-id 11.11.11.11
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]network 172.16.0.0 0.0.255.255R12
[R12]ospf 1 router-id 12.12.12.12
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]network 172.16.65.10 0.0.0.0
[R12]rip 1
[R12-rip-1]v 2
[R12-rip-1]network 172.16.0.0
七,更改tunnel接口的接口类型
R3
[R3]int t0/0/0
[R3-Tunnel0/0/0]ospf network-type p2mpR5
[R5]int t0/0/0
[R5-Tunnel0/0/0]ospf network-type p2mpR6
[R6]int t0/0/0
[R6-Tunnel0/0/0]ospf network-type p2mpR7
[R7]int t0/0/0
[R7]-Tunnel0/0/0]ospf network-type p2mp
八,将AREA4更改为域外路由来减少路由信息
R9
[R9]ospf 1
[R9-ospf-1]a 4
[R9-ospf-1-area-0.0.0.4]undo network 172.16.128.0 0.0.3.255
[R9-ospf-1-area-0.0.0.4]q
[R9-ospf-1]undo a 4
[R9-ospf-1]q
[R9]ospf 2 rout
[R9]ospf 2 router-id 9.9.9.9
[R9-ospf-2]a 4
[R9-ospf-2-area-0.0.0.4]net
[R9-ospf-2-area-0.0.0.4]network 172.16.128.0 0.0.3.255
[R9]ospf 1
[R9-ospf-1]import-route ospf 2
[R9]ospf 2
[R9-ospf-2]de
[R9-ospf-2]default-route-advertise
九,在ABR的设备上做域间路由汇总以及ASBR的设备上做域外路由汇总
R3
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]abr-summary 172.16.32.0 255.255.224.0R6
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]abr-summary 172.16.64.0 255.255.224.0R7
R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]abr-summary 172.16.96.0 255.255.224.0R9
[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0R12
[R12]ospf 1
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
十,将AREA1、AREA2、AREA3做成特殊区域,来实现路由条目的减少
R1
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]stubR2
[R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]stubR3
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]stub no-summaryR6
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]nssa no-summaryR7
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]nssa no-summaryR8
[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]nssaR9
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]nssaR11
R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]nssaR12
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]nssa
查看R2路由表
十一,对ABR及ASBR做过子网汇总的路由器做空接口来进行防环
R3
[R3]ip route-static 172.16.32.0 19 NULL 0
R6
[R6]ip route-static 172.16.64.0 19 NULL 0
R7
[R7]ip route-static 172.16.96.0 19 NULL 0
R9
[R9]ip route-static 172.16.128.0 19 NULL 0
R12
[R12]ip route-static 172.16.160.0 19 NULL 0
十二,能够进行访问到公网。进行NAT协议的配置
R3[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3]int s 4/0/0
[R3-Serial4/0/0]nat outbound 2000R5
[R5]acl 2000
R5-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R5]int s4/0/0
[R5-Serial4/0/0]nat outbound 2000R6
[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6]int s 4/0/0
[R6-Serial4/0/0]nat outbound 2000R7
[R7]acl 2000
[R7-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]nat outbound 2000
十三,对AREA1进行区域认证的配置,保证更新安全
R1
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456R2
[R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456R3
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher 123456
十四、加快收敛
R3[R3]int t0/0/0
[R3-Tunnel0/0/0]ospf timer hello 10
R5
[R5]int t0/0/0
[R5-Tunnel0/0/0]ospf timer hello 10R6
[R6]int t0/0/0
[R6-Tunnel0/0/0]ospf timer hello 10R7
[R7]int t0/0/0
[R7-Tunnel0/0/0]ospf timer hello 10