ospf实验

拓扑图

需求

1 整个网络使用192.168.1.0/24进行地址分配

2 area 0中r1为DR,r2为BDR

3 r3与r4之间使用密文认证,密码为Admin@huawei.com

4 r1,r2,r5上各自配置一个环回接口。r1和r2的环回接口可以宣告到ospf网络

5 设备RID为每台设备的编号

6全网可达

需求分析

1 先进行网段的分化

2 配置ip 启动ospf协议

3 使用密文认证 area 0中r1为DR,r2为BDR

4 对r5配置缺省路由

实验步骤

1 进行网段的划分已知图中有3个广播域 再加上环回就为6个广播域。把r3 r4 r5之间的网段看作成一个骨干所以划分5个广播域。骨干为 192.168.1.0/27将骨干再划分别为192.168.1.0/30 192.168.1.4/30

2配置ip

3 启动ospf协议使用密文认证area 0中r1为DR,r2为BDR

area 0中r1为DR,r2为BDR

[r1]display ospf peer 

	 OSPF Process 1 with Router ID 192.168.1.130
		 Neighbors 

 Area 0.0.0.0 interface 192.168.1.130(GigabitEthernet0/0/0)'s neighbors
 Router ID: 3.3.3.3          Address: 192.168.1.129   
   State: Full  Mode:Nbr is  Slave  Priority: 1
   DR: 192.168.1.130  BDR: 192.168.1.131  MTU: 0    
   Dead timer due in 40  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:19:24     
   Authentication Sequence: [ 0 ] 

 Router ID: 2.2.2.2          Address: 192.168.1.131   
   State: Full  Mode:Nbr is  Slave  Priority: 1
   DR: 192.168.1.130  BDR: 192.168.1.131  MTU: 0    
   Dead timer due in 40  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:21:30     
   Authentication Sequence: [ 0 ] 

4 实验结果

<r1>dis	
<r1>display os	
<r1>display ospf p	
<r1>display ospf peer b

	 OSPF Process 1 with Router ID 192.168.1.130
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             3.3.3.3          Full        
 0.0.0.0          GigabitEthernet0/0/0             2.2.2.2          Full        
 ----------------------------------------------------------------------------
[r2]display ospf peer b

	 OSPF Process 1 with Router ID 2.2.2.2
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             3.3.3.3          Full        
 0.0.0.0          GigabitEthernet0/0/0             192.168.1.130    Full        
 ----------------------------------------------------------------------------

<r3>display ospf peer b

	 OSPF Process 1 with Router ID 3.3.3.3
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          GigabitEthernet0/0/0             192.168.1.130    Full        
 0.0.0.0          GigabitEthernet0/0/0             2.2.2.2          Full        
 0.0.0.1          GigabitEthernet0/0/1             4.4.4.4          Full        
 ----------------------------------------------------------------------------
<r3>
[r4-ospf-1]display ospf peer b

	 OSPF Process 1 with Router ID 4.4.4.4
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.1          GigabitEthernet0/0/0             3.3.3.3          Full        
 0.0.0.1          GigabitEthernet0/0/1             5.5.5.5          Full        
 ----------------------------------------------------------------------------
[r4-ospf-1]
[r5-ospf-1]display ospf peer b

	 OSPF Process 1 with Router ID 5.5.5.5
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.1          GigabitEthernet0/0/0             4.4.4.4          Full        
 ----------------------------------------------------------------------------
[r5-ospf-1]

缺省路由

[r5-ospf-1]
Jul 26 2024 10:01:49-08:00 r5 %%01OSPF/4/NBR_CHANGE_E(l)[7]:Neighbor changes eve
nt: neighbor status changed. (ProcessId=256, NeighborAddress=5.1.168.192, Neighb
orEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrentState=Full) 
[r5-ospf-1]default-route-advertise always
[r5-ospf-1]default-route-advertise always

5 全网可达

用r1 ping r4

<r1>ping 192.168.1.2
  PING 192.168.1.2: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.2: bytes=56 Sequence=1 ttl=254 time=90 ms
    Reply from 192.168.1.2: bytes=56 Sequence=2 ttl=254 time=50 ms
    Reply from 192.168.1.2: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 192.168.1.2: bytes=56 Sequence=4 ttl=254 time=80 ms
    Reply from 192.168.1.2: bytes=56 Sequence=5 ttl=254 time=50 ms

  --- 192.168.1.2 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/62/90 ms

<r1>

用r1 ping r5

<r1>ping 192.168.1.6
  PING 192.168.1.6: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.6: bytes=56 Sequence=1 ttl=253 time=70 ms
    Reply from 192.168.1.6: bytes=56 Sequence=2 ttl=253 time=80 ms
    Reply from 192.168.1.6: bytes=56 Sequence=3 ttl=253 time=40 ms
    Reply from 192.168.1.6: bytes=56 Sequence=4 ttl=253 time=70 ms
    Reply from 192.168.1.6: bytes=56 Sequence=5 ttl=253 time=40 ms

  --- 192.168.1.6 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/60/80 ms

用r1ping r5环回

[r1]ping 192.168.1.97
  PING 192.168.1.97: 56  data bytes, press CTRL_C to break
    Reply from 192.168.1.97: bytes=56 Sequence=1 ttl=253 time=80 ms
    Reply from 192.168.1.97: bytes=56 Sequence=2 ttl=253 time=40 ms
    Reply from 192.168.1.97: bytes=56 Sequence=3 ttl=253 time=40 ms
    Reply from 192.168.1.97: bytes=56 Sequence=4 ttl=253 time=70 ms
    Reply from 192.168.1.97: bytes=56 Sequence=5 ttl=253 time=60 ms

  --- 192.168.1.97 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 40/58/80 ms

以此类推故全网可达

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值