amwdnuff 发表于 2009-9-25 22:34

华为命令全集

华为命令全集
交换机命令
~~~~~~~~~~
dis cur       ;显示当前配置
display current-configuration current 当前的       ;显示当前配置
display interfaces       ;显示接口信息
display vlan all       ;显示路由信息
display version       ;显示版本信息
super password simple <password> ;修改特权用户密码
sysname <name> ;交换机命名
interface ethernet0/1 ;进入接口视图
int e0/1 ;简写方式
interface vlan-interface <n> ;进入接口视图
int vlan <n> ;简写方式,n<6
ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址
ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关
rip ;三层交换支持
local-user ftp ;建立ftp用户
user-interface vty 0 4 ;进入虚拟终端
authentication-mode password ;设置口令模式
set authentication-mode password simple 222 ;设置口令
user privilege level 3 ;用户级别
interface ethernet0/1 ;进入端口模式
int e0/1 ;进入端口模式
duplex {half|full|auto} ;配置端口工作状态
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       ;简写方式
monitor-port <interface>  ;指定镜像端口
port mirror <interface>    ;指定被镜像端口
port mirror <if_list> observing-port <ifterface> ;指定镜像和被镜像
例如:
port mirror e0/1 to e0/4 observing-port e0/7 ;指定镜像和被镜像
description string      ;指定VLAN描述字符
description         ;删除VLAN描述字符
display vlan ;查看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 ; 始端口为通道号
isolate-user-vlan enable      ;设置主vlan
isolate-user-vlan <n> secondary <list>      ;设主vlan包括的子vlan
port hybrid pvid vlan <id>      ;设置vlan的pvid
undo port hybrid pvid      ;删除vlan的pvid
port hybrid vlan vlan_id_list untagged  ;设置无标识的vlan
如果数据包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。
所以设置PVID为所属vlan id, 设置可以互通的vlan为untagged。
----------------------------------------
路由器命令
~~~~~~~~~~
display version       ;显示版本信息
display current-configuration       ;显示当前配置
display interfaces       ;显示接口信息
display ip route       ;显示路由信息
sysname <hostname>       ;更改主机名
super passwrod <password>       ;设置口令
int s0/0       ;进入接口
clock rate 64000      ;设置同步时钟
ip address <ip> <mask|mask_len>      ;配置端口IP地址
例:
ip address 10.65.1.1 255.255.0.0      ;或
ip address 10.65.1.1 16      ;
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
ROUTER
DISPLAY ? (显示系统可用命令\\或显示信息)
display history-commamd (显历史命令)
language (中英文显示方式切换)
tracert IP (测试数据包从主机从发送主机到目的地所经地的网关)
link-protocol hdlc (在接口上封装HDLC协议)
timer hold (keepalive取值为0~32767)
debugging hdlc all serial0       ;显示所有信息
debugging hdlc event serial0       ;调试事件信息
debugging hdlc packet serial0       ;显示包的信息
静态路由:
ip route-static <ip><mask>{interface number|nexthop}
例如:
ip route-static 129.1.0.0 16 10.0.0.2
ip route-static 129.1.0.0 255.255.0.0 10.0.0.2
ip route-static 129.1.0.0 16 Serial 2
ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
动态路由:
rip ;设置动态路由
rip work ;设置工作允许
rip input ;设置入口允许
rip output ;设置出口允许
network 10.0.0.0       ;设置交换路由网络
network all ;设置与所有网络交换
peer ip-address ;指定交换点
summary ;路由聚合
rip version 1 ;设置工作在版本1
rip version 2 multicast ;设版本2,多播方式
rip split-horizon ;水平分隔
router id A.B.C.D ;配置路由器的ID
ospf enable ;启动OSPF协议
import-route direct ;引入直联路由
ospf enable area <area_id> ;配置OSPF区域
标准访问列表命令格式如下:
acl number <acl-number> ;默认前者顺序匹配。
rule {permit|deny} source <s_ip> <s-wildcard|any]
例:
acl number 2001
rule normal permit source 10.0.0.0 0.0.0.255
rule normal deny source any
扩展访问控制列表配置命令
配置TCP/UDP协议的扩展访问列表:
rule {normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any}

配置ICMP协议的扩展访问列

PPP典型配置实例
routerA PAP验证主验证方
link-protocol ppp
local-user xxx password simple xxx
ppp authentication-mode pap
routerB PAP被验证方
link ppp
ppp pap local-user xxx password simple xxx

chap典型配置实例
routerA chap主验证方
local-user quidway2 password simple xxx
ppp chap user Quidway1
ppp authentication-mode chap
routerB被验证方
local-user quidway1 password simple xxx
ppp chap user Quidway2

MP典型配置举例
1、router-a的E1口两个B信道绑定到router-b的B信道上,另两个B信道绑定到router-c(假定router-a有四个B信道)
配置router-a:
!增加两个用ROUTER-B和ROUTER-C
local-user router-b password simple router-b
local-user router-c password simple router-c
!为这两个用户指定虚拟接口模板,将使用该模板的NCP信息进行PPP协商
ppp user router-b bind virtual-template1
ppp user router-c bind virtual-template2
!配置虚拟接口模板
interface-virtual-template1
ip add 10.0.0.1 24
interface virtual-template2
ip add 10.0.1.1 24
!将接口S0、S1、S2、S3加入MP通道,以S0为例,其它接口做同样配置
interface s0
link-protocol ppp
ppp mp
ppp authentication-mode pap
ppp pap local-user router-a password simple router-a

配置router-b:
!增加一个用户router-a
local-user router-a password simple router-a
!为这个用户指定虚拟模板,将使用该模板的NCP信息进行PPP协商
ppp mp user router-a bind virtual-template 1
!配置虚拟接口模板的工作参数
interface virtual-template 1
ip add 10.0.0.2 24
!将接口S0、S1加入MP通道,以S0为例。
interface s0
ppp mp
ppp authentication-mode pap
ppp pap local-user router-b password simple router-b
router-c与router-b配置相同
display user (显示PPP验证的本地用户)






X.25的配置
link-protocol x25 { | } (配置X25的工作方式)
x25 x121-address xxxxx (配置X121地址)
x25 map ip 10.0.0.1 x121-address xxxxx (创建远端协议地址和X121地址的映射)
x25 pvc 123 ip 10.0.0.1 x121-address xxxxx (创建永久虚电路同时隐含地创建一条地址映射)
x25 vc-range {in-channel hic lic | bi-channel htc ltc | out-channel hoc loc} (配置虚电路范围最多4095条,1-4095)
x25 packet-size in-packets (配置分组大小,缺省值为128)
x25 packet-size out-packets (配置分组大小,缺省值为128)
x25 window-size in-packets (配置窗口大小,缺省为2)
x25 window-size out-packets (配置窗口大小,缺省为2)
x25 modulo {8 | 128} (配置编号方式,缺省值为8)
interface serial number subinterface-number (创建虚拟子接口)
display x25 alias-policy (查看x25别名表)
display x25 map (查看X25地址映射表)
disp x25 switch-vc-table svc (查看X25交换路由表)
disp x25 vc lci-number(查看X25虚电路)
debug x25 all   (打开所有X25报文的调试开关)
debug x25 event (打开X25的调试开关)
debug x25 packet (打开X25报文调试开关)

x25典型配置举例
routerA
int s0
ip add 10.0.0.1 24
link-protocol x25 dte (将该接口封装为X25接口,并指定其工作方式在DTE方式)
x25 x121-address 12345(指定该接口的X121地址)
x25 map ip 10.0.0.2 x121-address 54321(指定到对端的地址映射)
x25 packet-size 1024 1024(设定流量控制参数为1024K)
x25 window-size 5 5

routerB
ip add 10.0.0.2 24
link-protocol x25 dte (如果是背到背的电缆相连需要改成DCE)
x25 x121-address 54321
x25 map ip 10.0.0.1 x121-address 12345
x25 packet-size 1024 1024
x25 window-size



帧中继的配置
link-protocol frame-relay (封装帧中继协议)
frame-relay interface-type (配置帧中继接口的终端类型)
frame-relay lmi type (选择LMI类型)
frame-relay {ip|ipx} protocol-address dlci  (手工配置静态映射)
fr inarp  (动态建立:使能动态逆向地址解析协议)
interface type number subinterface-number  (创建帧中继子接口,进入子接口配置模式)
fr dlci dlci (配置帧中继子接口的虚电路号)
fr switching (允许帧中继进行PVC交换)
fr interface-type (设置帧中继接口类型)
fr dlci-switch pvc in-dlci interface serial number out-dlci (配置帧中继PVC交换的路由)
disp fr lmi-info (显示帧中继LMI类型报文的收发统计)
disp fr map-info (显示协议地址与帧中继地址映射表)
disp fr pvc-info   (显示帧中继PVC统计信息)
disp fr dlci-switch   (显示帧中继PVC路由表)
disp fr interface    (显示各接口的帧中继协议状态)
reset fr inarp-info   (清除所有动态建立的帧中继地址映射)
debugging fr all   (打开帧中继的所有报文调试开关)
debugging fr arp   (打开帧中继ARP报文信息调试开关)
debugging fr event  (打开帧中继事件信息调试开关)
debugging fr lmi   (打开帧中继LMI协议信息调试开关)

帧中继典型配置举例(通帧中继网络互连局域网)
RouterA (对B、C)
fr switching
ip add 10.0.0.1 24
link-protocol fr (封装为帧中继)
fr interface-type dte (设定工作方式)
fr inarp (如果对端路由器支持逆向地址解析功能,则动态地址映射)
fr map ip 10.0.0.2 dlci 10 (否则静态地址映射)
fr map ip 10.0.0.3 dlci 20

RouterB
ip add 10.0.0.2 24
link-protocol fr
fr interface-type dte
fr inarp
fr map ip 10.0.0.1 dlci 30

RouterC
ip add 10.0.0.3 24
link-protocol fr
fr interface-type dte
fr inarp
fr map ip 10.0.0.1 dlci 40

amwdnuff 发表于 2009-9-25 22:34

华为命令全集

华为命令全集
交换机命令
~~~~~~~~~~
dis cur       ;显示当前配置
display current-configuration current 当前的       ;显示当前配置
display interfaces       ;显示接口信息
display vlan all       ;显示路由信息
display version       ;显示版本信息
super password simple <password> ;修改特权用户密码
sysname <name> ;交换机命名
interface ethernet0/1 ;进入接口视图
int e0/1 ;简写方式
interface vlan-interface <n> ;进入接口视图
int vlan <n> ;简写方式,n<6
ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址
ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关
rip ;三层交换支持
local-user ftp ;建立ftp用户
user-interface vty 0 4 ;进入虚拟终端
authentication-mode password ;设置口令模式
set authentication-mode password simple 222 ;设置口令
user privilege level 3 ;用户级别
interface ethernet0/1 ;进入端口模式
int e0/1 ;进入端口模式
duplex {half|full|auto} ;配置端口工作状态
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       ;简写方式
monitor-port <interface>  ;指定镜像端口
port mirror <interface>    ;指定被镜像端口
port mirror <if_list> observing-port <ifterface> ;指定镜像和被镜像
例如:
port mirror e0/1 to e0/4 observing-port e0/7 ;指定镜像和被镜像
description string      ;指定VLAN描述字符
description         ;删除VLAN描述字符
display vlan ;查看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 ; 始端口为通道号
isolate-user-vlan enable      ;设置主vlan
isolate-user-vlan <n> secondary <list>      ;设主vlan包括的子vlan
port hybrid pvid vlan <id>      ;设置vlan的pvid
undo port hybrid pvid      ;删除vlan的pvid
port hybrid vlan vlan_id_list untagged  ;设置无标识的vlan
如果数据包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。
所以设置PVID为所属vlan id, 设置可以互通的vlan为untagged。
----------------------------------------
路由器命令
~~~~~~~~~~
display version       ;显示版本信息
display current-configuration       ;显示当前配置
display interfaces       ;显示接口信息
display ip route       ;显示路由信息
sysname <hostname>       ;更改主机名
super passwrod <password>       ;设置口令
int s0/0       ;进入接口
clock rate 64000      ;设置同步时钟
ip address <ip> <mask|mask_len>      ;配置端口IP地址
例:
ip address 10.65.1.1 255.255.0.0      ;或
ip address 10.65.1.1 16      ;
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
ROUTER
DISPLAY ? (显示系统可用命令\\或显示信息)
display history-commamd (显历史命令)
language (中英文显示方式切换)
tracert IP (测试数据包从主机从发送主机到目的地所经地的网关)
link-protocol hdlc (在接口上封装HDLC协议)
timer hold (keepalive取值为0~32767)
debugging hdlc all serial0       ;显示所有信息
debugging hdlc event serial0       ;调试事件信息
debugging hdlc packet serial0       ;显示包的信息
静态路由:
ip route-static <ip><mask>{interface number|nexthop}
例如:
ip route-static 129.1.0.0 16 10.0.0.2
ip route-static 129.1.0.0 255.255.0.0 10.0.0.2
ip route-static 129.1.0.0 16 Serial 2
ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
动态路由:
rip ;设置动态路由
rip work ;设置工作允许
rip input ;设置入口允许
rip output ;设置出口允许
network 10.0.0.0       ;设置交换路由网络
network all ;设置与所有网络交换
peer ip-address ;指定交换点
summary ;路由聚合
rip version 1 ;设置工作在版本1
rip version 2 multicast ;设版本2,多播方式
rip split-horizon ;水平分隔
router id A.B.C.D ;配置路由器的ID
ospf enable ;启动OSPF协议
import-route direct ;引入直联路由
ospf enable area <area_id> ;配置OSPF区域
标准访问列表命令格式如下:
acl number <acl-number> ;默认前者顺序匹配。
rule {permit|deny} source <s_ip> <s-wildcard|any]
例:
acl number 2001
rule normal permit source 10.0.0.0 0.0.0.255
rule normal deny source any
扩展访问控制列表配置命令
配置TCP/UDP协议的扩展访问列表:
rule {normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any}

配置ICMP协议的扩展访问列

PPP典型配置实例
routerA PAP验证主验证方
link-protocol ppp
local-user xxx password simple xxx
ppp authentication-mode pap
routerB PAP被验证方
link ppp
ppp pap local-user xxx password simple xxx

chap典型配置实例
routerA chap主验证方
local-user quidway2 password simple xxx
ppp chap user Quidway1
ppp authentication-mode chap
routerB被验证方
local-user quidway1 password simple xxx
ppp chap user Quidway2

MP典型配置举例
1、router-a的E1口两个B信道绑定到router-b的B信道上,另两个B信道绑定到router-c(假定router-a有四个B信道)
配置router-a:
!增加两个用ROUTER-B和ROUTER-C
local-user router-b password simple router-b
local-user router-c password simple router-c
!为这两个用户指定虚拟接口模板,将使用该模板的NCP信息进行PPP协商
ppp user router-b bind virtual-template1
ppp user router-c bind virtual-template2
!配置虚拟接口模板
interface-virtual-template1
ip add 10.0.0.1 24
interface virtual-template2
ip add 10.0.1.1 24
!将接口S0、S1、S2、S3加入MP通道,以S0为例,其它接口做同样配置
interface s0
link-protocol ppp
ppp mp
ppp authentication-mode pap
ppp pap local-user router-a password simple router-a

配置router-b:
!增加一个用户router-a
local-user router-a password simple router-a
!为这个用户指定虚拟模板,将使用该模板的NCP信息进行PPP协商
ppp mp user router-a bind virtual-template 1
!配置虚拟接口模板的工作参数
interface virtual-template 1
ip add 10.0.0.2 24
!将接口S0、S1加入MP通道,以S0为例。
interface s0
ppp mp
ppp authentication-mode pap
ppp pap local-user router-b password simple router-b
router-c与router-b配置相同
display user (显示PPP验证的本地用户)






X.25的配置
link-protocol x25 { | } (配置X25的工作方式)
x25 x121-address xxxxx (配置X121地址)
x25 map ip 10.0.0.1 x121-address xxxxx (创建远端协议地址和X121地址的映射)
x25 pvc 123 ip 10.0.0.1 x121-address xxxxx (创建永久虚电路同时隐含地创建一条地址映射)
x25 vc-range {in-channel hic lic | bi-channel htc ltc | out-channel hoc loc} (配置虚电路范围最多4095条,1-4095)
x25 packet-size in-packets (配置分组大小,缺省值为128)
x25 packet-size out-packets (配置分组大小,缺省值为128)
x25 window-size in-packets (配置窗口大小,缺省为2)
x25 window-size out-packets (配置窗口大小,缺省为2)
x25 modulo {8 | 128} (配置编号方式,缺省值为8)
interface serial number subinterface-number (创建虚拟子接口)
display x25 alias-policy (查看x25别名表)
display x25 map (查看X25地址映射表)
disp x25 switch-vc-table svc (查看X25交换路由表)
disp x25 vc lci-number(查看X25虚电路)
debug x25 all   (打开所有X25报文的调试开关)
debug x25 event (打开X25的调试开关)
debug x25 packet (打开X25报文调试开关)

x25典型配置举例
routerA
int s0
ip add 10.0.0.1 24
link-protocol x25 dte (将该接口封装为X25接口,并指定其工作方式在DTE方式)
x25 x121-address 12345(指定该接口的X121地址)
x25 map ip 10.0.0.2 x121-address 54321(指定到对端的地址映射)
x25 packet-size 1024 1024(设定流量控制参数为1024K)
x25 window-size 5 5

routerB
ip add 10.0.0.2 24
link-protocol x25 dte (如果是背到背的电缆相连需要改成DCE)
x25 x121-address 54321
x25 map ip 10.0.0.1 x121-address 12345
x25 packet-size 1024 1024
x25 window-size



帧中继的配置
link-protocol frame-relay (封装帧中继协议)
frame-relay interface-type (配置帧中继接口的终端类型)
frame-relay lmi type (选择LMI类型)
frame-relay {ip|ipx} protocol-address dlci  (手工配置静态映射)
fr inarp  (动态建立:使能动态逆向地址解析协议)
interface type number subinterface-number  (创建帧中继子接口,进入子接口配置模式)
fr dlci dlci (配置帧中继子接口的虚电路号)
fr switching (允许帧中继进行PVC交换)
fr interface-type (设置帧中继接口类型)
fr dlci-switch pvc in-dlci interface serial number out-dlci (配置帧中继PVC交换的路由)
disp fr lmi-info (显示帧中继LMI类型报文的收发统计)
disp fr map-info (显示协议地址与帧中继地址映射表)
disp fr pvc-info   (显示帧中继PVC统计信息)
disp fr dlci-switch   (显示帧中继PVC路由表)
disp fr interface    (显示各接口的帧中继协议状态)
reset fr inarp-info   (清除所有动态建立的帧中继地址映射)
debugging fr all   (打开帧中继的所有报文调试开关)
debugging fr arp   (打开帧中继ARP报文信息调试开关)
debugging fr event  (打开帧中继事件信息调试开关)
debugging fr lmi   (打开帧中继LMI协议信息调试开关)

帧中继典型配置举例(通帧中继网络互连局域网)
RouterA (对B、C)
fr switching
ip add 10.0.0.1 24
link-protocol fr (封装为帧中继)
fr interface-type dte (设定工作方式)
fr inarp (如果对端路由器支持逆向地址解析功能,则动态地址映射)
fr map ip 10.0.0.2 dlci 10 (否则静态地址映射)
fr map ip 10.0.0.3 dlci 20

RouterB
ip add 10.0.0.2 24
link-protocol fr
fr interface-type dte
fr inarp
fr map ip 10.0.0.1 dlci 30

RouterC
ip add 10.0.0.3 24
link-protocol fr
fr interface-type dte
fr inarp
fr map ip 10.0.0.1 dlci 40

amwdnuff 发表于 2009-9-25 22:34

华为命令全集

