
R1:
Router(config)#interface loopback0
Router(config-if)#ip address 1.1.1.1 255.255.255.255
Router(config-if)#no shutdown
Router(config-if)#interface ethernet0/0
Router(config-if)#ip address 172.8.146.1 255.255.255.0
Router(config-if)#no shutdown
R2:
Router(config)#interface loopback0
Router(config-if)#ip address 2.2.2.2 255.255.255.255
Router(config-if)#no shutdown
Router(config-if)#interface ethernet0/0
Router(config-if)#ip address 172.8.23.2 255.255.255.0
Router(config-if)#no shutdown
R3:
Router(config)#interface loopback 0
Router(config-if)#ip address 3.3.3.3 255.255.255.255
Router(config-if)#no shutdown
Router(config-if)#interface ethernet0/0
Router(config-if)#ip address 172.8.23.3 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#interface interface ethernet0/1
Router(config-if)#ip address 172.8.35.3 255.255.255.0
Router(config-if)#no shutdown
R4:
Router(config)#interface loopback0
Router(config-if)#ip address 4.4.4.4 255.255.255.255
Router(config-if)#no shutdown
Router(config-if)#interface ethernet0/1
Router(config-if)#ip address 172.8.100.4 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#interface ethernet 0/2
Router(config-if)#ip address 172.8.146.4 255.255.255.0
Router(config-if)#no shutdown
R5:
Router(config)#interface Loopback0
Router(config-if)#ip address 5.5.5.5 255.255.255.255
Router(config-if)#no shutdown
Router(config-if)#interface Ethernet0/0
Router(config-if)#ip address 172.8.100.5 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#interface Ethernet0/1
Router(config-if)#ip address 172.8.35.5 255.255.255.0
Router(config-if)no shutdown
R6:
Router(config)#interface loopback 0
Router(config-if)#ip address 6.6.6.6 255.255.255.255
Router(config-if)#no shutdown
Router(config-if)#interface ethernet0/0
Router(config-if)#ip address 172.8.146.6 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#interface ethernet0/1
Router(config-if)#ip address 172.8.100.6 255.255.255.0
Router(config-if)#no shutdown
R1:
Router(config)#router ospf 89
Router(config-router)#router-id 1.1.1.1
Router(config-router)#network 172.8.146.1 0.0.0.0 area 146
Router(config-router)#network 1.1.1.1 0.0.0.0 area 146
R2:
Router(config)#router ospf 89
Router(config-router)#router-id 2.2.2.2
Router(config-router)#network 172.8.23.2 0.0.0.0 area 23
Router(config-router)#network 2.2.2.2 0.0.0.0 area 23
R3:
Router(config)#router ospf 89
Router(config-router)#router-id 3.3.3.3
Router(config-router)#network 172.8.23.3 0.0.0.0 area 23
Router(config-router)#network 172.8.35.3 0.0.0.0 area 35
Router(config-router)#network 3.3.3.3 0.0.0.0 area 35
R4:
Router(config)#router ospf 89
Router(config-router)#router-id 4.4.4.4
Router(config-router)#network 172.8.100.4 0.0.0.0 area 0
Router(config-router)#network 172.8.146.4 0.0.0.0 area 146
Router(config-router)#network 4.4.4.4 0.0.0.0 area 0
R5:
Router(config)#router ospf 89
Router(config-router)#router-id 5.5.5.5
Router(config-router)#network 172.8.35.5 0.0.0.0 area 35
Router(config-router)#network 172.8.100.5 0.0.0.0 area 0
Router(config-router)#network 5.5.5.5 0.0.0.0 area 0
R6:
Router(config)#router ospf 89
Router(config-router)#router-id 6.6.6.6
Router(config-router)#network 172.8.100.6 0.0.0.0 area 0
Router(config-router)#network 172.8.146.6 0.0.0.0 area 146
Router(config-router)#network 6.6.6.6 0.0.0.0 area 0
在以太网中,默认的网络类型即为广播型。想让 R5 永久成为 DR,需要将 R4 和R6 的接口优先级改为 0,不允许他们参与选举。
R4:
Router(config)#interface ethernet0/1
Router(config-if)#ip ospf priority 0
R6:
Router(config)#interface ethernet0/1
Router(config-if)#ip ospf priority 0
效果检查

R4:
Router(config)#router ospf 89
Router(config-router)#area 146 stub no-summary
R6:
Router(config)#router ospf 89
Router(config-router)#area 146 stub no-summary
R1:
Router(config)#router ospf 89
Router(config-router)#area 146 stub
由于 AREA 23 没有与 AREA 0 相连,需要使用虚链路来完成。
R3:
Router(config)#router ospf 89
Router(config-router)#area 35 virtual-link 5.5.5.5
R5:
Router(config)#router ospf 89
Router(config-router)#area 35 virtual-link 3.3.3.3
效果验证

Router(config)#router ospf 89
Router(config-router)#default-information originate always
R5:
Router(config)#router ospf 89
Router(config-router)#area 0 authentication message-digest
Router(config-router)#$tual-link 3.3.3.3 message-digese-key 1 md5 SPOTO
area 35 virtual-link 3.3.3.3 message-digest-key 1 md5 SPOTO
Router(config)#interface ethernet 0/0
Router(config-if)#ip ospf message-digest-key 1 md5 SPOTO
R3:
Router(config)#router ospf 89
Router(config-router)#area 0 authentication message-digest
Router(config-router)#$tual-link 5.5.5.5 message-digest-key 1 md5 SPOTO
R4:
Router(config)#router ospf 89
Router(config-router)#area 0 authentication message-digest
Router(config-router)#interface ethernet0/1
Router(config-if)#ip ospf message-digest-key 1 md5 SPOTO
R6:
Router(config)#router ospf 89
Router(config-router)#area 0 authentication message-digest
Router(config-router)#interface ethernet0/1
Router(config-if)#ip ospf message-digest-key 1 md5 SPOTO
R4:
Router(config)#interface ethernet0/2
Router(config-if)#ip ospf priority 0
R6:
Router(config)#interface ethernet0/0
Router(config-if)#ip ospf priority 0
R4、R6:
Router(config)#router ospf 89
Router(config-router)#area 146 range 172.8.0.0 255.255.0.0
Router(config)#router ospf 89
Router(config-router)#area 146 default-cost 100
R1:
Router(config)#router ospf 89
Router(config-router)#area 146 authentication
Router(config-router)#interface ethernet0/0
Router(config-if)#ip ospf authentication-key SPOTO
R4:
Router(config)#router ospf 89
Router(config-router)#area 146 authentication
Router(config-router)#interface ethernet0/2
Router(config-if)#ip ospf authentication-key SPOTO
R6:
Router(config)#router ospf 89
Router(config-router)#area 146 authentication
Router(config-router)#interface ethernet0/0
Router(config-if)#ip ospf authentication-key SPOTO
R5:
Router(config-router)#router ospf 89
Router(config-router)#area 35 authentication
Router(config-router)#interface ethernet0/1
Router(config-if)#ip ospf authentication-key SPOTO
R3:
Router(config)#router ospf 89
Router(config-router)#area 23 authentication
Router(config-router)#area 35 authentication
Router(config-router)#interface ethernet0/1
Router(config-if)#ip ospf authentication-key SPOTO
Router(config-if)#interface ethernet0/0
Router(config-if)#ip ospf authentication-key SPOTO
R2:
Router(config)#router ospf 89
Router(config-router)#area 23 authentication
Router(config-router)#interface ethernet0/0
Router(config-if)#ip ospf authentication-key SPOTO
验证:
