一,有两个区域,分两个网段。再把其中一个区域划分为四个
二,配置IP地址和环回地址
R1
<Huawei>sys
[Huawei]sysname r1
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 27
[r1-GigabitEthernet0/0/0]int l0
[r1-LoopBack0]ip add
[r1-LoopBack0]ip address 192.168.1.33 27
R2
<Huawei>sys
[Huawei]sys r2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 27
[r2-GigabitEthernet0/0/0]int l1
[r2-LoopBack1]ip add
[r2-LoopBack1]ip address 192.168.1.65 27
R4
<Huawei>sys
[Huawei]sys r4
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add
[r4-GigabitEthernet0/0/0]ip address 192.168.1.130 25
[r4-GigabitEthernet0/0/0]int l3
[r4-LoopBack3]ip add
[r4-LoopBack3]ip address 4.4.4.1 24
三,区域划分
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]netw
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.31
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]net
[r2-ospf-1-area-0.0.0.0]network 192.168.1.64 0.0.0.31
[r2-ospf-1-area-0.0.0.0]net
[r2-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.31
[r2-ospf-1-area-0.0.0.0]
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]net
[r4-ospf-1-area-0.0.0.1]network 192.168.1.128 0.0.0.127
[r4-ospf-1-area-0.0.0.1]
四,汇总
[r3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]abr
[r3-ospf-1-area-0.0.0.1]abr-summary 192.168.1.128 255.255.255.128
五,OSPF认证
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ospf au
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cip
[r1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ospf au
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cip
[r2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 1234
[r3-GigabitEthernet0/0/0]ospf a
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 ci
[r3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 123456
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
六,验证
<r1>ping 4.4.4.1
PING 4.4.4.1: 56 data bytes, press CTRL_C to break
Reply from 4.4.4.1: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 4.4.4.1: bytes=56 Sequence=2 ttl=254 time=40 ms
Reply from 4.4.4.1: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 4.4.4.1: bytes=56 Sequence=4 ttl=254 time=40 ms
Reply from 4.4.4.1: bytes=56 Sequence=5 ttl=254 time=50 ms
--- 4.4.4.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/44/50 ms
<r1>ping 192.168.1.65
PING 192.168.1.65: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.65: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 192.168.1.65: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 192.168.1.65: bytes=56 Sequence=3 ttl=255 time=60 ms
Reply from 192.168.1.65: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 192.168.1.65: bytes=56 Sequence=5 ttl=255 time=40 ms
--- 192.168.1.65 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/50/70 ms