一、实验拓扑
二、实验要求
1、R1-R3为区域0,R3-R4为区域1;其中R3在环回地址在区域0;
2、R1、R2各有一个环回口;
3、R1-R3中,R3为DR设备,没有BDR;
4、R4环回地址固定4.4.4.0/24 ,其他网段使用192.168.1.0/24进行合理分配;
5、R4环回不宣告,保证全网可达,保证更新安全,避免环路,减少路由条目;
三、实验步骤
1、划分IP,并给相应设备配置IP地址:
(1)将192.168.1.0/24划分为两个区域,分别给area0和area1。
area0:192.168.1.0/25
area1:192.168.1.128/25
(2)在area0内,将192.168.1.0/25划分:
骨干链路:192.168.1.0/27
192.168.1.96/29
R1环回口:192.168.1.32/27
R2环回口:192.168.1.64/27
R3环回口:192.168.1.96/27
(3)在area1内,将192.168.1.128/25划分:
骨干链路:192.168.1.128/30
2、配置IP地址:
R1:
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 29
[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip address 192.168.1.33 27
[R1-LoopBack0]q
R2:
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 29
[R2-GigabitEthernet0/0/0]int l0
[R2-LoopBack0]ip address 192.168.1.65 27
[R2-LoopBack0]q
R3:
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.3 29
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.129 30
[R3-GigabitEthernet0/0/1]int l0
[R3-LoopBack0]ip address 192.168.1.97 27
[R3-LoopBack0]q
R4:
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.130 30
[R4-GigabitEthernet0/0/0]int l0
[R4-LoopBack0]ip address 4.4.4.4 24
[R4-LoopBack0]q
3、进行区域划分启动ospf协议:
R1:
[R1]ospf 1 router-id ?
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area ?
[R1-ospf-1]area 0.0.0.0
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 ?
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.7
[R1-ospf-1-area-0.0.0.0]network 192.168.1.33 ?
[R1-ospf-1-area-0.0.0.0]network 192.168.1.33 0.0.0.0
[R1-ospf-1-area-0.0.0.0]q
[R1-ospf-1]q
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.2 0.0.0.0
[R2-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
[R2-ospf-1-area-0.0.0.0]q
R3:
[R3]q
<R3>reset ospf process ?
flush-waiting-timer Flush waiting timer
graceful-restart Reset OSPF process by graceful restart
<cr> Please press ENTER to execute command
<R3>reset ospf process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
<R3>reset ospf 1 process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
<R3>sys
[R3]dis ospf peer
OSPF Process 1 with Router ID 3.3.3.3
[R3]ospf 1
[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.97 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.129 0.0.0.0
[R3-ospf-1-area-0.0.0.1]q
[R3-ospf-1]q
R4:
[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.130 0.0.0.0[R4-ospf-1-area-0.0.0.1]q
检查:
R1:
R2:
R3:
R4:
4、配置缺省路由:
R4:
[R4]ospf 1
[R4-ospf-1]default-route-advertise always
检验:
5、干预BR/BDR选举
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
检验:
6、做接口认证:
R1:
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher wdy12345
R2:
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher wdy12345
R3:
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher wdy12345
7、做区域汇总
R3:
[R3]ospf 1
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.2 ?
IP_ADDR<X.X.X.X> IP address mask
[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
8、R3上做防环
[R3]ip route-static 192.168.1.0 25 NULL 0
实现全网通:
10、到此,实验完成。