实验要求
1.R4为ISP,其上只配置IP地址;R4与其他所直连设备间均使用公有IP;
2.R3-R5、R6、R7为MGRE环境,R3为中心站点;
3.整个OSPF环境IP基于172.16.0.0/16划分;除了R12有两个环回,其他路由器均有一个环回IP;
4.所有设备均可访问R4的环回;
5.减少LSA的更新量,加快收敛,保障更新安全;
6.全网可达。
实验思路
1.配置IP地址。
2.配置公网静态路由。
3.配置私网OSPF协议。
4.配置MGRE。
5.配置ACL。
6.配置路由聚合和收敛。
7.配置OSPF路由的安全保障。
8.检查。
实验步骤
一
AR1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 172.16.33.1 24
[R1]int l0
[R1-LoopBack0]ip add 172.16.34.1 24
AR2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip add 172.16.33.2 24
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip add 172.16.35.2 24
AR3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip add 172.16.33.3 24
[R3-GigabitEthernet0/0/0]int s4/0/0
[R3-Serial4/0/0]ip add 34.0.0.3 24
[R3-Serial4/0/0]int l0
[R3-LoopBack0]ip add 172.16.36.3 24
AR4
[AR 2220 ISP NO.4]int s4/0/0
[AR 2220 ISP NO.4-Serial4/0/0]ip add 34.0.0.4 24
[AR 2220 ISP NO.4-Serial4/0/0]int s4/0/1
[AR 2220 ISP NO.4-Serial4/0/1]ip add 45.0.0.4 24
[AR 2220 ISP NO.4-Serial4/0/1]int s3/0/0
[AR 2220 ISP NO.4-Serial3/0/0]ip add 46.0.0.4 24
[AR 2220 ISP NO.4-Serial3/0/0]int g0/0/0
[AR 2220 ISP NO.4-GigabitEthernet0/0/0]ip add 47.0.0.4 24
[AR 2220 ISP NO.4-GigabitEthernet0/0/0]int l0
[AR 2220 ISP NO.4-LoopBack0]ip add 4.4.4.4 24
AR5
[R5]int s4/0/0
[R5-Serial4/0/0]ip add 45.0.0.5 24
[R5-Serial4/0/0]int l0
[R5-LoopBack0]ip add 172.16.3.5 24
[R5-LoopBack0]quit
AR6
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 172.16.65.1 30
[R6-GigabitEthernet0/0/0]int s4/0/0
[R6-Serial4/0/0]ip add 46.0.0.6 24
[R5-Serial4/0/0]int l0
[R6-LoopBack0]ip add 172.16.4.6 24
AR7
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 47.0.0.7 24
[R7-GigabitEthernet0/0/0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 172.16.97.1 30
[R7-GigabitEthernet0/0/1]int l0
[R7-LoopBack0]ip add 172.16.5.7 24
AR8
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip add 172.16.97.2 30
[R8-GigabitEthernet0/0/0]int g0/0/1
[R8-GigabitEthernet0/0/1]ip add 172.16.97.5 30
[R8-GigabitEthernet0/0/1]int l0
[R8-LoopBack0]ip add 172.16.98.8 24
AR9
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ip add 172.16.97.6 30
[R9-GigabitEthernet0/0/0]int g0/0/1
[R9-GigabitEthernet0/0/1]ip add 172.16.129.1 30
[R9-GigabitEthernet0/0/1]int l0
[R9-LoopBack0]ip add 172.16.130.9 24
AR10
[R10]int g0/0/0
[R10-GigabitEthernet0/0/0]ip add 172.16.129.2 30
[R10-GigabitEthernet0/0/0]int l0
[R10-LoopBack0]ip add 172.16.131.10 24
R11
[R11]int g0/0/0
[R11-GigabitEthernet0/0/0]ip add 172.16.65.2 30
[R11-GigabitEthernet0/0/0]int g0/0/1
[R11-GigabitEthernet0/0/1]ip add 172.16.65.5 30
[R11-GigabitEthernet0/0/1]int l0
[R11-LoopBack0]ip add 172.16.66.11 24
AR12
[R12]int g0/0/0
[R12-GigabitEthernet0/0/0]ip add 172.16.65.6 30
[R12-GigabitEthernet0/0/0]int l0
[R12-LoopBack0]ip add 172.16.160.12 24
[R12-LoopBack0]int l1
[R12-LoopBack1]ip add 172.16.161.12 24
二
AR3
[R3]ip route-static 0.0.0.0 0 34.0.0.4
AR5
[R5]ip route-static 0.0.0.0 0 45.0.0.4
AR6
[R6]ip route-static 0.0.0.0 0 46.0.0.4
AR7
[R7]ip route-static 0.0.0.0 0 47.0.0.4
三
AR1
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]ne 0.0.0.0 255.255.255.255
AR2
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]ne 0.0.0.0 255.255.255.255
AR3
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]ne 172.16.33.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]ne 172.16.36.0 0.0.0.255
[R3]dis ospf peer b
AR6
[R6]ospf 1 router-id 6.6.6.6
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]ne 172.16.4.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]a 2
[R6-ospf-1-area-0.0.0.2]ne 172.16.65.1 0.0.0.0
AR7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]ne 172.16.5.0 0.0.0.255
[R7-ospf-1-area-0.0.0.0]a 3
[R7-ospf-1-area-0.0.0.3]ne 172.16.97.1 0.0.0.0
AR8
[R8]ospf 1 router-id 8.8.8.8
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]ne 0.0.0.0 255.255.255.255
AR9
[R9]ospf 1 router-id 9.9.9.9
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]ne 172.16.96.0 0.0.31.255
[R9]ospf 2 router-id 9.9.9.9
[R9-ospf-2]a 4
[R9-ospf-2-area-0.0.0.4]ne 172.16.128.0 0.0.31.255
AR10
[R10]ospf 2 router-id 10.10.10.10
[R10-ospf-2]a 4
[R10-ospf-2-area-0.0.0.4]ne 172.16.128.0 0.0.31.255
R11
[R11]ospf 1 router-id 11.11.11.11
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]ne 0.0.0.0 255.255.255.255
AR12
[R12]ospf 1 router-id 12.12.12.12
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]ne 172.16.65.6 0.0.0.0
[R12]rip 1
[R12-rip-1]v 2
[R12-rip-1]undo summary
[R12-rip-1]net 172.16.0.0
[R12]ospf 1
[R12-ospf-1]im
[R12-ospf-1]import-route rip
AR9
[R9]ospf 1
[R9-ospf-1]import-route ospf 2
[R9]ospf 2
[R9-ospf-2]import-route ospf 1
四
AR3
[R3]int Tunnel 0/0/0
[R3-Tunnel0/0/0]ip add 172.16.6.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 34.0.0.3
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
AR5
[R5]int Tunnel 0/0/0
[R5-Tunnel0/0/0]ip add 172.16.6.5 24
[R5-Tunnel0/0/0]tunnel-protocol gre p2mp
[R5-Tunnel0/0/0]source Serial 4/0/0
[R5-Tunnel0/0/0]nhrp entry 172.16.6.3 34.0.0.3 register
[R5-Tunnel0/0/0]nhrp network-id 100
AR6
[R6]int Tunnel 0/0/0
[R6-Tunnel0/0/0]ip add 172.16.6.6 24
[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.6.3 34.0.0.3 register
AR7
[R7]int Tunnel 0/0/0
[R7-Tunnel0/0/0]ip add 172.16.6.7 24
[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.6.3 34.0.0.3 register
AR3
[R3]ospf 1
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]dis th
[R3-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255
AR5
[R5]ospf 1 router-id 5.5.5.5
[R5-ospf-1]a 0
[R5-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]ne 172.16.3.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]dis th
AR6
[R6]ospf 1
[R6-ospf-1]a 0
[R6-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]ne 172.16.4.0 0.0.0.255
AR7
[R7]ospf 1 router-id 7.7.7.7
[R7-ospf-1]a 0
[R7-ospf-1-area-0.0.0.0]dis th
[R7-ospf-1-area-0.0.0.0]ne 172.16.6.0 0.0.0.255
AR3
[R3]int t0/0/0
[R3-Tunnel0/0/0]ospf network-type broadcast
AR5
[R5]int t0/0/0
[R5-Tunnel0/0/0]ospf network-type broadcast
[R5-Tunnel0/0/0]ospf dr-priority 0
AR6
[R6]int t0/0/0
[R6-Tunnel0/0/0]ospf network-type broadcast
[R6-Tunnel0/0/0]ospf dr-priority 0
AR7
[R7]int t0/0/0
[R7-Tunnel0/0/0]ospf network-type broadcast
[R7-Tunnel0/0/0]ospf dr-priority 0
五
AR3
[R3]acl 2000
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.0.255
[R3-acl-basic-2000]undo rule 5
[R3-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R3]int s4/0/0
[R3-Serial4/0/0]nat outbound 2000
AR6
[R6]acl 2000
[R6-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255
[R6]int s4/0/0
[R6-Serial4/0/0]nat outbound 2000
AR7
[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
六
AR3
[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.0
AR6
[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.0
AR7
[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.0
AR9
[R9]ospf 1
[R9-ospf-1]asbr-summary 172.16.128.0 255.255.224.0
AR12
[R12]ospf 1
[R12-ospf-1]asbr-summary 172.16.160.0 255.255.224.0
AR3
[R3]ip route-static 172.16.32.0 19 NULL 0
AR6
[R6]ip route-static 172.16.64.0 19 NULL 0
AR7
[R7]ip route-static 172.16.96.0 19 NULL 0
AR9
[R9]ip route-static 172.16.128.0 19 NULL 0
AR12
[R12]ip route-static 172.16.160.0 19 NULL 0
AR1
[R1]ospf 1
[R1-ospf-1]a 1
[R1-ospf-1-area-0.0.0.1]stub no-summary
AR2
[R2]ospf 1
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]stub no-summary
AR3
[R3]ospf 1
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]stub no-summary
AR6
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]nssa no-summary
AR7
[R7]ospf 1
[R7-ospf-1]a 3
[R7-ospf-1-area-0.0.0.3]nssa no-summary
AR8
[R8]ospf 1
[R8-ospf-1]a 3
[R8-ospf-1-area-0.0.0.3]nssa no-summary
AR9
[R9]ospf 1
[R9-ospf-1]a 3
[R9-ospf-1-area-0.0.0.3]nssa no-summary
R11
[R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]nssa no-summary
AR12
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]nssa no-summary
AR9
[R9]ospf 2
[R9-ospf-2]default-route-advertise
AR1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf timer hello 5
AR2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ospf timer hello 5
AR3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf timer hello 5
七
AR6
[R6]ospf 1
[R6-ospf-1]a 2
[R6-ospf-1-area-0.0.0.2]authentication-mode md5 test cipher 123
AR11
[R11]ospf 1
[R11-ospf-1]a 2
[R11-ospf-1-area-0.0.0.2]authentication-maode md5 test cipher 123
AR12
[R12]ospf 1
[R12-ospf-1]a 2
[R12-ospf-1-area-0.0.0.2]authentication-mode md5 test cipher 123
最后,随机ping查看结果