OSPF 基本实验

OSPF 基本实验

ospf

配置命令

ospf 基本配置命令

# R3 ospf 配置
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255

R1

# R1 配置
<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]q
[R1]
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
[R1]ospf 1	
[R1-ospf-1]area 0	
[R1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255	
[R1-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
	
[R1-ospf-1]display ip routing-table 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 8        Routes : 8        

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

      127.0.0.0/8   Direct  0    0           D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0           D   127.0.0.1       InLoopBack0
    192.168.1.0/24  Direct  0    0           D   192.168.1.1     GigabitEthernet
0/0/0
    192.168.1.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/0
    192.168.2.0/24  Direct  0    0           D   192.168.2.1     GigabitEthernet
0/0/1
    192.168.2.1/32  Direct  0    0           D   127.0.0.1       GigabitEthernet
0/0/1
    192.168.3.0/24  OSPF    10   2           D   192.168.2.2     GigabitEthernet
0/0/1
    192.168.4.0/24  OSPF    10   3           D   192.168.2.2     GigabitEthernet
0/0/1
[R1-ospf-1]q
[R1]q
<R1>
<R1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
May 18 2021 21:48:54-08:00 R1 %%01CFM/4/SAVE(l)[8]:The user chose Y when decidin
g whether to save the configuration to the device.
Now saving the current configuration to the slot 17..
Save the configuration successfully.
<R1>

R2

# R2 OSPF 配置
[R2]ospf 1	
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.3.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]q
[R2-ospf-1]display ospf interface  # 查看ospf 通告

	 OSPF Process 1 with Router ID 192.168.2.2
		 Interfaces 

 Area: 0.0.0.0          (MPLS TE not enabled)
 IP Address      Type         State    Cost    Pri   DR              BDR 
 192.168.2.2     Broadcast    DR       1       1     192.168.2.2     192.168.2.1
 192.168.3.1     Broadcast    BDR      1       1     192.168.3.2     192.168.3.1
[R2-ospf-1]display ospf peer  # 查看 ospf 邻居

	 OSPF Process 1 with Router ID 192.168.2.2
		 Neighbors 

 Area 0.0.0.0 interface 192.168.2.2(GigabitEthernet0/0/0)'s neighbors
 Router ID: 192.168.1.1      Address: 192.168.2.1     
   State: Full  Mode:Nbr is  Slave  Priority: 1
   DR: 192.168.2.2  BDR: 192.168.2.1  MTU: 0    
   Dead timer due in 34  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:08:45     
   Authentication Sequence: [ 0 ] 

		 Neighbors 

 Area 0.0.0.0 interface 192.168.3.1(GigabitEthernet0/0/1)'s neighbors
 Router ID: 192.168.3.2      Address: 192.168.3.2     
   State: Full  Mode:Nbr is  Master  Priority: 1
   DR: 192.168.3.2  BDR: 192.168.3.1  MTU: 0    
   Dead timer due in 36  sec 
   Retrans timer interval: 5 
   Neighbor is up for 00:09:22     
   Authentication Sequence: [ 0 ] 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飘雪冰峰

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值