华为交换常用命令
上一篇 / 下一篇 2008-03-18 14:53:46 / 不允许评论 / 个人分类:职场人生
.在基于IOS的交换机上设置主机名/系统名:
lz%iQ&IX)lB0switch(config)# hostname hostname 移动通信网(MSCBSC)-jhEb.M\D%O#\
在基于CLI的交换机上设置主机名/系统名:
%y4r*L8M#{5z0switch(enable) set system name name-string 移动通信网(MSCBSC)m Z:?u.X
移动通信网(MSCBSC)r*z};C"hx7_w
2.在基于IOS的交换机上设置登录口令:
/nSw,y[W L!wS0switch(config)# enable password level 1 password 移动通信网(MSCBSC)3bH$n z)T-X
在基于CLI的交换机上设置登录口令:
#L%s)oy#C$Ga.I0switch(enable) set password 移动通信网(MSCBSC)"wf1K\1D$Uc
switch(enable) set enalbepass
{L&FF;Z,i1E:slz0移动通信网(MSCBSC);M+CG6k8hB8N
3.在基于IOS的交换机上设置远程访问:
?-b#g(U"@3P7O0switch(config)# interface vlan 1 移动通信网(MSCBSC))h t]EB` E
switch(config-if)# ip address ip-address netmask
4q}5GOd.xnc0switch(config-if)# ip default-gateway ip-address
Ktx;N3C9xWE0在基于CLI的交换机上设置远程访问:
,}5p"`]o"]"kt+`1r0switch(enable) set interface sc0 ip-address netmask broadcast-address
^Vg_dDS'w7K0switch(enable) set interface sc0 vlan 移动通信网(MSCBSC)%WrfYqg"a.sMa
switch(enable) set ip route default gateway 移动通信网(MSCBSC)*Ei5sE}6t
移动通信网(MSCBSC)N@^ c1]&[
4.在基于IOS的交换机上启用和浏览CDP信息: 移动通信网(MSCBSC)*C5j mEb.`'c
switch(config-if)# cdp enable
;y0^3@i-Z;[0switch(config-if)# no cdp enable 移动通信网(MSCBSC)0rA4s-~"C%t'H(K
为了查看Cisco邻接设备的CDP通告信息: 移动通信网(MSCBSC)!x:Cy3a#uVO\u Yq
switch# show cdp interface [type modle/port]
/X8o*q*wf6?&vG|0switch# show cdp neighbors [type module/port] [detail] 移动通信网(MSCBSC)m-i"][$z:s/l
在基于CLI的交换机上启用和浏览CDP信息:
{Bz!u.f0switch(enable) set cdp {enable|disable} module/port
pl-Sw$vf3o0为了查看Cisco邻接设备的CDP通告信息:
+?lp7x8[:nb _,|0CVB0switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]
/mn z%uVG{0
6e{:KjO6?%^P6]05.基于IOS的交换机的端口描述: 移动通信网(MSCBSC)&QqACV:z\I
switch(config-if)# description description-string
(k0QT*o5h_!r-\[0基于CLI的交换机的端口描述:
#wBaQ[0switch(enable)set port name module/number description-string 移动通信网(MSCBSC)"P:nx:k4rh/^Wt;e
移动通信网(MSCBSC)y$k,g(q bZz
6.在基于IOS的交换机上设置端口速度:
sjG4B8J8OR!v0switch(config-if)# speed{10|100|auto} 移动通信网(MSCBSC);gwS9EP0d'VU8q
在基于CLI的交换机上设置端口速度: 移动通信网(MSCBSC)*a"m0h-{.`t'Ue
switch(enable) set port speed moudle/number {10|100|auto} 移动通信网(MSCBSC)sApS3d(t@3o
switch(enable) set port speed moudle/number {4|16|auto}
zk p6Up/a!f;O6K`0
k"zo\/^q7K07.在基于IOS的交换机上设置以太网的链路模式: 移动通信网(MSCBSC)!Z5OV&Fr8de
switch(config-if)# duplex {auto|full|half}
L qy&j-I~3RK_0在基于CLI的交换机上设置以太网的链路模式: 移动通信网(MSCBSC)"i"VCX!En J
switch(enable) set port duplex module/number {full|half}
-Wdj|~R[I*}0
O0](C7cJ],U08.在基于IOS的交换机上配置静态VLAN:
}M8_C'o(ax N7|0switch# vlan database 移动通信网(MSCBSC)\.gnL|)x#o
switch(vlan)# vlan vlan-num name vla 移动通信网(MSCBSC)9pUoxOBwd
Be,dS|b#f0switch(vlan)# exit 移动通信网(MSCBSC) khX(U1R`X
switch# configure teriminal 移动通信网(MSCBSC)1khp r2|Ytr
switch(config)# interface interface module/number 移动通信网(MSCBSC)vI'?(Emisa|
switch(config-if)# switchport mode access
.gkjP6jlm8k?0switch(config-if)# switchport access vlan vlan-num 移动通信网(MSCBSC)0@.[hWG$_
switch(config-if)# end
c$p'K A2d0ek0在基于CLI的交换机上配置静态VLAN:
sj"y]#cB%_O"j0switch(enable) set vlan vlan-num [name name]
+U#Kr9])NU7~0switch(enable) set vlan vlan-num mod-num/port-list
R{FQY5Z,BU0移动通信网(MSCBSC)t*? T!@G
9. 在基于IOS的交换机上配置VLAN中继线: 移动通信网(MSCBSC) W?M+WCpp+l
switch(config)# interface interface mod/port
-\d'UuKz[#k3a0switch(config-if)# switchport mode trunk
V J9WM~UQ"VK0switch(config-if)# switchport trunk encapsulation {isl|dotlq}
8q&tS*vM2DU,`i#l0switch(config-if)# switchport trunk allowed vlan remove vlan-list 移动通信网(MSCBSC)x&hc%@aQ
switch(config-if)# switchport trunk allowed vlan add vlan-list 移动通信网(MSCBSC)"g OM|:e
在基于CLI的交换机上配置VLAN中继线:
P,TGq.d~/SU0switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate] 移动通信网(MSCBSC)YU!_fPjls!Q9b
Vlan-range [isl|dotlq|dotl0|lane|negotiate] 移动通信网(MSCBSC) hN:K Y@{9Gd
移动通信网(MSCBSC)4H8CVT ^'x;{e)d
10.在基于IOS的交换机上配置VTP管理域:
3K`LTx,QE0switch# vlan database
8GoW5Y)JdDcJ0switch(vlan)# vtp domain domain-name 移动通信网(MSCBSC)] f Q?o9S.[Q
在基于CLI的交换机上配置VTP管理域: 移动通信网(MSCBSC)/wWS$~7E0{T k_(A
switch(enable) set vtp [domain domain-name]
lz%iQ&IX)lB0switch(config)# hostname hostname 移动通信网(MSCBSC)-jhEb.M\D%O#\
在基于CLI的交换机上设置主机名/系统名:
%y4r*L8M#{5z0switch(enable) set system name name-string 移动通信网(MSCBSC)m Z:?u.X
移动通信网(MSCBSC)r*z};C"hx7_w
2.在基于IOS的交换机上设置登录口令:
/nSw,y[W L!wS0switch(config)# enable password level 1 password 移动通信网(MSCBSC)3bH$n z)T-X
在基于CLI的交换机上设置登录口令:
#L%s)oy#C$Ga.I0switch(enable) set password 移动通信网(MSCBSC)"wf1K\1D$Uc
switch(enable) set enalbepass
{L&FF;Z,i1E:slz0移动通信网(MSCBSC);M+CG6k8hB8N
3.在基于IOS的交换机上设置远程访问:
?-b#g(U"@3P7O0switch(config)# interface vlan 1 移动通信网(MSCBSC))h t]EB` E
switch(config-if)# ip address ip-address netmask
4q}5GOd.xnc0switch(config-if)# ip default-gateway ip-address
Ktx;N3C9xWE0在基于CLI的交换机上设置远程访问:
,}5p"`]o"]"kt+`1r0switch(enable) set interface sc0 ip-address netmask broadcast-address
^Vg_dDS'w7K0switch(enable) set interface sc0 vlan 移动通信网(MSCBSC)%WrfYqg"a.sMa
switch(enable) set ip route default gateway 移动通信网(MSCBSC)*Ei5sE}6t
移动通信网(MSCBSC)N@^ c1]&[
4.在基于IOS的交换机上启用和浏览CDP信息: 移动通信网(MSCBSC)*C5j mEb.`'c
switch(config-if)# cdp enable
;y0^3@i-Z;[0switch(config-if)# no cdp enable 移动通信网(MSCBSC)0rA4s-~"C%t'H(K
为了查看Cisco邻接设备的CDP通告信息: 移动通信网(MSCBSC)!x:Cy3a#uVO\u Yq
switch# show cdp interface [type modle/port]
/X8o*q*wf6?&vG|0switch# show cdp neighbors [type module/port] [detail] 移动通信网(MSCBSC)m-i"][$z:s/l
在基于CLI的交换机上启用和浏览CDP信息:
{Bz!u.f0switch(enable) set cdp {enable|disable} module/port
pl-Sw$vf3o0为了查看Cisco邻接设备的CDP通告信息:
+?lp7x8[:nb _,|0CVB0switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]
/mn z%uVG{0
6e{:KjO6?%^P6]05.基于IOS的交换机的端口描述: 移动通信网(MSCBSC)&QqACV:z\I
switch(config-if)# description description-string
(k0QT*o5h_!r-\[0基于CLI的交换机的端口描述:
#wBaQ[0switch(enable)set port name module/number description-string 移动通信网(MSCBSC)"P:nx:k4rh/^Wt;e
移动通信网(MSCBSC)y$k,g(q bZz
6.在基于IOS的交换机上设置端口速度:
sjG4B8J8OR!v0switch(config-if)# speed{10|100|auto} 移动通信网(MSCBSC);gwS9EP0d'VU8q
在基于CLI的交换机上设置端口速度: 移动通信网(MSCBSC)*a"m0h-{.`t'Ue
switch(enable) set port speed moudle/number {10|100|auto} 移动通信网(MSCBSC)sApS3d(t@3o
switch(enable) set port speed moudle/number {4|16|auto}
zk p6Up/a!f;O6K`0
k"zo\/^q7K07.在基于IOS的交换机上设置以太网的链路模式: 移动通信网(MSCBSC)!Z5OV&Fr8de
switch(config-if)# duplex {auto|full|half}
L qy&j-I~3RK_0在基于CLI的交换机上设置以太网的链路模式: 移动通信网(MSCBSC)"i"VCX!En J
switch(enable) set port duplex module/number {full|half}
-Wdj|~R[I*}0
O0](C7cJ],U08.在基于IOS的交换机上配置静态VLAN:
}M8_C'o(ax N7|0switch# vlan database 移动通信网(MSCBSC)\.gnL|)x#o
switch(vlan)# vlan vlan-num name vla 移动通信网(MSCBSC)9pUoxOBwd
Be,dS|b#f0switch(vlan)# exit 移动通信网(MSCBSC) khX(U1R`X
switch# configure teriminal 移动通信网(MSCBSC)1khp r2|Ytr
switch(config)# interface interface module/number 移动通信网(MSCBSC)vI'?(Emisa|
switch(config-if)# switchport mode access
.gkjP6jlm8k?0switch(config-if)# switchport access vlan vlan-num 移动通信网(MSCBSC)0@.[hWG$_
switch(config-if)# end
c$p'K A2d0ek0在基于CLI的交换机上配置静态VLAN:
sj"y]#cB%_O"j0switch(enable) set vlan vlan-num [name name]
+U#Kr9])NU7~0switch(enable) set vlan vlan-num mod-num/port-list
R{FQY5Z,BU0移动通信网(MSCBSC)t*? T!@G
9. 在基于IOS的交换机上配置VLAN中继线: 移动通信网(MSCBSC) W?M+WCpp+l
switch(config)# interface interface mod/port
-\d'UuKz[#k3a0switch(config-if)# switchport mode trunk
V J9WM~UQ"VK0switch(config-if)# switchport trunk encapsulation {isl|dotlq}
8q&tS*vM2DU,`i#l0switch(config-if)# switchport trunk allowed vlan remove vlan-list 移动通信网(MSCBSC)x&hc%@aQ
switch(config-if)# switchport trunk allowed vlan add vlan-list 移动通信网(MSCBSC)"g OM|:e
在基于CLI的交换机上配置VLAN中继线:
P,TGq.d~/SU0switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate] 移动通信网(MSCBSC)YU!_fPjls!Q9b
Vlan-range [isl|dotlq|dotl0|lane|negotiate] 移动通信网(MSCBSC) hN:K Y@{9Gd
移动通信网(MSCBSC)4H8CVT ^'x;{e)d
10.在基于IOS的交换机上配置VTP管理域:
3K`LTx,QE0switch# vlan database
8GoW5Y)JdDcJ0switch(vlan)# vtp domain domain-name 移动通信网(MSCBSC)] f Q?o9S.[Q
在基于CLI的交换机上配置VTP管理域: 移动通信网(MSCBSC)/wWS$~7E0{T k_(A
switch(enable) set vtp [domain domain-name]