一.实验拓扑图
需要:
1.整个网络使用192.168.1.0/24,进行地址分配
2.Area @区域中,R1为DR,R2为BDR
3、R3与R4之间使用密文认证,密码为 Admin@huawei.com
4.R1、R2、R5上各自配置一个环回接口。R1和R2的环回接口可以宣告到0SPF网络
5.设备的RID为每台设备的名称编号(AR1--1.1.1.1)
6.全网可达
二.需求分析
1.划分网段
2.配IP,启动OSFP
3.认证
4.确定DR,BDR
5.缺省路由
三.配置过程
1.划分网段
192.168.1.0/24
192.168.1.0/27
192.168.1.0/30
192.168.1.4/30
192.168.1.32/27
192.168.1.64/27
192.168.1.96/27
192.168.1.128/27
2.配IP,启动OSFP
R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.33 27
Jul 28 2024 11:47:06-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]q
[R1]int l 0
[R1-LoopBack0]ip add 192.168.1.65 27
[R1-LoopBack0]q
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 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
R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.34 27
Jul 28 2024 11:53:54-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]q
[R2]int l 0
[R2-LoopBack0]ip add 192.168.1.97 27
[R2-LoopBack0]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.96 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 192.168.1.34 0.0.0.0
R3
[R3]int g 0/0/0
[R3-GigabitEthernet0/0/0]ip add 192.168.1.35 27
Jul 28 2024 11:58:03-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 28 2024 11:58:19-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]area 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]area 1
[R3-ospf-1-area-0.0.0.1]network 192.168.1.1 0.0.0.0
R4
[R4]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 192.168.1.2 30
Jul 28 2024 12:02:30-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 28 2024 12:02:44-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]area 1
[R4-ospf-1-area-0.0.0.1]network 192.168.1.0 0.0.0.255
R5
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 192.168.1.6 30
Jul 28 2024 12:05:41-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/0]q
[R5]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]area 1
[R5-ospf-1-area-0.0.0.1]network 192.168.1.6 0.0.0.0
3.认证
R3
[R3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher admin@huawei.com
R4
[R4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher admin@huawei.com
4.确定DR,BDR
5.缺省路由
R5
[R5-ospf-1]default-route-advertise always