OSPF基础实验配置

题目要求:

 首先第一步先配置分配ip

192.168.1.0/24  
192.168.1.0 000000  192.168.1.0/25    区域0 192.168.1.0/26   192.168.1.64/26 
192.168.1.1 000000  192.168.1.128/25 区域1 192.168.1.128/26 192.168.1.192/26

 接下来给每个路由器配置环回及IP

r1

 r2

 r3

r4

 

 第二步:给每个路由器接口配置ospf,为了减少路由条目,对两个区域的网段进行汇总

[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.1 0.0.0.0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.0
[r1-ospf-1-area-0.0.0.0]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.2 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 192.168.1.66 0.0.0.0
[r2-ospf-1-area-0.0.0.0]q
[r3]ospf 1 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.67 0.0.0.0
[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
[r3-ospf-1]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]abr-summary 192.168.1.128 255.255.255.128
[r3-ospf-1-area-0.0.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.130 0.0.0.0
[r4-ospf-1-area-0.0.0.1]q

因为r4环回不能宣告,则配置一条缺省

[r4-ospf-1]default-route-advertise always 

题目要求r3为DR设备,没有BDR,则把其他设备的优先级改为0,不参与选举

例如

[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 0

本来修改优先级后应在短时间内重庆ospf进程,但是优先级为0,0标识不参选,不用重启所有设备的ospf进程,直接选举完成,最后查看配置dsiplay ospf peer

[r3]display  ospf peer 
 
	 OSPF Process 1 with Router ID 3.3.3.3
		 Neighbors 
 
 Area 0.0.0.0 interface 192.168.1.3(GigabitEthernet0/0/0)'s neighbors
 Router ID: 1.1.1.1          Address: 192.168.1.1    
   State: Full  Mode:Nbr is  Slave  Priority: 0
   DR: 192.168.1.3  BDR: None   MTU: 0    
   Dead timer due in 33  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:00:57     
   Authentication Sequence: [ 0 ] 
 
 Router ID: 2.2.2.2          Address: 192.168.1.2    
   State: Full  Mode:Nbr is  Slave  Priority: 0
   DR: 192.168.1.3  BDR: None   MTU: 0    
   Dead timer due in 40  sec 
   Retrans timer interval: 6 
   Neighbor is up for 00:00:39     
   Authentication Sequence: [ 0 ] 

然后为了保证邻居间更新安全,邻居间密码和模式、编号必须完全一致

[r1]interface GigabitEthernet 0/0/0
[r1-GigabitEthernet0/0/0]ospf authentication-mode  md5 1 cipher 123456
[r2]interface GigabitEthernet 0/0/0
[r2-GigabitEthernet0/0/0]ospf authentication-mode  md5 1 cipher 123456
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ospf authentication-mode  md5 1 cipher 123456
[r3-GigabitEthernet0/0/0]q
[r3]interface GigabitEthernet 0/0/1
[r3-GigabitEthernet0/0/1]ospf authentication-mode  md5 1 cipher 123456
[r4]interface GigabitEthernet 0/0/0
[r4-GigabitEthernet0/0/0]ospf authentication-mode  md5 1 cipher 123456
 
 
 

最后为了避免环路需要配置空接口

[r1]ip route-static 192.168.1.0 26 NULL 0
[r2]ip route-static 192.168.1.64 26 NULL 0
[r3]ip route-static 192.168.1.96 26 NULL 0
[r4]ip route-static 192.168.1.128 26 NULL 0
 

实验完成。

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值