华为命令全集
交换机命令
~~~~~~~~~~
dis cur       ;显示当前配置
display current-configuration current 当前的       ;显示当前配置
display interfaces       ;显示接口信息
display vlan all       ;显示路由信息
display version       ;显示版本信息
super password simple <password> ;修改特权用户密码
sysname <name> ;交换机命名
interface ethernet0/1 ;进入接口视图
int e0/1 ;简写方式
interface vlan-interface <n> ;进入接口视图
int vlan <n> ;简写方式,n<6
ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址
ip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;静态路由=网关
rip ;三层交换支持
local-user ftp ;建立ftp用户
user-interface vty 0 4 ;进入虚拟终端
authentication-mode password ;设置口令模式
set authentication-mode password simple 222 ;设置口令
user privilege level 3 ;用户级别
interface ethernet0/1 ;进入端口模式
int e0/1 ;进入端口模式
duplex {half|full|auto} ;配置端口工作状态
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       ;简写方式
monitor-port <interface>  ;指定镜像端口
port mirror <interface>    ;指定被镜像端口
port mirror <if_list> observing-port <ifterface> ;指定镜像和被镜像
例如:
port mirror e0/1 to e0/4 observing-port e0/7 ;指定镜像和被镜像
description string      ;指定VLAN描述字符
description         ;删除VLAN描述字符
display vlan ;查看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 ; 始端口为通道号
isolate-user-vlan enable      ;设置主vlan
isolate-user-vlan <n> secondary <list>      ;设主vlan包括的子vlan
port hybrid pvid vlan <id>      ;设置vlan的pvid
undo port hybrid pvid      ;删除vlan的pvid
port hybrid vlan vlan_id_list untagged  ;设置无标识的vlan
如果数据包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。
所以设置PVID为所属vlan id, 设置可以互通的vlan为untagged。
----------------------------------------
路由器命令
~~~~~~~~~~
display version       ;显示版本信息
display current-configuration       ;显示当前配置
display interfaces       ;显示接口信息
display ip route       ;显示路由信息
sysname <hostname>       ;更改主机名
super passwrod <password>       ;设置口令
int s0/0       ;进入接口
clock rate 64000      ;设置同步时钟
ip address <ip> <mask|mask_len>      ;配置端口IP地址
例:
ip address 10.65.1.1 255.255.0.0      ;或
ip address 10.65.1.1 16      ;
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
ROUTER
DISPLAY ? (显示系统可用命令\\或显示信息)
display history-commamd (显历史命令)
language (中英文显示方式切换)
tracert IP (测试数据包从主机从发送主机到目的地所经地的网关)
link-protocol hdlc (在接口上封装HDLC协议)
timer hold (keepalive取值为0~32767)
debugging hdlc all serial0       ;显示所有信息
debugging hdlc event serial0       ;调试事件信息
debugging hdlc packet serial0       ;显示包的信息
静态路由:
ip route-static <ip><mask>{interface number|nexthop}
例如:
ip route-static 129.1.0.0 16 10.0.0.2
ip route-static 129.1.0.0 255.255.0.0 10.0.0.2
ip route-static 129.1.0.0 16 Serial 2
ip route-static 0.0.0.0 0.0.0.0 10.0.0.2
动态路由:
rip ;设置动态路由
rip work ;设置工作允许
rip input ;设置入口允许
rip output ;设置出口允许
network 10.0.0.0       ;设置交换路由网络
network all ;设置与所有网络交换
peer ip-address ;指定交换点
summary ;路由聚合
rip version 1 ;设置工作在版本1
rip version 2 multicast ;设版本2,多播方式
rip split-horizon ;水平分隔
router id A.B.C.D ;配置路由器的ID
ospf enable ;启动OSPF协议
import-route direct ;引入直联路由
ospf enable area <area_id> ;配置OSPF区域
标准访问列表命令格式如下:
acl number <acl-number> ;默认前者顺序匹配。
rule {permit|deny} source <s_ip> <s-wildcard|any]
例:
acl number 2001
rule normal permit source 10.0.0.0 0.0.0.255
rule normal deny source any
扩展访问控制列表配置命令
配置TCP/UDP协议的扩展访问列表:
rule {normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any}

配置ICMP协议的扩展访问列

PPP典型配置实例
routerA PAP验证主验证方
link-protocol ppp
local-user xxx password simple xxx
ppp authentication-mode pap
routerB PAP被验证方
link ppp
ppp pap local-user xxx password simple xxx

chap典型配置实例
routerA chap主验证方
local-user quidway2 password simple xxx
ppp chap user Quidway1
ppp authentication-mode chap
routerB被验证方
local-user quidway1 password simple xxx
ppp chap user Quidway2

MP典型配置举例
1、router-a的E1口两个B信道绑定到router-b的B信道上,另两个B信道绑定到router-c(假定router-a有四个B信道)
配置router-a:
!增加两个用ROUTER-B和ROUTER-C
local-user router-b password simple router-b
local-user router-c password simple router-c
!为这两个用户指定虚拟接口模板,将使用该模板的NCP信息进行PPP协商
ppp user router-b bind virtual-template1
ppp user router-c bind virtual-template2
!配置虚拟接口模板
interface-virtual-template1
ip add 10.0.0.1 24
interface virtual-template2
ip add 10.0.1.1 24
!将接口S0、S1、S2、S3加入MP通道,以S0为例,其它接口做同样配置
interface s0
link-protocol ppp
ppp mp
ppp authentication-mode pap
ppp pap local-user router-a password simple router-a

配置router-b:
!增加一个用户router-a
local-user router-a password simple router-a
!为这个用户指定虚拟模板,将使用该模板的NCP信息进行PPP协商
ppp mp user router-a bind virtual-template 1
!配置虚拟接口模板的工作参数
interface virtual-template 1
ip add 10.0.0.2 24
!将接口S0、S1加入MP通道,以S0为例。
interface s0
ppp mp
ppp authentication-mode pap
ppp pap local-user router-b password simple router-b
router-c与router-b配置相同
display user (显示PPP验证的本地用户)






X.25的配置
link-protocol x25 { | } (配置X25的工作方式)
x25 x121-address xxxxx (配置X121地址)
x25 map ip 10.0.0.1 x121-address xxxxx (创建远端协议地址和X121地址的映射)
x25 pvc 123 ip 10.0.0.1 x121-address xxxxx (创建永久虚电路同时隐含地创建一条地址映射)
x25 vc-range {in-channel hic lic | bi-channel htc ltc | out-channel hoc loc} (配置虚电路范围最多4095条,1-4095)
x25 packet-size in-packets (配置分组大小,缺省值为128)
x25 packet-size out-packets (配置分组大小,缺省值为128)
x25 window-size in-packets (配置窗口大小,缺省为2)
x25 window-size out-packets (配置窗口大小,缺省为2)
x25 modulo {8 | 128} (配置编号方式,缺省值为8)
interface serial number subinterface-number (创建虚拟子接口)
display x25 alias-policy (查看x25别名表)
display x25 map (查看X25地址映射表)
disp x25 switch-vc-table svc (查看X25交换路由表)
disp x25 vc lci-number(查看X25虚电路)
debug x25 all   (打开所有X25报文的调试开关)
debug x25 event (打开X25的调试开关)
debug x25 packet (打开X25报文调试开关)

x25典型配置举例
routerA
int s0
ip add 10.0.0.1 24
link-protocol x25 dte (将该接口封装为X25接口,并指定其工作方式在DTE方式)
x25 x121-address 12345(指定该接口的X121地址)
x25 map ip 10.0.0.2 x121-address 54321(指定到对端的地址映射)
x25 packet-size 1024 1024(设定流量控制参数为1024K)
x25 window-size 5 5

routerB
ip add 10.0.0.2 24
link-protocol x25 dte (如果是背到背的电缆相连需要改成DCE)
x25 x121-address 54321
x25 map ip 10.0.0.1 x121-address 12345
x25 packet-size 1024 1024
x25 window-size



帧中继的配置
link-protocol frame-relay (封装帧中继协议)
frame-relay interface-type (配置帧中继接口的终端类型)
frame-relay lmi type (选择LMI类型)
frame-relay {ip|ipx} protocol-address dlci  (手工配置静态映射)
fr inarp  (动态建立:使能动态逆向地址解析协议)
interface type number subinterface-number  (创建帧中继子接口,进入子接口配置模式)
fr dlci dlci (配置帧中继子接口的虚电路号)
fr switching (允许帧中继进行PVC交换)
fr interface-type (设置帧中继接口类型)
fr dlci-switch pvc in-dlci interface serial number out-dlci (配置帧中继PVC交换的路由)
disp fr lmi-info (显示帧中继LMI类型报文的收发统计)
disp fr map-info (显示协议地址与帧中继地址映射表)
disp fr pvc-info   (显示帧中继PVC统计信息)
disp fr dlci-switch   (显示帧中继PVC路由表)
disp fr interface    (显示各接口的帧中继协议状态)
reset fr inarp-info   (清除所有动态建立的帧中继地址映射)
debugging fr all   (打开帧中继的所有报文调试开关)
debugging fr arp   (打开帧中继ARP报文信息调试开关)
debugging fr event  (打开帧中继事件信息调试开关)
debugging fr lmi   (打开帧中继LMI协议信息调试开关)

帧中继典型配置举例(通帧中继网络互连局域网)
RouterA (对B、C)
fr switching
ip add 10.0.0.1 24
link-protocol fr (封装为帧中继)
fr interface-type dte (设定工作方式)
fr inarp (如果对端路由器支持逆向地址解析功能,则动态地址映射)
fr map ip 10.0.0.2 dlci 10 (否则静态地址映射)
fr map ip 10.0.0.3 dlci 20

RouterB
ip add 10.0.0.2 24
link-protocol fr
fr interface-type dte
fr inarp
fr map ip 10.0.0.1 dlci 30

RouterC
ip add 10.0.0.3 24
link-protocol fr
fr interface-type dte
fr inarp
fr map ip 10.0.0.1 dlci 40
页: [1]
查看完整版本: 华为命令全集