H3C設備之OSPF的配置

本文主要是爲了方便那些不熟悉H3C命令的朋友,可以快速掌握H3C OSPF的配置,關於本文中所涉及的理論及OSPF的相關細節分析,請參考OSPF多區域數據流分析http://tangfangxiao.blog.51cto.com/2116646/632997 
1、基本信息配置
2、鏈路配置及調測
3、OSPF多區域及RIP配置
4、OSPF重分佈外部路由下發缺省路由
5、OSPF特殊區域配置及路由彙總
6、OSPF虛鏈路
7、OSPF認證
8、OSPF調試命令
一.基本信息配置
<H3C>system-view        //進入系統視圖
[H3C]sysname RT3        //爲設備命名
[RT3]super password simple H3C //設置超級密碼
[RT3]local-user admin         //添加用戶
[RT3-luser-admin]password simple admin //爲用戶設定密碼
[RT3-luser-admin]service-type telnet    //指定用戶的類型
[RT3-luser-admin]quit                //返回上一級
[RT3]user-interface vty 0 4         //進入vty
[RT3-ui-vty0-4]set authentication password simple telnet
//設置遠程登錄認證,密碼爲telnet
[RT3-ui-vty0-4]idle-timeout 5  0  //配置超時退出時間
其它略
2、鏈路配置及調測
interface Serial0/2/0
ip address 10.1.13.2 255.255.255.252
undo shutdown         
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
undo shutdown 
interface Ethernet0/1/0
ip address 10.1.3.1 255.255.255.0
undo shutdown 
其它略
3、OSPF多區域及RIP配置
[RT3]
ospf 1 router-id 3.3.3.3              //配置OSPF ROUTER-ID
 silent-interface all             //配置全部端口爲被動接口
 undo silent-interface Serial0/2/0  //關閉此接口的被動接口
 undo silent-interface Serial0/2/2
 area 1         //OSPF區域,能夠寫成點分十進制 0.0.0.1
  network 3.3.3.3 0.0.0.0  //宣告OSPF的網段
  network 10.1.13.0 0.0.0.3
  network 10.1.3.0 0.0.0.255 
[RT1]
ospf 1 router-id 1.1.1.1       
 silent-interface all
 undo silent-interface Serial0/2/0
 undo silent-interface Serial0/2/2
 area 0
  network 10.0.15.0 0.0.0.3
  network 1.1.1.1 0.0.0.0
 area 1   
  network 10.1.13.0 0.0.0.3
    network 10.1.1.0 0.0.0.255
[RT5]
 ospf 1  router-id 5.5.5.5 
 silent-interface all
 undo silent-interface Serial0/2/0
 undo silent-interface Serial0/2/2      
 area 0 
  network 10.0.15.0 0.0.0.3
  network 5.5.5.5 0.0.0.0
  network 10.0.5.0 0.0.0.255
  network 10.0.56.0 0.0.0.3
[RT6]
ospf 1 router-id 6.6.6.6
 silent-interface all
 undo silent-interface Serial0/2/0
 undo silent-interface Serial0/2/2
 area 0  
   network 10.0.56.0 0.0.0.3
  network 6.6.6.6 0.0.0.0
 area 2   
  network 10.2.6.0 0.0.0.255
  network 10.2.26.0 0.0.0.3
[RT2]
ospf 1 router-id 2.2.2.2
 silent-interface all
 undo silent-interface Serial0/2/2
 area 2   
  network 10.2.26.0 0.0.0.3
  network 2.2.2.2 0.0.0.0
  network 10.2.2.1 0.0.0.255  
rip                //啓動RIP
 undo summary      //關閉自動彙總
 version 2         //RIPV2
 network 172.16.0.0  //宣告RIP的網段
 silent-interface all  //配置全部接口爲被動接口
 undo silent-interface Serial0/2/3 //將接口不設爲被動接口
