一、实验拓扑图及其要求
二、要求分析
- R5为ISP:这意味着它主要用于提供互联网服务,在实际配置中,R5只用于配置必要的IP地址,不参与路由计算或复杂的路由策略制定。
- R4作为企业边界路由器:需要特别注意的是,R4连接至ISP时,应采用PPP协议来动态获取IP地址,并且启用了CHAP认证以增加安全性。这是为了确保当互联网服务提供商分配的IP发生变化时,路由器仍能自动适配新的IP设置。
- OSPF环境基于
172.16.0.0/16
:在整个OSPF区域内部,所有的网络都应当从这个大的地址段中划分出来,保证所有内部设备之间的通信能够正常工作。 - 所有设备可以访问R5的环回:这表示无论网络如何变化,R5上的环回接口始终可访问,这对于监控和服务可用性非常重要。
- 减少LSA更新量,加快收敛,保障更新安全:通过合理设计OSPF区域(如划分Area),可以有效地减少不必要的LSA传播,从而提高网络效率和安全性。
三、地址规划
172.16.0.0 16 1-6 借三位
172.16.000 00000.00000000 19
172.16.0.0 19---area 0 /24 /25
172.16.000 00000.0000000 24
172.16.0.0 24--P2P链路 /30
172.16.0.000001 00
172.16.0.0 30
172.16.0.4 30
172.16.0.8 30
...
172.16.1.0 24--MA链路 /29
172.16.1.00001 000 24 -29
172.16.1.0 29
172.16.1.8 29
172.16.1.16 29
...
172.16.2.0 24
172.16.3.0 24
...
/25
172.16.000 00000.0 000000 25
172.16.0.0 25
172.16.0.128 25
172.16.1.0 25
172.16.1.128 25
...
172.16.32.0 19--area 1 /24
172.16.32.0 24--MA /29
172.16.32.0 29
172.16.32.8 29
...
172.16.33.0 24-用户
172.16.34.0 24--用户
...
172.16.64.0 19--area 2
172.16.64.0 24--P2P /30
172.16.64.0 30
172.16.64.4 30
172.16.64.8 30
...
172.16.65.0 24--用户
172.16.66.0 24
172.16.67.0 24
172.16.96.0 19--area 3
172.16.96.0 24--P2P /30
172.16.96.0 30
172.16.96.4 30
..
172.16.97.0 24--用户
172.16.98.0 24
172.16.128.0 19---area 4
172.16.128.0 24-P2P /30
172.16.128.0 30
172.16.128.4 30
...
172.16.129.0 24
172.16.130.0 24
172.16.160.0 19---rip
172.14.160.0 24
172.16.161.0 24
172.16.192.0 19
172.16.224.0 19
...
四、配置
1、配置地址并且宣告ospf
2、配置ospf
r1:
r2:
r3:
r4:
r6:
r7:
r8:
r9:
r10:
r11:
r12:
ospf邻居检查:
连通性测试:
缺省路由配置:
[R4]ip route-static 0.0.0.0 0.0.0.0 45.0.0.2
特殊区域:
a1:
[r1]ospf 1[r1-ospf-1]a 1[r1-ospf-1-area-0.0.0.1]stub [r2]ospf 1[r2-ospf-1]a 1[r2-ospf-1-area-0.0.0.1]stub [r3]ospf 1[r3-ospf-1]a 1[r3-ospf-1-area-0.0.0.1]stub no-summary
a2:
[r1]ospf 1[r1-ospf-1]a 1[r1-ospf-1-area-0.0.0.1]stub [r2]ospf 1[r2-ospf-1]a 1[r2-ospf-1-area-0.0.0.1]stub [r3]ospf 1[r3-ospf-1]a 1[r3-ospf-1-area-0.0.0.1]stub no-summary
a3:
[r7]ospf 1[r7-ospf-1]a 3[r7-ospf-1-area-0.0.0.3]nssa no-summary [r8]ospf 1[r8-ospf-1]a 3[r8-ospf-1-area-0.0.0.3]nssa [r9]ospf 1[r9-ospf-1]a 3[r9-ospf-1-area-0.0.0.3]nssa
缺省下发:
[r9]ospf 2[r9-ospf-2]default-route-advertise[r9-ospf-2]undo import-route ospf 1[r4]ospf 1 [r4-ospf-1]default-route-advertise
加快收敛配置:
----- R3-R1/2 -----[r3]int g0/0/0 [r3-GigabitEthernet0/0/0]ospf network-type p2mp[r1]int g0/0/0 [r1-GigabitEthernet0/0/0]ospf network-type p2mp[r2]int g0/0/0[r2-GigabitEthernet0/0/0]ospf network-type p2mp ----- R3-R4 -----[r3]int g0/0/1[r3-GigabitEthernet0/0/1]ospf network-type p2p[r4]int g0/0/1[r4-GigabitEthernet0/0/1]ospf network-type p2p ----- R4-R6 -----[r4]int g0/0/2[r4-GigabitEthernet0/0/2]ospf network-type p2p[r6]int g0/0/1[r6-GigabitEthernet0/0/1]ospf network-type p2p ----- R4-R7 -----[r4]int g0/0/0[r4-GigabitEthernet0/0/0]ospf network-type p2p[r7]int g0/0/0[r7-GigabitEthernet0/0/0]ospf network-type p2p ----- R6-R11 -----[r6]int g0/0/0[r6-GigabitEthernet0/0/0]ospf network-type p2p[r11]int g0/0/0[r11-GigabitEthernet0/0/0]ospf network-type p2p ----- R11-R12 -----[r11-GigabitEthernet0/0/0]int g0/0/1[r11-GigabitEthernet0/0/1]ospf network-type p2p[r12]int g0/0/0[r12-GigabitEthernet0/0/0]ospf network-type p2p ----- R7-R8 -----[r7]int g0/0/1[r7-GigabitEthernet0/0/1]ospf network-type p2p[r8]int g0/0/0[r8-GigabitEthernet0/0/0]ospf network-type p2p ----- R8-R9 -----[r8-GigabitEthernet0/0/0]int g0/0/1[r8-GigabitEthernet0/0/1]ospf network-type p2p[r9]int g0/0/0[r9-GigabitEthernet0/0/0]ospf network-type p2p ----- R9-R10 -----[r9]int g0/0/1[r9-GigabitEthernet0/0/1]ospf network-type p2p[r10]int g0/0/0[r10-GigabitEthernet0/0/0]ospf network-type p2p
hello时间:
----- R3-R1/2 -----[r1]int g0/0/0[r1-GigabitEthernet0/0/0]ospf timer hello 10 [r2]int g0/0/0[r2-GigabitEthernet0/0/0]ospf timer hello 10[r3]int g0/0/0[r3-GigabitEthernet0/0/0]ospf timer hello 10
ospf认证:
----- Area 0 -----[r4]ospf 1[r4-ospf-1]a 0[r4-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456 [r3]ospf 1[r3-ospf-1]a 0[r3-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456 [r6]ospf 1[r6-ospf-1]a 0[r6-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456 [r7]ospf 1[r7-ospf-1]a 0[r7-ospf-1-area-0.0.0.0]authentication-mode md5 1 cipher 123456
NAT:
[r4]acl 2000[r4-acl-basic-2000]rule permit source 172.16.0.0 0.0.255.255 [r4]int s4/0/1 [r4-Serial4/0/1]nat outbound 2000
ping通测试: