实验需求
实验拓扑
分析过程
由图可得,通过ospf算法划分两个区域,且基于192.168.1.0/24, 网络号借一位,划分成192.168.1.0/25
192.168.1.128/25
左边区域有三个环回网段,一个骨干链路,为方便手工汇总,基于192.168.1.0/25网段划分,网络号借两位,划分成
192.168.1.0/27
192.168.1.32/27
192.168.1.64/27
192.168.1.96/27
规划好IP后,对其进行配置
配置内容
1,创建并配置好环回接口以及真实接口
2,启动ospf协议
3,进行相关拓展配置
4,用优先级实现无BDR
R1:
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.65 27
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 27
R2:
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 192.168.1.97 27
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 27
R3:
[R3]interface LoopBack 0
[R3-LoopBack0]ip address 192.168.1.33 27
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.3 27
[R3-GigabitEthernet0/0/1]ip address 192.168.1.129 25
R4:
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 24
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.130 25
R1:
[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
R2:
[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.0 0.0.0.255
R3:
[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.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]network 192.168.1.33 0.0.0.0
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]area 1
[R3-ospf-1-area-0.0.0.1]network 192.168.1.129 0.0.0.0
R4:
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.0]network 192.168.1.130 0.0.0.0
R1:
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
R2:
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
R3:
[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.128
NULL:
[R3]ip route-static 192.168.1.0 25 NULL 0
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 123456
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ospf authentication-mode md5 1 cipher 12345
R4:
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345
缺省路由:
[R4]ospf 1
[R4-ospf-1]default-route-advertise always
R1:
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf dr-priority 0
R2:
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ospf dr-priority 0
R1:
R2:
R3:
R4:
测试结果
数据抓包加密
全网可达: