实验原理图:
实验要求:
1.R3不能宣告环回,全网可达;
2.R2-R5所在MA网络,只有R2为DR,其他为是DR Other;
3.area1开启明文认证,面积2开启密文认证;
4.R3和R4开启明文认证,R4和R5开启密文认证;
5.所有环回做被动;
6.R1和R2加快收敛速度为原来的1/2。
实验配置:
R1路由器:
interface Loopback0
ip address 172.16.1.1 255.255.255.128
ip ospf network point-to-point
interface Loopback1
ip address 172.16.1.129 255.255.255.128
ip ospf network point-to-point
interface Serial1/0
ip address 172.16.0.1 255.255.255.252
ip ospf hello-interval 2
router ospf 1
router-id 1.1.1.1
area 1 authentication
passive-interface Loopback0
passive-interface Loopback1
network 172.16.0.0 0.0.0.3 area 1
network 172.16.1.0 0.0.0.255 area 1
R2路由器配置:
interface Loopback0
ip address 172.16.2.1 255.255.255.128
ip ospf network point-to-point
interface Loopback1
ip address 172.16.2.129 255.255.255.128
ip ospf network point-to-point
interface Ethernet0/1
ip address 172.16.0.9 255.255.255.248
ip ospf 1 area 0
interface Serial1/0
ip address 172.16.0.2 255.255.255.252
ip ospf hello-interval 2
router ospf 1
router-id 2.2.2.2
area 1 authentication
passive-interface Loopback0
passive-interface Loopback1
network 172.16.0.0 0.0.0.3 area 1
network 172.16.2.0 0.0.0.255 area 0
R3路由器配置:
interface Loopback0
ip address 172.16.3.129 255.255.255.128
interface Loopback1
ip address 172.16.3.1 255.255.255.128
interface Ethernet0/0
ip address 172.16.0.10 255.255.255.248
ip ospf priority 0
ip ospf 1 area 0
interface Serial1/1
ip address 172.16.0.17 255.255.255.252
ip ospf authentication
ip ospf authentication-key cisco123
ip ospf 1 area 2
router ospf 1
router-id 3.3.3.3
area 2 authentication message-digest
default-information originate always
R4路由器配置:
interface Loopback0
ip address 172.16.4.1 255.255.255.128
ip ospf network point-to-point
ip ospf 1 area 2
interface Loopback1
ip address 172.16.4.129 255.255.255.128
ip ospf network point-to-point
ip ospf 1 area 2
interface Ethernet0/0
ip address 172.16.0.11 255.255.255.248
ip ospf priority 0
ip ospf 1 area 0
interface Serial1/0
ip address 172.16.0.18 255.255.255.252
ip ospf authentication
ip ospf authentication-key cisco123
ip ospf 1 area 2
interface Serial1/1
ip address 172.16.0.21 255.255.255.252
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 cisco
ip ospf 1 area 2
router ospf 1
router-id 4.4.4.4
area 2 authentication message-digest
passive-interface Loopback0
passive-interface Loopback1
R5路由器配置:
interface Loopback0
ip address 172.16.5.1 255.255.255.128
ip ospf network point-to-point
ip ospf 1 area 2
interface Loopback1
ip address 172.16.5.129 255.255.255.128
ip ospf network point-to-point
ip ospf 1 area 2
interface Ethernet0/0
ip address 172.16.0.12 255.255.255.248
ip ospf priority 0
ip ospf 1 area 0
interface Serial1/0
ip address 172.16.0.22 255.255.255.252
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 cisco
ip ospf 1 area 2
router ospf 1
router-id 5.5.5.5
area 2 authentication message-digest
passive-interface Loopback0
passive-interface Loopback1
实验结果测试:
R2#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
3.3.3.3 0 FULL/DROTHER 00:00:32 172.16.0.10 Ethernet0/1
4.4.4.4 0 FULL/DROTHER 00:00:34 172.16.0.11 Ethernet0/1
5.5.5.5 0 FULL/DROTHER 00:00:38 172.16.0.12 Ethernet0/1
1.1.1.1 0 FULL/ - 00:00:07 172.16.0.1 Serial1/0
R2#show ip ospf topology-info
OSPF Router with ID (2.2.2.2) (Process ID 1)
Base Topology (MTID 0)
Topology priority is 64
Router is not originating router-LSAs with maximum metric
Number of areas transit capable is 0
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Area BACKBONE(0)
SPF algorithm last executed 00:22:17.599 ago
SPF algorithm executed 9 times
Area ranges are
Area 1
SPF algorithm last executed 00:22:17.600 ago
SPF algorithm executed 9 times
Area ranges are
R2#show ip route ospf
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is 172.16.0.10 to network 0.0.0.0
O*E2 0.0.0.0/0 [110/1] via 172.16.0.10, 00:23:38, Ethernet0/1
172.16.0.0/16 is variably subnetted, 16 subnets, 4 masks
O IA 172.16.0.16/30 [110/74] via 172.16.0.11, 00:19:12, Ethernet0/1
[110/74] via 172.16.0.10, 00:18:56, Ethernet0/1
O IA 172.16.0.20/30 [110/74] via 172.16.0.12, 00:18:41, Ethernet0/1
[110/74] via 172.16.0.11, 00:19:12, Ethernet0/1
O 172.16.1.0/25 [110/65] via 172.16.0.1, 00:23:38, Serial1/0
O 172.16.1.128/25 [110/65] via 172.16.0.1, 00:23:38, Serial1/0
O IA 172.16.4.0/25 [110/11] via 172.16.0.11, 00:19:12, Ethernet0/1
O IA 172.16.4.128/25 [110/11] via 172.16.0.11, 00:19:12, Ethernet0/1
O IA 172.16.5.0/25 [110/11] via 172.16.0.12, 00:18:41, Ethernet0/1
O IA 172.16.5.128/25 [110/11] via 172.16.0.12, 00:18:41, Ethernet0/1
R1#ping 172.16.3.1 source 172.16.1.1 repeat 100
Type escape sequence to abort.
Sending 100, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:
Packet sent with a source address of 172.16.1.1
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (100/100), round-trip min/avg/max = 7/10/16 ms
实验总结:
在此实验中需注意DR的选举原则(路由器-ID为最大的接口的IP地址,如果配置了环回地址,则使用环回地址作为路由器-ID,如果配置有多个环回地址,则以最高的回送地址为路由器ID。也可是通过router-id <地址>路由器配置命令强制某个IP地址作为路由器的路由器ID。),而且DR优先级在接口定义,若不参与DR / BDR的选举,直接将接口优先级改为0.区域内的明(密)文认证需要在路由协议内进行,链路的认证只需要在接口进行认证即可。收敛速度不建议修改,若修改需对端同步。在NP阶段会讲解到LSA的详细信息,届时我们将会对路由条目数量进行优化。