华为三层交换机常用命令[Quidway]discur显示当前配置[Quidway]displaycurrent-configuration显示当前配置[Quidway]displayinterfaces显示接口信息[Quidway]displayvlanall显示路由信息[Quidway]displayversion显示版本信息[Quidway]superpassword修改特权用户密码[Quidway]sysname交换机命名[Quidway]interfaceethernet0/1进入接口视图[Quidway]interfacevlanx进入接口视图[Quidway-Vlan-interfacex]ipaddress10.65.1.1255.255.0.0配置VLAN的IP地址[Quidway]iproute-static0.0.0.00.0.0.010.65.1.2静态路由[Quidway]rip三层交换支持[Quidway]local-userftp[Quidway]user-interfacevty04进入虚拟终端[S3026-ui-vty0-4]authentication-modepassword设置口令模式[S3026-ui-vty0-4]setauthentication-modepasswordsimple222设置口令[S3026-ui-vty0-4]userprivilegelevel3用户级别[Quidway]interfaceethernet0/1进入端口模式[Quidway]inte0/1进入端口模式[Quidway-Ethernet0/1]duplex{half|full|auto}配置端口工作状态[Quidway-Ethernet0/1]speed{10|100|auto}配置端口工作速率[Quidway-Ethernet0/1]flow-control配置端口流控[Quidway-Ethernet0/1]mdi{across|auto|normal}配置端口平接扭接[Quidway-Ethernet0/1]portlink-type{trunk|access|hybrid}设置端口工作模式[Quidway-Ethernet0/1]portaccessvlan3当前端口加入到VLAN[Quidway-Ethernet0/2]porttrunkpermitvlan{ID|All}设trunk允许的VLAN[Quidway-Ethernet0/3]porttrunkpvidvlan3设置trunk端口的PVID[Quidway-Ethernet0/1]undoshutdown激活端口[Quidway-Ethernet0/1]shutdown关闭端口[Quidway-Ethernet0/1]quit返回[Quidway]vlan3创建VLAN[Quidway-vlan3]portethernet0/1在VLAN中增加端口[Quidway-vlan3]porte0/1简写方式[Quidway-vlan3]portethernet0/1toethernet0/4在VLAN中增加端口[Quidway-vlan3]porte0/1toe0/4简写方式[Quidway]monitor-portinterface_typeinterface_num指定镜像端口[Quidway]portmirrorinterface_typeinterface_num指定被镜像端口[Quidway]portmirrorint_listobserving-portint_typeint_num指定镜像和被镜像[Quidway]descriptionstring指定VLAN描述字符[Quidway]description删除VLAN描述字符[Quidway]displayvlan[vlan_id]查看VLAN设置[Quidway]stp{enable|disable}设置生成树,默认关闭[Quidway]stppriority4096设置交换机的优先级[Quidway]stproot{primary|secondary}设置为根或根的备份[Quidway-Ethernet0/1]stpcost200设置交换机端口的花费[Quidway]link-aggregatione0/1toe0/4ingress|both端口的聚合[Quidway]undolink-aggregatione0/1|all始端口为通道号[SwitchA-vlanx]isolate-user-vlanenable设置主vlan[SwitchA]isolate-user-vlanxsecondarylist设置主vlan包括的子vlan[Quidway-Ethernet0/2]porthybridpvidvlanid设置vlan的pvid[Quidway-Ethernet0/2]porthybridpvid删除vlan的pvid[Quidway-Ethernet0/2]porthybridvlanvlan_id_listuntagged设置无标识的vlan如果包的vlanid与PVId一致,则去掉vlan信息.默认PVID=1。所以设置PVID为所属vlanid,设置可以互通的vlan为untagged.华为2403配置SNMPsnmp-agentcommunitywriteidcsnmp-agentcommunityreadenhostsnmp-agentsys-infolocationtextsnmp-agentsys-infoversionall华为设置VLAN指定网关[QuidwayS6502]vlan400[QuidwayS6502-vlan400]port?EthernetEthernetinterfaceGigabitEthernetGigabitEthernetinterface[QuidwayS6502-vlan400]portEthernet?1-1Slotnumber[QuidwayS6502-vlan400]portEthernet1/0/5[QuidwayS6502-vlan400]q[QuidwayS6502]interface?AuxAuxinterfaceEthernetEthernetinterfaceGigabitEthernetGigabitEthernetinterfaceLoopBackLoopBackinterfaceM-EthernetMETHinterfaceNULLNULLinterfaceVlan-interfaceVLANinterface[QuidwayS6502]interfacev[QuidwayS6502]interfaceVlan-interface400[QuidwayS6502-Vlan-interface400]ipad[QuidwayS6502-Vlan-interface400]ipaddress?X.X.X.XIPaddress[QuidwayS6502-Vlan-interface400]ipaddress做端口镜像[QuidwayS6506R]mirroring-group1local[QuidwayS6506R]mirroring-group1monitor-portGigabitEthernet6/0/2[QuidwayS6506R]mirroring-group1mirroring-portGigabitEthernet6/0/41toGigabitEthernet6/0/48both做端口汇聚[QuidwayS6506R]link-aggregationgroup1modemanual[QuidwayS6506R]interfaceGigabitEthernet6/0/41[QuidwayS6506R-GigabitEthernet6/0/41]portaccessvlan168[QuidwayS6506R-GigabitEthernet6/0/41]portlink-aggregationgroup1[QuidwayS6506R-GigabitEthernet6/0/42]portaccessvlan168[QuidwayS6506R-GigabitEthernet6/0/42]portli[QuidwayS6506R-GigabitEthernet6/0/42]portlink-a[QuidwayS6506R-GigabitEthernet6/0/42]portlink-aggregationgroup1单独划分百独口1,进入6502指定的端口:interfaceethernet1/0/7[QuidwayS6502-Ethernet1/0/7]portaccessvlan600===指定特定VLAN下某个IP华为2403H-EI限制端口带宽(1-28)带宽标准是64K。5*1024/64(29-127)带宽标准是1M。(n-27)*1关闭特定的端口:[Quidway-Ethernet0/7]shutdown解开特定的端口:[Quidway-Ethernet0/7]undoshutdown华为2403H-EI配置端口镜像[Quidway]monitor-portethernet0/2no-filt镜像端口号[Quidway]mirroring-portethernet0/3toethernet0/5both被镜像端口华为3600-28P-EI不同网段划到同一VLAN方法[H3C]interfaceVlan-interface100[H3C-Vlan-interface100]ipaddress220.181.120.97255.255.255.240[H3C-Vlan-interface100]ipaddress220.181.120.225255.255.255.240sub