例图:
需求:
需求:1.整个网络使用192.168.1.0/24,进行地址分配
2.Area 0区域中,R1为DR,R2为BDR
3.R3与R4之间使用密文认证,密码为Admin@huawei.com
3、R1、R2、R5上各自配置一个环回接口。R1和R2的环回接口可以宣告到OSPF网络
5.设备的的RID为每台设备名称编号(AR1==1.1.1.1)
6全网可达
分析:
1.划分网段
2.启动OSPF
3.认证
4.DR BDR
5.缺省
过程:
1.划分网段
2.IP配置,启动ospf
[Huawei]sy r1
[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]a 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]q
[r1-ospf-1]q
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.33 27
[r1-GigabitEthernet0/0/0]int l 0
[r1-LoopBack0]ip add 192.168.1.65 27
[Huawei]sy r2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.34 27
Jul 26 2024 19:51:59-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]int l 0
[r2-LoopBack0]ip add 192.168.1.97 27
[r2]q
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.97 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.34 0.0.0.0
[r2-ospf-1-area-0.0.0.0]
Huawei]sy r3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.35 27
[r3-GigabitEthernet0/0/0]
Jul 26 2024 19:53:16-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.1 30
Jul 26 2024 19:53:43-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r3-GigabitEthernet0/0/1]q
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]a 0
[r3-ospf-1-area-0.0.0.0]network 192.168.1.35 0.0.0.0
[r3-ospf-1-area-0.0.0.0]a 1
[r3-ospf-1-area-0.0.0.1]network 192.168.1.1 0.0.0.0
[Huawei]sy r4
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r4-GigabitEthernet0/0/0]
Jul 26 2024 19:54:41-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.5 30
Jul 26 2024 19:55:14-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r4-GigabitEthernet0/0/1]q
[r4]ospf 1 router-id 4.4.4.4
[r4-ospf-1]a 1
[r4-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
[Huawei]sy r5
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.6 30
Jul 26 2024 19:55:45-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r5-GigabitEthernet0/0/1]int l 0
[r5-LoopBack0]ip add 192.168.1.129 27
[r5-LoopBack0]q
[r5]ospf 1 router-id 5.5.5.5
[r5-ospf-1]a 1
[r5-ospf-1-area-0.0.0.1]ne
[r5-ospf-1-area-0.0.0.1]network 192.168.1.6 0.0.0.0
3.认证
r3]int g 0/0/1
[r3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher admin@huawei.com
[r3-GigabitEthernet0/0/1]
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher admin@huawei.com
[r4-GigabitEthernet0/0/0]
4.DR BDR
5.缺省
[r5-ospf-1]default-route-advertise always