一、实验要求:
1、R1-3为区域0,R3到R4为区域1;其中R3的环回也在区域0
2、R1-3 R3 为DR设备, 没有BDR
3、R4的环回地址已经固定,其他所有网段使用192.168.1.0 /24 进行合理分配
4、R4环回不能宣告,全网可达,保障更新安全。避免环路,减少路由条目数量
拓扑结构如下图:
二、实验步骤
(1)划分子网分配IP地址
(2)给每个路由器接口配置IP和环回
R1:
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.193 27
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.0 27
[R1]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.33 27
R2:
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.194 27
[Huawei]interface LoopBack 0
[Huawei-LoopBack0]ip address 192.168.1.65 27
[Huawei]interface LoopBack 1
[Huawei-LoopBack1]ip address 192.168.1.97 27
R3:
[R3-GigabitEthernet0/0/0]ip address 192.168.1.195 27
[R3-GigabitEthernet0/0/1]ip address 192.168.2.195 27
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 192.168.1.129 27
[R3]interface LoopBack 1
[R3-LoopBack1]ip address 192.168.1.161 27
R4:
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.196 27
[Huawei]interface LoopBack 0
[Huawei-LoopBack0]ip address 4.4.4.1 24
(3)启动ospf并分区宣告
R1:
[R1]ospf 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.63
[R1-ospf-1-area-0.0.0.0]network 192.168.1.193 0.0.0.31
R2:
[R2]ospf router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.1.64 0.0.0.63
[R2-ospf-1-area-0.0.0.0]network 192.168.1.194 0.0.0.31
R3:
[R3]ospf router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.1.195 0.0.0.31
[R3-ospf-1-area-0.0.0.0]network 192.168.1.128 0.0.0.63
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 192.168.2.195 0.0.0.31
R4:
[Huawei]ospf router-id 4.4.4.4
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]network 192.168.2.196 0.0.0.31
(4)汇总
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.0
[R3]ospf 1
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]abr-summary 192.168.2.193 255.255.255.248
(5)认证接口
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[R1]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 54321
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 54321
(6)测试
R1pingR4
<R1>ping 192.168.2.196
PING 192.168.2.196: 56 data bytes, press CTRL_C to break
Reply from 192.168.2.196: bytes=56 Sequence=1 ttl=254 time=70 ms
Reply from 192.168.2.196: bytes=56 Sequence=2 ttl=254 time=60 ms
Reply from 192.168.2.196: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 192.168.2.196: bytes=56 Sequence=4 ttl=254 time=50 ms
Reply from 192.168.2.196: bytes=56 Sequence=5 ttl=254 time=60 ms
--- 192.168.2.196 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/56/70 ms
<R1>
R4pingR3
[r4]ping 192.168.1.194
PING 192.168.1.194: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.194: bytes=56 Sequence=1 ttl=254 time=50 ms
Reply from 192.168.1.194: bytes=56 Sequence=2 ttl=254 time=50 ms
Reply from 192.168.1.194: bytes=56 Sequence=3 ttl=254 time=40 ms
Reply from 192.168.1.194: bytes=56 Sequence=4 ttl=254 time=50 ms
Reply from 192.168.1.194: bytes=56 Sequence=5 ttl=254 time=60 ms
--- 192.168.1.194 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/50/60 ms
[r4]