华为交换机命令2007-12-14 14:59计算机命令~~~~~~~~~~PCA login:root;使用root用户password:linux;口令是linux# shutdown -hnow;关机# init;关机#logout;用户注销#login;用户登录#ifconfig;显示IP地址# ifconfig eth0 <ip address> netmask<netmask> ;设置IP地址# ifconfig eht0 <ip address> netmask <netmask>down ;禁用IP地址# route add 0.0.0.0 gw<ip>;设置网关# route del 0.0.0.0 gw<ip>;删除网关# route add default gw<ip>;设置网关# route del default gw<ip>;删除网关#route;显示网关# ping<ip>;发ECHO包# telnet<ip>;远程登录----------------------------------------交换机命令~~~~~~~~~~[Quidway]discur;显示当前配置[Quidway]displaycurrent-configuration ;显示当前配置[Quidway]displayinterfaces ;显示接口信息[Quidway]display vlanall ;显示路由信息[Quidway]displayversion;显示版本信息[Quidway]superpassword;修改特权用户密码[Quidway]sysname;交换机命名[Quidway]interface ethernet0/1 ;进入接口视图[Quidway]interface vlanx ;进入接口视图[Quidway-Vlan-interfacex]ip address 10.65.1.1 255.255.0.0 ;配置VLAN的IP地址[Quidway]ip route-static 0.0.0.0 0.0.0.010.65.1.2 ;静态路由=网关[Quidway]rip;三层交换支持[Quidway]local-user ftp[Quidway]user-interface vty 04 ;进入虚拟终端[S3026-ui-vty0-4]authentication-modepassword ;设置口令模式[S3026-ui-vty0-4]set authentication-mode password simple 222 ;设置口令[S3026-ui-vty0-4]user privilege level3 ;用户级别[Quidway]interface ethernet0/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]port link-type {trunk|access|hybrid} ;设置端口工作模式[Quidway-Ethernet0/1]port access vlan3 ;当前端口加入到VLAN[Quidway-Ethernet0/2]port trunk permit vlan {ID|All} ;设trunk允许的VLAN[Quidway-Ethernet0/3]port trunk pvid vlan 3 ;设置trunk端口的PVID[Quidway-Ethernet0/1]undoshutdown ;激活端口[Quidway-Ethernet0/1]shutdown;关闭端口[Quidway-Ethernet0/1]quit;返回[Quidway]vlan3;创建VLAN[Quidway-vlan3]port ethernet 0/1 ;在VLAN中增加端口[Quidway-vlan3]porte0/1 ;简写方式[Quidway-vlan3]port ethernet 0/1 to ethernet 0/4 ;在VLAN中增加端口[Quidway-vlan3]port e0/1 toe0/4 ;简写方式[Quidway]monitor-port <interface_type interface_num> ;指定镜像端口[Quidway]port mirror <interface_type interface_num> ;指定被镜像端口[Quidway]port mirror int_list observing-port int_type int_num ;指定镜像和被镜像[Quidway]descriptionstring ;指定VLAN描述字符[Quidway]description;删除VLAN描述字符[Quidway]display vlan[vlan_id];查看VLAN设置[Quidway]stp{enable|disable};设置生成树,默认关闭[Quidway]stp priority4096 ;设置交换机的优先级[Quidway]stp root{primary|secondary} ;设置为根或根的备份[Quidway-Ethernet0/1]stp cost200 ;设置交换机端口的花费[Quidway]link-aggregation e0/1 to e0/4ingress|both ; 端口的聚合[Quidway]undo link-aggregatione0/1|all ; 始端口为通道号[SwitchA-vlanx]isolate-user-vlanenable ;设置主vlan[SwitchA]isolate-user-vlan <x> secondary <list> ;设置主vlan包括的子vlan[Quidway-Ethernet0/2]port hybrid pvid vlan <id> ;设置vlan的pvid[Quidway-Ethernet0/2]port hybridpvid ;删除vlan的pvid [Quidway-Ethernet0/2]port hybrid vlan vlan_id_list untagged ;设置无标识的vlan如果包的vlan id与PVId一致,则去掉vlan信息. 默认PVID=1。
所以设置PVID为所属vlan id, 设置可以互通的vlan为untagged.----------------------------------------路由器命令~~~~~~~~~~[Quidway]displayversion;显示版本信息[Quidway]displaycurrent-configuration ;显示当前配置[Quidway]displayinterfaces ;显示接口信息[Quidway]display iproute ;显示路由信息[Quidway]sysnameaabbcc;更改主机名[Quidway]super passwrod123456 ;设置口令[Quidway]interfaceserial0 ;进入接口[Quidway-serial0]ip address <ip> <mask|mask_len> ;配置端口IP地址[Quidway-serial0]undoshutdown ;激活端口[Quidway]link-protocolhdlc ;绑定hdlc协议[Quidway]user-interface vty 0 4[Quidway-ui-vty0-4]authentication-mode password[Quidway-ui-vty0-4]set authentication-mode password simple 222 [Quidway-ui-vty0-4]user privilege level 3[Quidway-ui-vty0-4]quit[Quidway]debugging hdlc allserial0 ;显示所有信息[Quidway]debugging hdlc eventserial0 ;调试事件信息[Quidway]debugging hdlc packetserial0 ;显示包的信息静态路由:[Quidway]ip route-static <ip><mask>{interfacenumber|nexthop}[value][reject|blackhole]例如:[Quidway]ip route-static 129.1.0.0 16 10.0.0.2[Quidway]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2[Quidway]ip route-static 129.1.0.0 16 Serial 2[Quidway]ip route-static 0.0.0.0 0.0.0.0 10.0.0.2动态路由:[Quidway]rip;设置动态路由[Quidway]ripwork;设置工作允许[Quidway]ripinput;设置入口允许[Quidway]ripoutput;设置出口允许[Quidway-rip]network1.0.0.0 ;设置交换路由网络[Quidway-rip]networkall;设置与所有网络交换[Quidway-rip]peerip-address;[Quidway-rip]summary;路由聚合[Quidway]rip version1;设置工作在版本1[Quidway]rip version 2multicast ;设版本2,多播方式[Quidway-Ethernet0]ripsplit-horizon ;水平分隔[Quidway]router idA.B.C.D;配置路由器的ID[Quidway]ospfenable;启动OSPF协议[Quidway-ospf]import-routedirect ;引入直联路由[Quidway-Serial0]ospf enable area<area_id> ;配置OSPF区域标准访问列表命令格式如下:acl <acl-number> [match-orderconfig|auto] ;默认前者顺序匹配。