OSPF协议实验

  • 实验拓扑

  • 实验需求

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.把192.168.1.0  24划分

根据ospf区域划分(ospf根据区域汇总网段)

有2个区域,area0和area1

2.改名字配IP

3.配OSPF协议·

5.保证更新安全加密

6.汇总防环

四、实验步骤

1.划分网段

有2个区域,area0和area1

先借一位分给两个区域  

192.168.1.0000 0000 25-----192.168.1.0 25---area0

area0有三个设备+一个总线

再借两位

192.168.1.0000 0000 27---192.168.1.0 27---骨干链路(32-2=30个可用IP)

再借两位节约IP地址

192.168.1.0000 0000 29---

R1---G0/0/0--192.168.1.1   29

R2--G0/0/0---192.168.1.2   29

R3----G0/00/0---192.168.1.3  29

交换机

G0/0/1--192.168.1.4

G0/0/2--192.168.1.5

G0/0/3---192.168.1.6

没用

192.168.1.0000 1000 29

192.168.1.0001 0000 29

192.168.1.0001 1000 29

192.168.1.0010 0000 27--192.168.1.33 27---R1环回

192.168.1.0100 0000 27--192.168.1.65 27---R2环回

192.168.1.0110 0000 27--192.168.1.97 27----R3环回

192.168.1.1000 0000 25-----192.168.1.128 25-(128-2=126个可用IP)----area1

再借5位节约ip地址-192.168.1.128 30

192.168.1.1000 0001----192.168.1.129 30 G0/0/1  R3

192.168.1.1000 0010----192.168.1.130 30 G0/0/0  R4

R1

[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add    
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 29
[R1]interface l    
[R1]interface LoopBack 0
[R1-LoopBack0]ip add    
[R1-LoopBack0]ip address 192.168.1.32 27
Error: The specified IP address is invalid.
[R1-LoopBack0]ip address 192.168.1.33 27

[R1]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.1/29       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.1.33/27      up         up(s)     
NULL0                             unassigned           up         up(s)     
[R1]

//.改名字配IP
[R1]ospf 1 router-id 1.1.1.1
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]net    
[R1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.0

//配ospf协议
[R1-GigabitEthernet0/0/0]ospf dr-priority 0

//让R3成为DR

[R1-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345

//加密

R2

[Huawei]sysname R2
[R2]int    
[R2]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip add    
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2
                                                ^
Error:Incomplete command found at '^' position.
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 29
[R2]interface LoopBack 0
[R2-LoopBack0]ip add    
[R2-LoopBack0]ip address 192.168.1.65 27
[R2-LoopBack0]

[R2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.2/29       up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.1.65/27      up         up(s)     
NULL0                             unassigned           up         up(s)     
[R2]

//.改名字配IP

[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]net    
[R2-ospf-1-area-0.0.0.0]network 192.168.1.2 0.0.0.0
//配ospf协议

[R2-GigabitEthernet0/0/0]ospf dr-priority 0

//让R3成为DR

[R2-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345

//加密

R3

R3]interface g0/0/0
[R3-GigabitEthernet0/0/0]ip add    
[R3-GigabitEthernet0/0/0]ip address 192.168.1.3 29
[R3]interface l    
[R3]interface LoopBack 0
[R3-LoopBack0]ip add    
[R3-LoopBack0]ip address 192.168.1.97 27

[R3-GigabitEthernet0/0/1]ip address 192.168.1.129 30
Dec 28 2023 17:45:42-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 

[R3]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.3/29       up         up        
GigabitEthernet0/0/1              192.168.1.129/30     up         up        
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         192.168.1.97/27      up         up(s)     
NULL0                             unassigned           up         up(s) 

//.改名字配IP

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]net    
[R3-ospf-1-area-0.0.0.0]network 192.168.1.3 0.0.0.0
//配ospf协议

[R3-GigabitEthernet0/0/0]ospf authentication-mode md5 1 cipher 12345

//加密

[R3-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher wlx12345

//加密

[R3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.128

[R3]ip route-static 192.168.1.0 25 NULL 0

//汇总防环

R4

[R4-GigabitEthernet0/0/0]ip add    
[R4-GigabitEthernet0/0/0]ip address 192.168.1.130 30
[R4-GigabitEthernet0/0/0]
Dec 28 2023 17:43:24-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 l0
[R4-LoopBack0]ip add    
[R4-LoopBack0]ip address 4.4.4.4 24

[R4]display ip interface brief 
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
GigabitEthernet0/0/0              192.168.1.130/30     up         up        
GigabitEthernet0/0/1              unassigned           down       down      
GigabitEthernet0/0/2              unassigned           down       down      
LoopBack0                         4.4.4.4/24           up         up(s)     
NULL0                             unassigned           up         up(s)     

//.改名字配IP

[R4]ospf 1 r    
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]net    
[R4-ospf-1]netw    
[R4-ospf-1]ne    
[R4-ospf-1]nexthop 
[R4-ospf-1]nexthop 
[R4-ospf-1]area 1
[R4-ospf-1-area-0.0.0.1]ne    
[R4-ospf-1-area-0.0.0.1]network 192.168.1.130 0.0.0.0

[R4-ospf-1]de    
[R4-ospf-1]default-route-advertise al    
[R4-ospf-1]default-route-advertise always 

//配ospf协议

[R4-ospf-1-area-0.0.0.1]authentication-mode md5 1 cipher wlx12345

//加密

7.测试

  • 31
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值