华为交换常用命令

上一篇 / 下一篇  2008-03-18 14:53:46 / 不允许评论 / 个人分类:职场人生

.在基于IOS的交换机上设置主机名/系统名: MSCBSC | 移动通信网pv#K _MC"f-mT9`k
switch(config)# hostname hostname
Fv:x)F/f0在基于CLI的交换机上设置主机名/系统名: MSCBSC | 移动通信网 Bcm J(B,R
switch(enable) set system name name-string
9q!u7S3s^NR0
(v]${&I]|L$M02.在基于IOS的交换机上设置登录口令:
8Nn h1D4T5FCr)}(g0switch(config)# enable password level 1 password MSCBSC | 移动通信网 WTtY%\hc4f
在基于CLI的交换机上设置登录口令: MSCBSC | 移动通信网7ibbkyh,Z
switch(enable) set password MSCBSC | 移动通信网o;|Gl-~|F;lK:C
switch(enable) set enalbepass
HGY3F&Yij*B a0MSCBSC | 移动通信网"m;i3lMD dr
3.在基于IOS的交换机上设置远程访问:
V7Y+X3TY5}2H RjDL0switch(config)# interface vlan 1 MSCBSC | 移动通信网4G F$oPVT,A"?&en+Dt
switch(config-if)# ip address ip-address netmask
CM%JA2h5d [H0switch(config-if)# ip default-gateway ip-address MSCBSC | 移动通信网mk [&GI0x
在基于CLI的交换机上设置远程访问:
4Ax(d5Ar:U8D0switch(enable) set interface sc0 ip-address netmask broadcast-address MSCBSC | 移动通信网W9YbW }0M'TU
switch(enable) set interface sc0 vlan
rG"kv9w^{ L$^0switch(enable) set ip route default gateway MSCBSC | 移动通信网q B+n!r)N"t
MSCBSC | 移动通信网T4P#b I.k1ht]
4.在基于IOS的交换机上启用和浏览CDP信息:
X {W G'X0switch(config-if)# cdp enable
a_rs8M&z(s0switch(config-if)# no cdp enable MSCBSC | 移动通信网2x7cx~n6Di
为了查看Cisco邻接设备的CDP通告信息:
6z)gX"xSq0switch# show cdp interface [type modle/port] MSCBSC | 移动通信网P5_ b,d']*L6y
switch# show cdp neighbors [type module/port] [detail] MSCBSC | 移动通信网2qDZ@1~*ba lZ3B9G
在基于CLI的交换机上启用和浏览CDP信息: MSCBSC | 移动通信网 ~-M*?xX)QE
switch(enable) set cdp {enable|disable} module/port MSCBSC | 移动通信网A m A7}9@@ J
为了查看Cisco邻接设备的CDP通告信息:
wq5] x7b+J+Q-B#S]0switch(enable) show cdp neighbors[module/port] [vlan|duplex|capabilities|detail]
:AT2xvR0h0MSCBSC | 移动通信网1[^&oTo
5.基于IOS的交换机的端口描述:
#zXM8I^rEer/i0switch(config-if)# description description-string MSCBSC | 移动通信网E$^ VPo^)I/bc K?
基于CLI的交换机的端口描述:
CFG[/Rx0switch(enable)set port name module/number description-string MSCBSC | 移动通信网:u%n"SerZs0S

(E2P-o0Z"f06.在基于IOS的交换机上设置端口速度:
p9L Y[d0{0switch(config-if)# speed{10|100|auto}
0p&R*RlD+X0在基于CLI的交换机上设置端口速度: MSCBSC | 移动通信网;s gEDg#X
switch(enable) set port speed moudle/number {10|100|auto} MSCBSC | 移动通信网 A eUd TN Bf
switch(enable) set port speed moudle/number {4|16|auto}
%Z)f0{!z:K+t(Y5l0MSCBSC | 移动通信网({/P,L_3w!B$bL
7.在基于IOS的交换机上设置以太网的链路模式: MSCBSC | 移动通信网Ll7v Xv7q0fb.r
switch(config-if)# duplex {auto|full|half}
N(X)Is'W,JI[0在基于CLI的交换机上设置以太网的链路模式:
~)dC lI'Q9H!Q0switch(enable) set port duplex module/number {full|half} MSCBSC | 移动通信网/t?/U2y^LK;wf b

` t#I)r8J Qe I(e*d08.在基于IOS的交换机上配置静态VLAN: MSCBSC | 移动通信网&yb2}ue%m
switch# vlan database
I4]#i7W HZcOJ*`p0switch(vlan)# vlan vlan-num name vla
AS"E#w!Mg0MSCBSC | 移动通信网Xob"H Pv1d:R(L1v'{
switch(vlan)# exit
$f3AwT1s,W0switch# configure teriminal
9q[k)|$^ _"chV\0switch(config)# interface interface module/number
3^"]7^4Z.Rwo^0switch(config-if)# switchport mode access
?fi[k[/Y O.A0switch(config-if)# switchport access vlan vlan-num
:L&HT3Uv]0switch(config-if)# end MSCBSC | 移动通信网5YNmdtl A/P.on
在基于CLI的交换机上配置静态VLAN:
1s `]0hp1o k X6r0switch(enable) set vlan vlan-num [name name]
8b8} N d;|2Tfz9aL`W0switch(enable) set vlan vlan-num mod-num/port-list
U/V`p.e0
'^m*\h{"z f09. 在基于IOS的交换机上配置VLAN中继线: MSCBSC | 移动通信网z(W0b QO
switch(config)# interface interface mod/port
1BRxRN1wAs/Yh0switch(config-if)# switchport mode trunk
4r!SU"q{8^R0p/tC6W0switch(config-if)# switchport trunk encapsulation {isl|dotlq} MSCBSC | 移动通信网Br b_6m3Zu,u
switch(config-if)# switchport trunk allowed vlan remove vlan-list MSCBSC | 移动通信网[!C?cZ1rCa/[ R
switch(config-if)# switchport trunk allowed vlan add vlan-list MSCBSC | 移动通信网 G~}:D;b {C
在基于CLI的交换机上配置VLAN中继线:
t Ad#[JV1^-{)G3l-C0switch(enable) set trunk module/port [on|off|desirable|auto|nonegotiate]
0[PKaW~l {0Vlan-range [isl|dotlq|dotl0|lane|negotiate]
[Y9`KH0a1YO}g0MSCBSC | 移动通信网 i{zN%v T)L
10.在基于IOS的交换机上配置VTP管理域: MSCBSC | 移动通信网2IoWE.b7t-{
switch# vlan database
([:uw rE&^)hv$w Q0switch(vlan)# vtp domain domain-name MSCBSC | 移动通信网q0Y[ W){!h(^Q9RU
在基于CLI的交换机上配置VTP管理域: MSCBSC | 移动通信网`L)ydP6Q
switch(enable) set vtp [domain domain-name]
#UCrX7|8R+SB:su0
"EdnM"\ PFW s$nD"v011.在基于IOS的交换机上配置VTP 模式: MSCBSC | 移动通信网4q4GZ.^r;wNA
switch# vlan database MSCBSC | 移动通信网+PP6v*\RJEm
switch(vlan)# vtp domain domain-name
m+H G3kx.]swr+K`5c0switch(vlan)# vtp {sever|cilent|transparent}
WyQ G#_7p0switch(vlan)# vtp password password
'D%DnIc,f3i|0在基于CLI的交换机上配置VTP 模式: MSCBSC | 移动通信网}T h6uV| s
switch(enable) set vtp [domain domain-name] [mode{ sever|cilent|transparent }][password password] MSCBSC | 移动通信网 Y9`kUSy0a5w

/b g$NL7F4T E012. 在基于IOS的交换机上配置VTP版本: MSCBSC | 移动通信网,i7o.V)Az8D
switch# vlan database MSCBSC | 移动通信网A SqF1Q
switch(vlan)# vtp v2-mode MSCBSC | 移动通信网 }0p/r%KyM$\
在基于CLI的交换机上配置VTP版本:
j%tjU"wHT0fV0b&y0switch(enable) set vtp v2 enable
\Fy}FQR!]R0
6^ aA'n3`lN'Wo013. 在基于IOS的交换机上启动VTP剪裁:
C8\3v5~;G@zj-KD0switch# vlan database MSCBSC | 移动通信网;M)Ha-f,H\MZ
switch(vlan)# vtp pruning
(u+Z| nK^0在基于CL I 的交换机上启动VTP剪裁: MSCBSC | 移动通信网$\M `eCr$Ir
switch(enable) set vtp pruning enable MSCBSC | 移动通信网 KYma}JZ6v

|F4G Q6KPN014.在基于IOS的交换机上配置以太信道:
[ED2i1[x/[XCb0switch(config-if)# port group group-number [distribution {source|destination}] MSCBSC | 移动通信网e5O[*H.m{2j0l`i"T
在基于CLI的交换机上配置以太信道: MSCBSC | 移动通信网i+S5`H1ZSe3f
switch(enable) set port channel moudle/port-range mode{on|off|desirable|auto} MSCBSC | 移动通信网0r~Y"SbLo%sI#U`

7P-aj]3Y/N+X0L+Uh015.在基于IOS的交换机上调整根路径成本: MSCBSC | 移动通信网UpW#WD]
switch(config-if)# spanning-tree [vlan vlan-list] cost cost
R3J(Wu#M"y&IHzbP0在基于CLI的交换机上调整根路径成本:
lN4_] w| ?|/g0MSCBSC | 移动通信网$xA*m4ptfy{7\
switch(enable) set spantree portcost moudle/port cost MSCBSC | 移动通信网zZ_e.s:E^VQI
switch(enable) set spantree portvlancost moudle/port [cost cost][vlan-list] MSCBSC | 移动通信网~v A%H.U(J9F

6}(m:z)b*T%N016.在基于IOS的交换机上调整端口ID: MSCBSC | 移动通信网`_ZR x[g6o%@r
switch(config-if)# spanning-tree[vlan vlan-list]port-priority port-priority MSCBSC | 移动通信网.MX_ mZaNx3N
在基于CLI的交换机上调整端口ID:
D K}*tDA'o+B'X*s-Y%m0switch(enable) set spantree portpri {mldule/port}priority
Z-o/j g^)t([Xe0switch(enable) set spantree portvlanpri {module/port}priority [vlans]
`%|+^Hd JveM0
%pB.P p yi_*gX017. 在基于IOS的交换机上修改STP时钟:
l[ P%t)s3}]I)^ @0switch(config)# spanning-tree [vlan vlan-list] hello-time seconds
n%niZx4D7N0switch(config)# spanning-tree [vlan vlan-list] forward-time seconds MSCBSC | 移动通信网8C}4GR3G(bG0G`
` switch(config)# spanning-tree [vlan vlan-list] max-age seconds
rvFw8m'Z-I.`0A0在基于CLI的交换机上修改STP时钟:
8H{J}.op|0switch(enable) set spantree hello interval[vlan]
!P'rz y#aa0switch(enable) set spantree fwddelay delay [vlan]
!r*@;gUKk0^0switch(enable) set spantree maxage agingtiame[vlan] MSCBSC | 移动通信网O J+J[/\.o

0d&g&j9d\6W sF018. 在基于IOS的交换机端口上启用或禁用Port Fast 特征: MSCBSC | 移动通信网n&Z l#N6J;e
switch(config-if)#spanning-tree portfast MSCBSC | 移动通信网3@oL&[c1Fv"bt
在基于CLI的交换机端口上启用或禁用Port Fast 特征: MSCBSC | 移动通信网'F#rI pc5~n&[
switch(enable) set spantree portfast {module/port}{enable|disable} MSCBSC | 移动通信网"}9tUm'lnXG7o

:zO(f#[[019. 在基于IOS的交换机端口上启用或禁用UplinkFast 特征:
d8SjM0Bw#j5u4tC8M0switch(config)# spanning-tree uplinkfast [max-update-rate pkts-per-second] MSCBSC | 移动通信网3Kz-G%`3z
在基于CLI的交换机端口上启用或禁用UplinkFast 特征: MSCBSC | 移动通信网)L'y^:f$vB)J+s/J
switch(enable) set spantree uplinkfast {enable|disable}[rate update-rate] [all-protocols off|on]
+p2q:qycl^0
CtZR4O020. 为了将交换机配置成一个集群的命令交换机,首先要给管理接口分配一个IP地址,然后使用下列命令: switch(config)# cluster enable cluster-name
g-KVDG6b$i0
-gT[ DVS021. 为了从一条中继链路上删除VLAN,可使用下列命令:
KDjL-@8e0@YR0switch(enable) clear trunk module/port vlan-range
d8J0p{%}:K\o[g0
3QA4@%zR.X.k(o^022. 用show vtp domain 显示管理域的VTP参数. MSCBSC | 移动通信网,Ur W['b+M

!z(JFa_r*PJ023. 用show vtp statistics显示管理域的VTP参数.
?i*^8b.foi ?daQ0MSCBSC | 移动通信网)Mi@0{Do`,m
24. 在Catalyst交换机上定义TrBRF的命令如下: MSCBSC | 移动通信网h?A2L}?|.E
switch(enable) set vlan vlan-name [name name] type trbrf bridge bridge-num[stp {ieee|ibm}] MSCBSC | 移动通信网^w%f0k7T2tq

vo[ d8Q2Hm|025. 在Catalyst交换机上定义TrCRF的命令如下: MSCBSC | 移动通信网A0ACpL5pX
switch (enable) set vlan vlan-num [name name] type trcrf
/Q(^:Pn oR)P3s0F0{ring hex-ring-num|decring decimal-ring-num} parent vlan-num MSCBSC | 移动通信网0x-P'b my^.s:Ye
MSCBSC | 移动通信网"e8J:X9y{
26. 在创建好TrBRF VLAN之后,就可以给它分配交换机端口.对于以太网交换,可以采用如下命令给VLAN分配端口: MSCBSC | 移动通信网MA2WI q t O
switch(enable) set vlan vlan-num mod-num/port-num MSCBSC | 移动通信网`Ym c:ox4Pz5QNe

Ho5ma+e,`027. 命令show spantree显示一个交换机端口的STP状态. MSCBSC | 移动通信网Xg2T)V VK o:b
MSCBSC | 移动通信网$tz'j|-nq @
28. 配置一个ELAN的LES和BUS,可以使用下列命令: MSCBSC | 移动通信网!c@I.|;Z$d|*l@n
ATM (config)# interface atm number.subint multioint
6ml@ga0ATM(config-subif)# lane serber-bus ethernet elan-name
2W0|?D;Q0MSCBSC | 移动通信网Z'u8t)i/jcQ
29. 配置LECS: MSCBSC | 移动通信网 g:NMT:X7C7[hb I1e
ATM(config)# lane database database-name MSCBSC | 移动通信网 V8X-B)} j)`#V7e3G-K
ATM(lane-config-databade)# name elan1-name server-atm-address les1-nsap-address
{ o!G6P#t0ATM(lane-config-databade)# name elan2-name server-atm-address les2-nsap-address MSCBSC | 移动通信网p.KAtE Lx sPh
ATM(lane-config-databade)# name … MSCBSC | 移动通信网YF4wF4s/|p9{
MSCBSC | 移动通信网s)g'A3V#ktW sf
30. 创建完数据库后,必须在主接口上启动LECS.命令如下: MSCBSC | 移动通信网,c6U|Qf }_
ATM(config)# interface atm number
.{x#?3m+e f(m6Q p(m B0ATM(config-if)# lane config database database-name
7v+N,s&r%bQ0ATM(config-if)# lane config auto-config-atm-address MSCBSC | 移动通信网XW a2E0s+s0t b+x

%H(D$]r-@-x%p n.KH'G031. 将每个LEC配置到一个不同的ATM子接口上.命令如下:
E|6z,QL!z}0ATM(config)# interface atm number.subint multipoint MSCBSC | 移动通信网 @([cUw_-C)qcp @
ATM(config)# lane client ethernet vlan-num elan-num MSCBSC | 移动通信网%t&{ K'j.A/HcGI _.T

G(zV w$v5] J%G032. 用show lane server 显示LES的状态.
ICjr"aX0MSCBSC | 移动通信网$a ]-y#rZ3rH7K
33. 用show lane bus显示bus的状态. MSCBSC | 移动通信网b T0A1QX+B |
MSCBSC | 移动通信网${6b4Ci}&sb5S
34. 用show lane database显示LECS数据库可内容.
}!s6We"v+Mmc0
|(r,Nn+p"q1D035. 用show lane client显示LEC的状态.
6H1m(k-w8c^!S0MSCBSC | 移动通信网Wuv2^ Y
36. 用show module显示已安装的模块列表.
*D(I'aclk7Z@0
uj!H E U#I037. 用物理接口建立与VLAN的连接: MSCBSC | 移动通信网&h&z^LLR,^@ t$\
router# configure terminal
0dg%[y']p^0router(config)# interface media module/port MSCBSC | 移动通信网p]e/v5hYi SY0u
router(config-if)# description description-string
k-u)Gg7\#N\8d,@F0router(config-if)# ip address ip-addr subnet-mask MSCBSC | 移动通信网s(]w ^ fF&OC;kp
router(config-if)# no shutdown
M,Uyq y(xC0
;YW ?1e@2\038. 用中继链路来建立与VLAN的连接: MSCBSC | 移动通信网B n$H5O4C+L"Wd
router(config)# interface module/port.subinterface MSCBSC | 移动通信网JRo@;^3H0[me
router(config-ig)# encapsulation[isl|dotlq] vlan-number
9x3x&R5@6d vd0router(config-if)# ip address ip-address subnet-mask
$`:{:G"n'M@4[0MSCBSC | 移动通信网u*^"Uo;J$Ss#\
39. 用LANE 来建立与VLAN的连接: MSCBSC | 移动通信网Ja+GA nP:`n d
router(config)# interface atm module/port
X_pl*t Px0router(config-if)# no ip address MSCBSC | 移动通信网 hF\q{m$}
router(config-if)# atm pvc 1 0 5 qsaal MSCBSC | 移动通信网Z#dR$ta8fr
router(config-if)# atm pvc 2 0 16 ilni MSCBSC | 移动通信网d"eC [ Ex[ i's
router(config-if)# interface atm module/port.subinterface multipoint MSCBSC | 移动通信网 c~Lf] d
router(config-if)# ip address ip-address subnet-mask
}|HJ4C&M0router(config-if)# lane client ethernet elan-num
Y}#bW*q*v'U5T*a0router(config-if)# interface atm module/port.subinterface multipoint MSCBSC | 移动通信网J t M0_Z6b$r
router(config-if)# ip address ip-address subnet-name
*x@w1U{&E0router(config-if)# lane client ethernet elan-name
C \ Bv x]0router(config-if)# …
$qc1A:T,D9m,VIzX|0MSCBSC | 移动通信网%}l[Hp)WJ
40. 为了在路由处理器上进行动态路由配置,可以用下列IOS命令来进行:
4bz5Y%HC,v0router(config)# ip routing
a)dx-S;HC0router(config)# router ip-routing-protocol
0P!nPHll{/bJh}B{0router(config-router)# network ip-network-number
&RFIE9Y%xz%I0router(config-router)# network ip-network-number MSCBSC | 移动通信网H*U7M+t$g(X

a8jC,ZW@!u041. 配置默认路由:
v,m V&s;PJXY0switch(enable) set ip route default gateway
@w$EI-gP |_0MSCBSC | 移动通信网'D+K%B Eq|2OA
42. 为一个路由处理器分配VLANID,可在接口模式下使用下列命令:
R#D.F h7h2D~5q0router(config)# interface interface number
+z4f"g(`u.IU)@A^#Xu0router(config-if)# mls rp vlan-id vlan-id-num
T A k9~{r/fh7l{0
1C%u1l2y ^0c)~043. 在路由处理器启用MLSP:
!`)] X;O+Kgz0router(config)# mls rp ip MSCBSC | 移动通信网r QIg n J j

gG x e,t"T8ci044. 为了把一个外置的路由处理器接口和交换机安置在同一个VTP域中: MSCBSC | 移动通信网7u0?.|3Z5Jw
router(config)# interface interface number MSCBSC | 移动通信网N'A(]6x3W
router(config-if)# mls rp vtp-domain domain-name MSCBSC | 移动通信网*iUf v pI(p

9CJ/h2j Ui$YH045. 查看指定的VTP域的信息:
,d^9Lu V E0router# show mls rp vtp-domain vtp domain name MSCBSC | 移动通信网!?5]P A"A:{pQ4m

9h&pYZJ Kbuq:^046. 要确定RSM或路由器上的管理接口,可以在接口模式下输入下列命令:
4O#vqRA }w%]m0px/?;v0router(config-if)#mls rp management-interface
-BH-_:k-ES0
F2aJ7J[ E9QIX047. 要检验MLS-RP的配置情况:
+diz8b~5b&If_EU0router# show mls rp MSCBSC | 移动通信网;h#n5VP2Y!O V ks

t'pNn k2[048. 检验特定接口上的MLS配置: MSCBSC | 移动通信网#{,Op\ py
router# show mls rp interface interface number
)M~bfS1Y%rw0MSCBSC | 移动通信网,u ]3^*by]F!v~
49. 为了在MLS-SE上设置流掩码而又不想在任一个路由处理器接口上设置访问列表:
`$S[`'G0set mls flow [destination|destination-source|full] MSCBSC | 移动通信网3XS-|*EMC6T

T1A~4\p q050. 为使MLS和输入访问列表可以兼容,可以在全局模式下使用下列命令:
y:pk%k[ r'XIYC0router(config)# mls rp ip input-acl
Z9b,E;FaA6\ _Z0
hh0_ Y.c!I051. 当某个交换机的第3层交换失效时,可在交换机的特权模式下输入下列命令: MSCBSC | 移动通信网v?Zk y6hUJ
switch(enable) set mls enable MSCBSC | 移动通信网WwZ-V `!M+@

,o|+^s_!d H uqe052. 若想改变老化时间的值,可在特权模式下输入以下命令:
B;q|{e/BP+v0switch(enable) set mls agingtime agingtime
HV8P7K%j P3Y0MSCBSC | 移动通信网e9W ^.xH5t4V
53. 设置快速老化: MSCBSC | 移动通信网)r7Z3H0mA0St:kg
switch(enable) set mls agingtime fast fastagingtime pkt_threshold
%iBU5Q ocM&u f4A0
i ZA%r$pbt054. 确定那些MLS-RP和MLS-SE参与了MLS,可先显示交换机引用列表中的内容再确定: MSCBSC | 移动通信网Ag;tP(?$@;N5K3J
switch(enable) show mls include
EO:ci~0x-j%g0MSCBSC | 移动通信网+{7{ \8yAd*k(C7G
55. 显示MLS高速缓存记录: MSCBSC | 移动通信网t:O_l&_u(a xJ#de
switch(enable) show mls entry MSCBSC | 移动通信网4x_Tr,S)W|

PFL^,Tj056. 用命令show in arp显示ARP高速缓存区的内容。
5f*W4m1hq6\0MSCBSC | 移动通信网!_/V)? ai.|
57. 要把路由器配置为HSRP备份组的成员,可以在接口配置模式下使用下面的命令:
"F TcB#M3f8~0router(config-if)# standby group-number ip ip-address MSCBSC | 移动通信网6rW j)p(p l3hZ4N

}-@t)C x m dR3g058. 为了使一个路由器重新恢复转发路由器的角色,在接口配置模式下:
sM5C;qL7` v0router(config-if)# standy group-number preempt
!iV+pZ Z.JV,AFw0MSCBSC | 移动通信网A)\?)UbD{
59. 访问时间和保持时间参数是可配置的: MSCBSC | 移动通信网+q s(gdx*N
router(config-if)# standy group-number timers hellotime holdtime
ZBZn*Wf0
3f*\u0@Ql&bL&y9RE0O060. 配置HSRP跟踪: MSCBSC | 移动通信网 _ PJ'?8J Zc+dM
router(config-if)# standy group-number track type-number interface-priority
7s0w"w}!~4iL0MSCBSC | 移动通信网B8NAbA9f
61. 要显示HSRP路由器的状态:
K!DX2tTc'_t/hs0router# show standby type-number group brief
(qb.L/Xu0
m3EUL6@m i&}%Ey062. 用命令show ip igmp确定当选的查询器。 MSCBSC | 移动通信网2I4]u,so5{ z:mt,D

{(}3Cz0?-XW063. 启动IP组播路由选择:
s/G&Zb E7]W)icy?0router(config)# ip muticast-routing MSCBSC | 移动通信网 [qbjt!vtb
MSCBSC | 移动通信网X yd0\$F|R*w^S
64. 启动接口上的PIM: MSCBSC | 移动通信网 F3s+X1~8lVIz
dalllasr1>(config-if)# ip pim {dense-mode|sparse-mode|sparse-dense-mode} MSCBSC | 移动通信网tiZ-i0j.CaI o

8c0gIk[4FR(c;G*Y C065. 启动稀疏-稠密模式下的PIM: MSCBSC | 移动通信网f+L;kF-Nd|@
router# ip multicast-routing MSCBSC | 移动通信网 OG/C bn\5S$f-@ gW
router# interface type number MSCBSC | 移动通信网5}3f(_XP4F~9u5u0x
router# ip pim sparse-dense-mode MSCBSC | 移动通信网@&]0fQdC[&eo

e ZT"zCZ066. 核实PIM的配置:
(OYUSFeq0dallasr1># show ip pim interface[type number] [count]
E9_8jV9ll!n)@Wj0
{+v9NIY@@6oTW ?067. 显示PIM邻居: MSCBSC | 移动通信网/|0K0L;NX;[w"U
dallasr1># show ip neighbor type number MSCBSC | 移动通信网x/v@!UM Ls;} V#f

8U/O r1v-d[7M_-|068. 为了配置RP的地址,命令如下:
(U$}Nd.R\$rq3s0dallasr1># ip pim rp-address ip-address [group-access-list-number][override]
5oh+^2Q$mv/W e0MSCBSC | 移动通信网?-gW9{x2|!U,K
69. 选择一个默认的RP:
z~0q'P/M6mx.HB0dallasr1># ip pim rp-address MSCBSC | 移动通信网sE\ r~5Nr
通告RP和它所服务的组范围: MSCBSC | 移动通信网?]"F&k j
dallasr1># ip pim send-rp-announce type number scope ttl group-list access-list-number MSCBSC | 移动通信网4n3MG U'z
为管理范围组通告RP的地址: MSCBSC | 移动通信网*n9a9C^x%v}2M3w&nR
dallasr1># ip pim send-rp-announce ethernet0 scope 16 group-list1 MSCBSC | 移动通信网7B/z_3_^U2A
dallasr1># access-list 1 permit 266.0.0.0 0.255.255.255
)kkyBjlD%_:n0设定一个RP映像代理:
)lv#lcz8N g~+gK0dallasr1># ip pim send-rp-discovery scope ttl MSCBSC | 移动通信网&E&y6H;B C
核实组到RP的映像: MSCBSC | 移动通信网L(@2f ]v#baZU!x
dallasr1># show ip pim rp mapping MSCBSC | 移动通信网dG*r u4?!eK(F
dallasr1># show ip pim rp [group-name|group-address] [mapping]
uK_7[Sm S0
r#|g+Xn.Ho:e3l2{070. 在路由器接口上用命令ip multicast ttl-threshold ttl-value设定TTL阀值: MSCBSC | 移动通信网tFZ!Kj6K
dallasr1>(config-if)# ip multicast ttl-threshold ttl-value
%_&d8E X9@o+QF0MSCBSC | 移动通信网 ZM'A8xq Y3l
71. 用show ip pim neighbor显示PIM邻居表。
;t,A^3y9Tj0MSCBSC | 移动通信网1O!R#aJoy{!q9j+v.M
72. 显示组播通信路由表中的各条记录:
fnKnp.V0dallasr1>show ip mroute [group-name|group-address][scoure][summary][count][active kbps] MSCBSC | 移动通信网 Q6P X(]Cg9~*k
MSCBSC | 移动通信网f"S'Z'h9S!P^{*y
73. 要记录一个路由器接受和发送的全部IP组播包: MSCBSC | 移动通信网4?GY+b5NWf|2QM4J
dallasr1> #debug ip mpacket [detail] [access-list][group] MSCBSC | 移动通信网1PA'LDuc3^`x

q]7iQ"mq074. 要在CISCO路由器上配置CGMP: MSCBSC | 移动通信网 }$Sr,w/\ljE~
dallasr1>(config-if)# ip cgmp
z ^1wC.h'~8O\0
8_;U1c` i075.配置一个组播路由器,使之加入某一个特定的组播组: MSCBSC | 移动通信网v9e&ee(m8w
dallasr1>(config-if)# ip igmp join-group group-address MSCBSC | 移动通信网(V7aR QO lQ

4Td6Cvyg076. 关闭 CGMP: MSCBSC | 移动通信网[yC v ]Z%NguC
dallasr1>(config-if)# no ip cgmp MSCBSC | 移动通信网1lg'cY6[RV,B2pg&Gs

y q5HK,Dol077. 启动交换机上的CGMP:
6f8M$NUV(Tp0dallasr1>(enable) set cgmp enable
QUGXVk/JS[:l0MSCBSC | 移动通信网5L&]8JBY ?t*t
78. 核实Catalyst交换机上CGMP的配置情况:
'`/jO,xK6jJU+H8]_0catalystla1>(enable) show config MSCBSC | 移动通信网yyb(e|g!if
set prompt catalystla1> MSCBSC | 移动通信网aqZ\e/l\c
set interface sc0 192.168.1.1 255.255.255.0
"w&?!~b'Cl3j4u'm X1?vS0set cgmp enable
i vG1`#I5nL)G0
)X zU;Yq4W w;G[m)m079. CGMP离开的设置:
nQ&?'] jd0Dallas_SW(enable) set cgmp leave
*jw"GL?\_0MSCBSC | 移动通信网ig?*n Ti4s8e5f
80. 在Cisco设备上修改控制端口密码:
3dMV_.x\u6Mj0R1(config)# line console 0 MSCBSC | 移动通信网1B xr ZG
R1(config-line)# login MSCBSC | 移动通信网'AACu jd*v
R1(config-line)# password Lisbon
2j,b b.ot)ad0R1(config)# enable password Lilbao
'i9\;m G4EC-|&KA0R1(config)# login local
Q&Ksu{hB#m0R1(config)# username student password cisco
J[]r.e6xa1}Ip0MSCBSC | 移动通信网| _r3j_O~)ef
81. 在Cisco设备上设置控制台及vty端口的会话超时: MSCBSC | 移动通信网Ls5d pk?6Nn
R1(config)# line console 0
$_aEi%~ g a0R1(config-line)# exec-timeout 5 10 MSCBSC | 移动通信网`XbF;m|
R1(config)# line vty 0 4 MSCBSC | 移动通信网r#^.~ p6pPr(W)Uv e
R1(config-line)# exec-timeout 5 2
%UB W\Je0MSCBSC | 移动通信网IEm-j@&A)@ _ Y u
82. 在Cisco设备上设定特权级:
v^\ \p&l r2s0R1(config)# privilege configure level 3 username MSCBSC | 移动通信网,j[Mx7U d!pUV
R1(config)# privilege configure level 3 copy run start
%E}Q8N'Xe*z0R1(config)# privilege configure level 3 ping MSCBSC | 移动通信网|$K3H6p%|ay{U m
R1(config)# privilege configure level 3 show run MSCBSC | 移动通信网kK~;u%? M
R1(config)# enable secret level 3 cisco MSCBSC | 移动通信网{ OW$`.L!?"C7em
MSCBSC | 移动通信网MH;EC/f|a
83. 使用命令privilege 可定义在该特权级下使用的命令: MSCBSC | 移动通信网w1F9q lu\x\5Q,\ B
router(config)# privilege mode level level command
7y3c~a]0MSCBSC | 移动通信网kS;v,oL EQ'g|Y
84. 设定用户特权级: MSCBSC | 移动通信网^FqO(C
router(config)# enable secret level 3 dallas
*P!G6@pF%yS0router(config)# enable secret san-fran MSCBSC | 移动通信网4] Ce?"k4g8O^ G
router(config)# username student password cisco
K,b!\1ua%Ghb5j0
9CjXq-M!}085. 标志设置与显示: MSCBSC | 移动通信网'y0^?Mt j2@w
R1(config)# banner motd ‘unauthorized access will be prosecuted!’ MSCBSC | 移动通信网w%F,PA H1})f
MSCBSC | 移动通信网+Xi8V Nb g
86. 设置vty访问:
Q2t M,\j0p'Zs&X!_0R1(config)# access-list 1 permit 192.168.2.5 MSCBSC | 移动通信网P#R+d$n;A Z P{i
R1(config)# line vty 0 4
}a0X5c@k0R1(config)# access-class 1 in
P6T{ H1ATY*o0MSCBSC | 移动通信网*Z/cvl{*MlB
87. 配置HTTP访问:
`5nT'kfD0Router3(config)# access-list 1 permit 192.168.10.7 MSCBSC | 移动通信网 Lja|)r4Nkqf+j
Router3(config)# ip http sever MSCBSC | 移动通信网 F b LI3@ M3C0?
Router3(config)# ip http access-class 1
4RN&k~+?^#XZ2]!D4~0Router3(config)# ip http authentication local
rjQtyiih0Router3(config)# username student password cisco
uM%}rH){^A0MSCBSC | 移动通信网`w%qM-DWz7C6I v
88. 要启用HTTP访问,请键入以下命令:
O$QwK x yX_0switch(config)# ip http sever
3A3S+o-})}Q9_mO0MSCBSC | 移动通信网#\!p{GYg%|
89. 在基于set命令的交换机上用setCL1启动和核实端口安全: MSCBSC | 移动通信网5@!X5B0Csy*@6j
switch(enable) set port security mod_num/port_num…enable mac address MSCBSC | 移动通信网G}?P?/XR ?
switch(enable) show port mod_num/port_num MSCBSC | 移动通信网7g H \"{6n(Y([h8Fx/u
在基于CiscoIOS命令的交换机上启动和核实端口安全:
i.b3UE1f"gX0switch(config-if)# port secure [mac-mac-count maximum-MAC-count]
!Xe~BF%R0switch# show mac-address-table security [type module/port] MSCBSC | 移动通信网a}f2Ri'S

n%k+Nj'V U`\ OS090. 用命令access-list在标准通信量过滤表中创建一条记录: MSCBSC | 移动通信网4LrE.gW
Router(config)# access-list access-list-number {permit|deny} source-address [source-address]
.KB|n1\i8a0MSCBSC | 移动通信网ie&t0{,p {W,P3Q6T
91. 用命令access-list在扩展通信量过滤表中创建一条记录:
O@:iC Q0Router(config)# access-list access-list-number {permit|deny{protocol|protocol-keyword}}{source source-wildcard|any}{destination destination-wildcard|any}[protocol-specific options][log]
8|"M k!AUu1u!x0MSCBSC | 移动通信网$oUH"w dv\
92. 对于带内路由更新,配置路由更新的最基本的命令格式是:
_LV6zm0R1(config-router)#distribute-list access-list-number|name in [type number] MSCBSC | 移动通信网Pe1Rw0|0ZH

(?m tp?1\093. 对于带外路由更新,配置路由更新的最基本的命令格式是:
-v6z }K9Co H0R1(config-router)#distribute-list access-list-number|name out [interface-name] routing-process| autonomous-system-number
)J;F/f D6N,kA'fr0MSCBSC | 移动通信网,ZC.}7F/pYYh+\{
94. set snmp命令选项: MSCBSC | 移动通信网 |'}'dWtP
set snmp community {read-only|ready-write|read-write-all}[community_string] MSCBSC | 移动通信网 r-aveYN%P{$_0}2^

L"xHA/Y$I Q7\095. set snmp trap 命令格式如下:
o:~?;W t/G,ua0set snmp trap {enable|disable} MSCBSC | 移动通信网3G%s h_6R4Agh X
[all|moudle|classis|bridge|repeater| auth|vtp|ippermit|vmps|config|entity|stpx]
wc_a5xC#j0set snmp trap rvcr_addr rcvr_community
lc+w4NC0
o'g C4n*PE{e096. 启用SNMP chassis 陷阱: MSCBSC | 移动通信网0~y&c9~W0b'q/{ [h!Yw
Console>(enable) set snmp trap enable chassis
Mm9?8B-D?:a0
^,A/T$f+U0f Yo"m097. 启用所有SNMP chassis 陷阱:
T:U helV0Console>(enable) set snmp trap enable
%kw7j)c5i0MSCBSC | 移动通信网:gJOA$uqW0@
…………以下由about于2002年12月6日增加…………
9{"n A;Ir098. 禁用SNMP chassis 陷阱: MSCBSC | 移动通信网U E a5`2p
Console>(enable) set snmp trap disable chassis
Me8Z%j Z%]D(S0MSCBSC | 移动通信网d$}RJDal Y
99. 给SNMP陷阱接收表加一条记录:
}3xU)@P8J6x"G0Console>(enable) set snmp trap 192.122.173.42 public MSCBSC | 移动通信网 p&l2Y:iQ*VFD+]
MSCBSC | 移动通信网.ff _)ksv
100. show snmp 输出结果。 MSCBSC | 移动通信网witfN*m"oZ0Y

5RwOUa3j0101. 命令set snmp rmon enable 的输出结果。 MSCBSC | 移动通信网D-_+_#Qp6qd

V9dKv7{_v i0102. 显示SPAN信息:
AF;pI Q0Consile> show span
0NyJAeQn.??0
)f D~3^)cvh0
$B'`(\E8DL7u0
7T Ri2t!g3f9R p @0MSCBSC | 移动通信网"Q:}Hp/J'q'|'as k
一些华为路由器命令: MSCBSC | 移动通信网:B?8IA3gS-D_%D

`%}gG)T8]o0删除设备配置
}/m)G-Ubp0reset saved-configuration
c*L@4f$v0
!v2]2[})@"{-Z b0重启 MSCBSC | 移动通信网J%eY5w7^Xv!{
reboot MSCBSC | 移动通信网$]J@3G_a(v
MSCBSC | 移动通信网o/rq[s7Xs2k9T8J
看当前配置文件
8hJw g$bK ^M6`0display current-configuration MSCBSC | 移动通信网 jJ{%tZ1B])o,s

LAsd6\1P0改设备名 MSCBSC | 移动通信网?8H1~-c G9y"W]*N
sysname
vl_/F7UU0MSCBSC | 移动通信网.Ds'Nz tE_$C4M
保存配置
%fD(Rp,mZu8s0save
}ctYM'Q H-E!fx0MSCBSC | 移动通信网z2i\&g ?;_8\L
进入特权模式 MSCBSC | 移动通信网 \6J}4rL+w
sysview
+J-o*o%ErSC| W T0华为只有2层模式 不像cisco enale之后还要conf t MSCBSC | 移动通信网1q'iG't7}7`
MSCBSC | 移动通信网,Y1eKIa.t
定义acl
+ZG5Q0C%c n0acl nubmere XXXX(3000以上)进入以后 MSCBSC | 移动通信网NU4K\5K&Bq@8xv
rule permit/deny IP/TCP/UDP等 source XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向)
5b&~I;{j6`0destination XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX(反向) eq MSCBSC | 移动通信网-q#J+dx^7}#jcH AB
注意 华为默认没有deny any any
KOSxs@%AP0MSCBSC | 移动通信网Iq`.v cg]7j+vR
防火墙上端口加载ACL MSCBSC | 移动通信网Q8KK*HIQ&c$eg
[Quidway-Ethernet0/0]firewall packet-filter 3000 inbound MSCBSC | 移动通信网 p,VP&|.w]W

qi2xgf!m3j0防火墙上新增加用户 MSCBSC | 移动通信网P;r'Va{xP
local-user XXX(用户名) password simple XXX(密码) MSCBSC | 移动通信网,R8N%Z%P N_rD D
local-user XXX service-type ppp MSCBSC | 移动通信网$v;R"W C7KA

s,a8w;I*R-F N1q#A.]["c0删除某条命令 MSCBSC | 移动通信网^Ml9da|
undo(类似与cisco的no) MSCBSC | 移动通信网i5RcM,_
MSCBSC | 移动通信网bsJ3o)?
静态路由
k!x!ZY4W _MC0ip route-static 0.0.0.0 0.0.0.0 XXX.XXX.XXX.XXX MSCBSC | 移动通信网8W*u*n+U Wq"E Q4\qG
MSCBSC | 移动通信网KtzV2jp/R$_
对vpdn用户设置acl的接口 MSCBSC | 移动通信网 d se?-u8J7v]p
inte***ce Virtual-Template1 MSCBSC | 移动通信网emS/o1}$` ]
MSCBSC | 移动通信网#Q(t Tf'E af
查看路由表
1K Q9E'O'Y:k0display ip routing-table
A?n:CN8^ w0
}2O;x$t)wD0设定telnet密码 MSCBSC | 移动通信网!n7J;Pg/i(e3_7rEt7b
user-inte***ce vty 0 4
5^{Tz!y'[8L|*hM0user privilege level 3 MSCBSC | 移动通信网8`uq*NM |S
set authentication password simple XXX MSCBSC | 移动通信网 ?[rF-K3f#@k
MSCBSC | 移动通信网nH0`,u#f
启动/关闭
J't,D~E9?#_0启动 un shut
:IF+o(B$t%jM6y0关闭 shut
6R?J\QA{ o0
)N2Jb8d:i?0动态nat设置
i0`XXg2r:Az6nv |0acl number 3000 MSCBSC | 移动通信网E-eAL9x'j)T[
rule 0 permit ip source XXX.XXX.XXX.XXX
Q-AP%t'[Hb%x%|-m0rule 1 permit ip source XXX.XXX.XXX.XXX MSCBSC | 移动通信网m&LS'~ br)u5_ L!S
rule 2 permit ip source XXX.XXX.XXX.XXX MSCBSC | 移动通信网v k%pN2} t v4xY
inte***ce Ethernet1/0 MSCBSC | 移动通信网w"w2oex#Z;K@
des cription ====To-Internet(WAN)====
6eK#A^_c?I4w*AD0ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX MSCBSC | 移动通信网xI7p7G'Oj
nat outbound 3000
Hi e jK0ipsec policy policy1 MSCBSC | 移动通信网AyF+k^&H9Y%m
利用acl来做 符合acl的IP地址可以出去(注意 此处的ACL隐含了deny any any)不符合的IP地址不可以出去
-nY%^5E6{e@;VR[0MSCBSC | 移动通信网UY,i.t C:zm2rvIf
创建vlan
!k-DD%PZ ])k}0[shzb-crsw-s6506-1]vlan 100 MSCBSC | 移动通信网 a,huF#e?tD
华为vlan不支持name MSCBSC | 移动通信网 D$e?ape[f
将port放入vlan
6tH$xgb@3F)l0创建了vlan后 进入vlan模式
3o8N7z6YHJ*h&e:fu0[shzb-crsw-s6506-1-vlan100]port GigabitEthernet 1/0/1 to GigabitEthernet 1/0/8
|ca;B2nm},H)^.~0表示从G1/0/1 到1/0/8放入VLAN 100 MSCBSC | 移动通信网,\$sz X }Nj"R
MSCBSC | 移动通信网q)a*N }SPT}
创建trunk MSCBSC | 移动通信网:~t5yB X1Oq
inte***ce GigabitEthernet1/0/1 MSCBSC | 移动通信网0nK1\};M7B
duplex full
2Yl(_z3}0speed 1000 MSCBSC | 移动通信网E Q&Z2F q%sS
* port link-type trunk
_N Q-m(Y4u.i[0* port trunk permit vlan all MSCBSC | 移动通信网_%I%|5DE/ps
port link-aggregation group 1
0Y0d3H+LL ?0带*号的是创建trunk链路的语句 MSCBSC | 移动通信网W qn6H*E?]V

+NLUQ#D6I0vlan地址指定
%AK ?~Bq-V ~0inte***ce Vlan-inte***ce2 MSCBSC | 移动通信网m0m [;yI]8v;GI b
des cription server MSCBSC | 移动通信网#|O-e$AA9l7{
ip address XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX MSCBSC | 移动通信网6J~1kC/\Sw\v
vrrp vrid 2 virtual-ip XXX.XXX.XXX.XXX
(zY,AZ(o*n!j0vrrp vrid 2 priority 120
#rt D1Z,J:Z'}0vrrp vrid 2 preempt-mode timer delay 10
+I%L:e lM0其中vrrp语句指定vrrp 类似与hsrp MSCBSC | 移动通信网 [5ESc8P
使用vrrp要注意的是华为不支持pvst
QX |@HzO,v!bM0只能一台完全是主,一台完全是备份
%S N0|"F0`+{UL0在主vrrp设备上要指定 MSCBSC | 移动通信网 H8E$\A3M3x
stp instance 0 root primary MSCBSC | 移动通信网~!d+m RTl+k({
stp TC-protection enable
9E,sveSo,n;k'l5@,f0stp enable MSCBSC | 移动通信网gBE7n*`R_
在从vrrp设备上要指定 MSCBSC | 移动通信网%]:gNg3NYt
stp instance 0 root secondary
,{0GuW2\*i-e0stp TC-protection enable
.tT,U+Z o_0stp enable
3rOE LT'{e$~0MSCBSC | 移动通信网A Y-iJy |
交换机下面绑acl MSCBSC | 移动通信网%\UFd.Lg H0D#E.Q
首先进入接口模式,输入qos命令 MSCBSC | 移动通信网"gM(uh W1Ja X
[shzb-crsw-s6506-1-GigabitEthernet1/0/1]qos MSCBSC | 移动通信网jv9M3Q sT"n
在输入如下命令 MSCBSC | 移动通信网 zRs/|\
[shzb-crsw-s6506-1-qoss-GigabitEthernet1/0/1]packet-filter inbound ip-group 3000
\ Pp_f1WJ3n0华为交换机只能指定inbound方向
u9q)}mt0
fc`@gz/u0启用ospf MSCBSC | 移动通信网!~N"rlLBVX
[shzb-crsw-s6506-1]ospf 100 MSCBSC | 移动通信网 nxu2Ii#sN(`
[shzb-crsw-s6506-1-ospf-100]area 0
gT9l\8f's2r!^4Vq0[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]network XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX
}x3l6\l"I#N#]vq%{I0配置ospf重发布 MSCBSC | 移动通信网J\J`(|0j!@7\ DKA
[shzb-crsw-s6506-1-ospf-100-area-0.0.0.0]quit
;F5N)eMi9_Q4Ho"w0[shzb-crsw-s6506-1-ospf-100]import-route static MSCBSC | 移动通信网$N4H.KYP_3V

jrIb9Z0建立link-group(类似与cisco的channel-group) MSCBSC | 移动通信网?.Xj$M`A&J

U C K @[0link-aggregation group 1 mode manual MSCBSC | 移动通信网\.bYK`
然后进入接口 MSCBSC | 移动通信网v k} suG} Le.^l
port link-aggregation group 1
`+N\`8u$E}0MSCBSC | 移动通信网#^me?M)W D5Z
启用VRRP之前必须输入 MSCBSC | 移动通信网,A2@ Tv2m;|S,W ~{"Y;v
vrrp ping-enable MSCBSC | 移动通信网*@r` q$T
使得客户能ping网关
;ZV.W2@-ieO+v8B0MSCBSC | 移动通信网{u/j w}8u:S u

TAG: 命令 华为 交换机 switch IOS

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-07-06  
  12345
6789101112
13141516171819
20212223242526
2728293031  

数据统计

  • 访问量: 4068
  • 日志数: 27
  • 建立时间: 2007-11-14
  • 更新时间: 2008-05-25

RSS订阅

Open Toolbar