[RT4]
rip            
 undo summary   
 version 2      
 network 172.16.0.0
 network 4.0.0.0
 silent-interface all
 undo silent-interface Serial0/2/1
 4、OSPF重分佈外部路由及下發缺省路由
[RT5]
ospf 1 
area 0
import-route direct cost 1000 type 2  //重分佈直連路由
 default-route-advertise always       //下發缺省路由
 default cost 2000              //指定缺省路由的COST爲2000
 default type 1             //指定下發的缺省路由爲類型1
[RT2]
ospf 1
area 2
 import-route rip 1 cost 1000   //重分佈RIP到OSPF
rip 
 import-route ospf 1 cost 5   //重分佈OSPF到RIP
5、OSPF特殊區域配置及路由彙總
[RT3]ospf 1
area 1
stub                            //配置爲STUB區域
[RT1]ospf 1
area 1 
stub no-summary                //配置徹底STUB區域
abr-summary 10.1.0.0 255.255.0.0  //區域內彙總
[RT6]ospf 1
area 2
nssa no-summary               //配置徹底NSSA區域
abr-summary 10.2.0.0 255.255.0.0  //區域內彙總
[RT2]ospf 1
area 2
nssa                      //配置NSSA區域
asbr-summary 172.16.0.0 255.255.0.0 cost 1000 //外部路由彙總
6、OSPF虛鏈路
<Sysname> system-view
[Sysname] ospf 100
[Sysname-ospf-100] area 2
[Sysname-ospf-100-area-0.0.0.2] vlink-peer 1.1.1.1 指定對方的ROUTER-ID
[Sysname-ospf-100-area-0.0.0.2]vlink-peer 1.1.1.1  md5 10 cipher H3C   虛鏈路MD5認證
vlink-peer 1.1.1.1  simple cipher H3C 虛鏈路明文認證
虛鏈路的另外一端也相似配置
display ospf vlink   //顯示虛鏈路
7、OSPF認證
[RT1]ospf 1
[RT1ospf-1]area 1
[RT1-ospf-1-area-0.0.0.1]authentication-mode md5
[RT1-ospf-1-area-0.0.0.1]quit
[RT1-ospf-1]quit
[RT1]int s0/2/0
[RT1-Serial0/2/0]ospf authentication-mode md5 10 cipher H3C 
[RT3]ospf 1
[RT3ospf-1]area 1
[RT3-ospf-1-area-0.0.0.1]authentication-mode md5
[RT3-ospf-1-area-0.0.0.1]quit
[RT3-ospf-1]quit
[RT3]int s0/2/0
[RT3-Serial0/2/0]ospf authentication-mode md5 10 cipher H3C 
或是採用明文認證,配置方法與上相似
authentication-mode simple
ospf authentication-mode simple cipher H3C
8、OSPF調測調試命令
display ospf brief    //顯示OSPF的摘要信息
display ospf cumulative  //OSPF的統計信息
display ospf interface   //顯示OSPF的接口信息
display ospf peer       //顯示OSPF的鄰居信息
display ospf lsdb      //顯示OSPF的LSDB
display ospf routing   //顯示OSPF的路由信息
display ospf error    //顯示OSPF的錯誤信息
reset ospf process    //重啓OSPF進程
其它命令
int e0/2/0
ospf cost 1000   //修改OSPF的COST值  COST=10的8次方/帶寬
ospf network broadcast|nbma |p2mp |p2p //修改OSPF的網絡類型
ospf dr-priority  10     //修改接口的優先級,缺省爲1
 
關於本文中所涉及的理論及OSPF的相關細節分析,請參考OSPF多區域數據流分析http://tangfangxiao.blog.51cto.com/2116646/632997
注意:如拓撲圖中,在RT2上重分佈RIP,H3C與CISCO是有區別的,在CISCO中,重分佈RIP後可以學習到172.16.24.0/30的外部路由,而在H3C中須要重分佈直連才能學習獲得。
H3C與CISCO的路由協議管理距離的區別:
CISCO
H3C
相關文章
相關標籤/搜索