華爲常用命令

dis cur                                     
display current-configuration                  ;顯示當前配置
display interfaces                      
      ;顯示接口
display vlan all                               ;顯示路由信息
display version                         
      ;顯示版本信息

super password                                       ;修改特權用戶密碼
sysname                                      
;交換機命名
interface ethernet 0/1                              
;進入接口視圖
interface vlan x                              
;進入接口視圖
ip address 10.65.1.1 255.255.0.0    
;配置VLANIP地址

route-static 0.0.0.0 0.0.0.0 10.65.1.2            ;靜態路由=網關
]rip                                                 
;三層交換支持
local-user ftp

user-interface vty 0 4                               ;進入虛擬終端
authentication-mode password                
;設置口令模式
set authentication-mode password simple 222 
;設置口令(simple簡單的)
ser privilege level 3                      
;用戶級別(當用戶遠程登陸時,其默認級別爲1,不能作任何設置,3爲最高級別,可以作修改)

interface ethernet 0/1                               ;進入端口模式
int e0/1                                            
;進入端口模式
duplex {half|full|auto}                 
配置端口工作狀態(端口聚合時是全雙工,而CISCO的爲半雙工)
speed {10|100|auto}                  ;配置端口工作速率
flow-control                       
;配置端口流控
mdi {across|auto|normal}                
;配置端口平接扭接
port link-type {trunk|access|hybrid}    
;設置端口工作模式
port access vlan 3            
     ;當前端口加入到VLAN
port trunk permit vlan {ID|All}     
  ;設trunk允許的VLAN
port trunk pvid vlan 3    
     ;設置trunk端口的PVID
undo shutdown                      
;激活端口
shutdown                              
;關閉端口
quit                              
;返回

vlan 3                                         ;創建VLAN
port ethernet 0/1
                ;在VLAN中增加端口
port e0/1   
                             ;簡寫方式
port ethernet 0/1 to ethernet 0/4   
     ;在VLAN中增加端口
port e0/1 to e0/4   
                     ;簡寫方式

description string                              ;指定VLAN描述字符
description                          
        ;刪除VLAN描述字符
display vlan [vlan_id]                              
;查看VLAN設置

stp {enable|disable}                                 ;設置生成樹,默認關閉(思科是打開的)
stp priority 4096                         
     ;設置交換機的優先級
stp root {primary|secondary}              
     ;設置爲根或根的備份
stp cost 200                  
     ;設置交換機端口的花費

link-aggregation e0/1 to e0/4 ingress|both           ; 端口的聚合
undo link-aggregation e0/1|all                       ; 
始端口爲通道號

[SwitchA-vlanx]isolate-user-vlan enable                  ;設置主vlan
[SwitchA]isolate-user-vlan <x> secondary <list>    
     ;設置主vlan包括的子vlan
作用爲隔離主子VLAN間的主機訪問,在同一網段下,主子VLAN可以訪問,但是子VLAN間是不能訪問的,這是華爲的一個突色

[switcha]port-iaolate enable  這是隔離同一VLAN下的主機相互訪問,  isolate(隔離)
port hybrid pvid vlan <id>          ;設置vlanpvid
port hybrid pvid              
     ;刪除vlanpvid
port hybrid vlan vlan_id_list untagged
 ;設置無標識的vlan
如果包的vlan idPVId一致,則去掉vlan信息. 默認PVID=1
所以設置PVID爲所屬vlan id, 設置可以互通的vlanunta
display version                         
      ;顯示版本信息
display current-configuration           
      ;顯示當前配置
display interfaces                      
      ;顯示接口信息
display ip route                        
      ;顯示路由信息

sysname                                ;更改主機名
super passwrod                  
      ;設置口令
interface serial0                       
      ;進入接口
ip address <ip> <mask|mask_len> 
      ;配置端口IP地址
[]undo shutdown                   
      ;激活端口
link-protocol hdlc                      
      ;綁定hdlc協議
]user-interface vty 0 4
authentication-mode password
set authentication-mode password simple 222
user privilege level 3
quit

 hdlc all serial0                     ;顯示所有信息
debugging hdlc event serial0            
      ;調試事件信息
debugging hdlc packet serial0           
      ;顯示包的信息

靜態路由:
ip route-static <ip><mask>{interface number|nexthop}[value][reject|blackhole]
動態路由:
rip                                                 
;設置動態路由
]rip work                                            
;設置工作允許
rip input                                           
;設置入口允許
rip output                                          
;設置出口允許
network 1.0.0.0                      
      ;設置交換路由網絡
network all                                     
;設置與所有網絡交換
peer ip-address                                 

rip version 1                                       
;設置工作在版本1
rip version 2 multicast                             
;設版本2,多播方式
rip split-horizon                         
;水平分隔

router id                                   ;配置路由器的ID
ospf enable                                         
;啓動OSPF協議
import-route direct                            
;引入直聯路由
[Quidway-Serial0]ospf enable area <area_id>                  
;配置OSPF區域

標準訪問列表命令格式如下:
acl <acl-number> [match-order config|auto]                   
;默認前者順序匹配。
rule [normal|special]{permit|deny} [source source-addr source-wildcard|any]
擴展訪問控制列表配置命令
配置TCP/UDP協議的擴展訪問列表:
rule {normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any}
[operate]

配置ICMP協議的擴展訪問列表:
rule {normal|special}{permit|deny}icmp source {<ip wild>|any]destination {<ip wild>|any]
[icmp-code] [logging]

擴展訪問控制列表操作符的含義
equal portnumber                                       
;等於
greater-than portnumber                                       
;大於
less-than portnumber                                       
;小於
not-equal portnumber                                       
;不等
range portnumber1 portnumber2                                 
;區間

PPP設置:
[Quidway-s0]link-protocol ppp                                  ;
默認的協議

啓動ftp服務:
local-user ftp password {simple|cipher} aaa service-type ftp
ftp server enable

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章