2022年2022年华为命令全集

上传人:桔**** 文档编号:567326409 上传时间:2024-07-19 格式:PDF 页数:11 大小:75.79KB
返回 下载 相关 举报
2022年2022年华为命令全集_第1页
第1页 / 共11页
2022年2022年华为命令全集_第2页
第2页 / 共11页
2022年2022年华为命令全集_第3页
第3页 / 共11页
2022年2022年华为命令全集_第4页
第4页 / 共11页
2022年2022年华为命令全集_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《2022年2022年华为命令全集》由会员分享,可在线阅读,更多相关《2022年2022年华为命令全集(11页珍藏版)》请在金锄头文库上搜索。

1、华为命令集华为路由器交换机配置命令:计算机命令PCAlogin:root ;使用 root用户password:linux;口令是 linux#shutdown-hnow;关机#init0;关机#logout;用户注销#login;用户登录#ifconfig ;显示 IP地址#ifconfig eth0 netmask;设置 IP地址#ifconfig eht0 netmaskdown;禁用 IP地址#route add 0.0.0.0 gw;设置网关#route del 0.0.0.0 gw;删除网关#route add default gw;设置网关#route del default g

2、w;删除网关#route;显示网关#ping;发ECHO包#telnet;远程登录交换机命令Quidwaydis cur ;显示当前配置Quidwaydisplay current-configuration ;显示当前配置Quidwaydisplay interfaces ;显示接口信息Quidwaydisplay vlan all ;显示路由信息Quidwaydisplay version ;显示版本信息Quidwaysuper password ;修改特权用户密码Quidwaysysname ;交换机命名Quidwayinterface ethernet 0/1 ;进入接口视图Quidw

3、ayinterface vlan x ;进入接口视图Quidway-Vlan-interfacexip address 10.65.1.1 255.255.0.0 ;配置 VLAN的IP地址Quidwayip route-static 0.0.0.0 0.0.0.0 10.65.1.2 ;默认路由网关Quidwayrip ;三层交换支持名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 11 页 - - - - - - - - - Quidwaylocal-user ftpQ

4、uidwayuser-interface vty 0 4 ;进入虚拟终端S3026-ui-vty0-4authentication-mode password ;设置口令模式S3026-ui-vty0-4set authentication-mode password simple 555 设置口令S3026-ui-vty0-4user privilege level 3 用户级别Quidwayinterface ethernet 0/1 ;进入端口模式Quidwayint e0/1 ;进入端口模式Quidway-Ethernet0/1duplex half|full|auto ;配置端口工作

5、状态Quidway-Ethernet0/1speed 10|100|auto ;配置端口工作速率Quidway-Ethernet0/1flow-control ;配置端口流控Quidway-Ethernet0/1mdi across|auto|normal ;配置端口平接扭接Quidway-Ethernet0/1port link-type trunk|access|hybrid ;设置端口工作模式Quidway-Ethernet0/1port access vlan 3 ;当前端口加入到 VLANQuidway-Ethernet0/2port trunk permit vlan ID|All

6、 ;设 trunk允许的 VLANQuidway-Ethernet0/3port trunk pvid vlan 3 ;设置 trunk端口的 PVIDQuidway-Ethernet0/1undo shutdown ;激活端口Quidway-Ethernet0/1shutdown ;关闭端口Quidway-Ethernet0/1quit ;返回Quidwayvlan 3 ;创建VLANQuidway-vlan3port ethernet 0/1 ;在VLAN 中增加端口Quidway-vlan3port e0/1 ;简写方式Quidway-vlan3port ethernet 0/1 to

7、ethernet 0/4 ;在 VLAN中增加端口Quidway-vlan3port e0/1 to e0/4 ;简写方式名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 11 页 - - - - - - - - - Quidwaymonitor-port ;指定镜像端口Quidwayport mirror ;指定被镜像端口Quidwayport mirror int_list observing-port int_type int_num ;指定镜像和被镜像Quidway

8、description string ;指定 VLAN 描述字符Quidwaydescription 删除VLAN 描述字符Quidwaydisplay vlan vlan_id ;查看 VLAN 设置Quidwaystp enable|disable ;设置生成树 ,默认关闭Quidwaystp priority 4096 ;设置交换机的优先级Quidwaystp root primary|secondary ;设置为根或根的备份Quidway-Ethernet0/1stp cost 200 ;设置交换机端口的花费Quidwaylink-aggregation e0/1 to e0/4 in

9、gress|both ;端口的聚合Quidwayundo link-aggregation e0/1|all ; 始端口为通道号SwitchA-vlanxisolate-user-vlan enable ;设置主vlanSwitchAisolate-user-vlan secondary ;设置主vlan包括的子 vlanQuidway-Ethernet0/2port hybrid pvid vlan ;设置 vlan的pvidQuidway-Ethernet0/2port hybrid pvid ;删除 vlan的pvidQuidway-Ethernet0/2port hybrid vlan

10、 vlan_id_list untagged ;设置无标识的 vlan如果包的 vlan id与PVId一致,则去掉 vlan信息. 默认PVID=1 。所以设置 PVID 为所属 vlan id, 设置可以互通的 vlan为untagged.名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 11 页 - - - - - - - - - 路由器命令Quidwaydisplay version ;显示版本信息Quidwaydisplay current-configurati

11、on ;显示当前配置Quidwaydisplay interfaces ;显示接口信息Quidwaydisplay ip route ;显示路由信息Quidwaysysname aabbcc ;更改主机名Quidwaysuper passwrod 123456 ;设置口令Quidwayinterface serial0 ;进入接口Quidway-serial0ip address ;配置端口 IP地址Quidway-serial0undo shutdown ;激活端口Quidwaylink-protocol hdlc ;绑定hdlc协议Quidwayuser-interface vty 0 4

12、Quidway-ui-vty0-4authentication-mode passwordQuidway-ui-vty0-4set authentication-mode password simple 222Quidway-ui-vty0-4user privilege level 3Quidway-ui-vty0-4quitQuidwaydebugging hdlc all serial0 ;显示所有信息Quidwaydebugging hdlc event serial0 ;调试事件信息Quidwaydebugging hdlc packet serial0 ;显示包的信息静态路由:Qu

13、idwayip route-static interface number|nexthopvaluereject|blackhole例如:Quidwayip route-static 129.1.0.0 16 10.0.0.2Quidwayip route-static 129.1.0.0 255.255.0.0 10.0.0.2Quidwayip route-static 129.1.0.0 16 Serial 2Quidwayip route-static 0.0.0.0 0.0.0.0 10.0.0.2名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - -

14、- - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 11 页 - - - - - - - - - 动态路由:Quidwayrip ;设置动态路由Quidwayrip work ;设置工作允许Quidwayrip input ;设置入口允许Quidwayrip output ;设置出口允许Quidway-ripnetwork 1.0.0.0 ;设置交换路由网络Quidway-ripnetwork all ;设置与所有网络交换Quidway-rippeer ip-address ;Quidway-ripsummary ;路由聚合Quidwayrip version

15、 1 ;设置工作在版本 1Quidwayrip version 2 multicast ;设版本 2,多播方式Quidway-Ethernet0rip split-horizon ;水平分隔Quidwayrouter id A.B.C.D ;配置路由器的 IDQuidwayospf enable ;启动 OSPF协议Quidway-ospfimport-route direct ;引入直联路由Quidway-Serial0ospf enable area ;配置 OSPF区域标准访问列表命令格式如下:acl match-order config|auto ;默认前者顺序匹配。rule norm

16、al|specialpermit|deny source source-addr source-wildcard|any例:Quidwayacl 10Quidway-acl-10rule normal permit source 10.0.0.0 0.0.0.255Quidway-acl-10rule normal deny source any扩展访问控制列表配置命令配置 TCP/UDP协议的扩展访问列表:rule normal|specialpermit|denytcp|udpsource |anydestination |anyoperate配置 ICMP协议的扩展访问列表:rule n

17、ormal|specialpermit|denyicmp source |anydestination|any名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 11 页 - - - - - - - - - icmp-code logging扩展访问控制列表操作符的含义equal portnumber ;等于greater-than portnumber ;大于less-than portnumber ;小于not-equal portnumber ;不等range port

18、number1 portnumber2 ;区间扩展访问控制列表举例Quidwayacl 101Quidway-acl-101rule deny souce any destination anyQuidway-acl-101rule permit icmp source any destination any icmp-typeechoQuidway-acl-101rule permit icmp source any destination any icmp-typeecho-replyQuidwayacl 102Quidway-acl-102rule permit ip source 10

19、.0.0.1 0.0.0.0 destination 202.0.0.10.0.0.0Quidway-acl-102rule deny ip source any destination anyQuidwayacl 103Quidway-acl-103rule permit tcp source any destination 10.0.0.1 0.0.0.0destination-port equal ftpQuidway-acl-103rule permit tcp source any destination 10.0.0.2 0.0.0.0destination-port equal

20、wwwQuidwayfirewall enableQuidwayfirewall default permit|denyQuidwayint e0Quidway-Ethernet0firewall packet-filter 101 inbound|outbound地址转换配置举例Quidwayfirewall enable名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 6 页,共 11 页 - - - - - - - - - Quidwayfirewall default perm

21、itQuidwayacl 101 ; 内部指定主机可以进入e0Quidway-acl-101rule deny ip source any destination anyQuidway-acl-101rule permit ip source 129.38.1.1 0 destination anyQuidway-acl-101rule permit ip source 129.38.1.2 0 destination anyQuidway-acl-101rule permit ip source 129.38.1.3 0 destination anyQuidway-acl-101rule

22、permit ip source 129.38.1.4 0 destination anyQuidway-acl-101quitQuidwayint e0Quidway-Ethernet0firewall packet-filter 101 inboundQuidwayacl 102 ; 外部特定主机和大于1024端口的数据包允许进入 S0Quidway-acl-102rule deny ip source any destination anyQuidway-acl-102rule permit tcp source 202.39.2.3 0 destination202.38.160.1

23、0Quidway-acl-102rule permit tcp source any destination 202.38.160.1 0destination-port great-than1024Quidway-acl-102quitQuidwayint s0Quidway-Serial0firewall packet-filter 102 inbound ;设202.38.160.1是路由器出口 IP。Quidway-Serial0nat outbound 101 interface ; 是Easy ip,将 acl 101允许的IP从本接口出时变换源地址。内部服务器地址转换配置命令(静

24、态nat):nat server global port inside port protocol ;global_port不写时使用 inside_portQuidway-Serial0nat server global 202.38.160.1 inside 129.38.1.1 ftp tcpQuidway-Serial0nat server global 202.38.160.1 inside 129.38.1.2 telnet tcpQuidway-Serial0nat server global 202.38.160.1 inside 129.38.1.3 www tcp设有公网

25、IP:202.38.160.101202.38.160.103 可以使用。 ;对外访问(原例题 )名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 7 页,共 11 页 - - - - - - - - - Quidwaynat address-group 202.38.160.101 202.38.160.103 pool1 ;建立地址池Quidwayacl 1Quidway-acl-1rule permit source 10.110.10.0 0.0.0.255 ;指定允许的内部网

26、络Quidway-acl-1rule deny source anyQuidway-acl-1int serial 0Quidway-Serial0nat outbound 1 address-group pool1 ;在s0口从地址池取出 IP对外访问Quidway-Serial0nat server global 202.38.160.101 inside 10.110.10.1 ftp tcpQuidway-Serial0nat server global 202.38.160.102 inside 10.110.10.2 wwwtcpQuidway-Serial0nat server

27、global 202.38.160.102 8080 inside 10.110.10.3www tcpQuidway-Serial0nat server global 202.38.160.103 inside 10.110.10.4 smtpudpPPP设置:Quidway-s0link-protocol ppp ; 默认的协议PPP验证:主验方: pap|chapQuidwaylocal-user q2 password simple|cipher hello ; 路由器 1Quidwayinterface serial 0Quidway-serial0ppp authenticatio

28、n-mode pap|chapQuidway-serial0ppp chap user q1 ;pap时,没有此句pap被验方:Quidwayinterface serial 0 ; 路由器 2Quidway-serial0ppp pap local-user q2 password simple|cipher hellochap被验方:Quidwayinterface serial 0 ; 路由器 2Quidway-serial0ppp chap user q2 ;自己路由器名Quidway-serial0local-user q1 password simple|cipher hello

29、; 对方路由器名名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 8 页,共 11 页 - - - - - - - - - 帧中继 frame-relay (二分册 6-61)q1fr switchingq1int s1q1-Serial1ip address 192.168.34.51 255.255.255.0q1-Serial1link-protocol fr ; 封装帧中继协议q1-Serial1fr interface-type dceq1-Serial1fr dlci 10

30、0q1-Serial1fr inarpq1-Serial1fr map ip 192.168.34.52 dlci 100q2int s1q2-Serial1ip address 192.168.34.52 255.255.255.0q2-Serial1link-protocol frq2-Serial1fr interface-type dteq2-Serial1fr dlci 100q2-Serial1fr inarpq2-Serial1fr map ip 192.168.34.51 dlci 100帧中继监测q1display fr lmi-infointerface type numb

31、erq1display fr mapq1display fr pvc-infoserial interface-numberdlci dlci-numberq1display fr dlci-switchq1display fr interfaceq1reset fr inarp-infoq1debugging fr allinterface type numberq1debugging fr arpinterface type numberq1debugging fr eventinterface type numberq1debugging fr lmiinterface type num

32、ber启动 ftp服务:Quidwaylocal-user ftp password simple|cipher aaa service-type ftpQuidwayftp server enable名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 9 页,共 11 页 - - - - - - - - - 使用 4台PC(pc多和少,华为路由器交换机原理是一样的,所以这里我只用了 4台pc),华为路由器( R2621)、交换机( S3026e )各一台,组建一 VLAN ,实现虚拟网

33、和物理网之间的连接。实现防火墙策略,和访问控制( ACL)。华为路由器交换机 VLAN 配置方案说明:四台PC的IP地址、掩码如下列表:P1 192.168.1.1 255.255.255.0 网关IP为192.168.1.5P2 192.168.1.2 255.255.255.0 网关IP为192.168.1.5P3 192.168.1.3 255.255.255.0 网关IP为192.168.1.6P4 192.168.1.4 255.255.255.0 网关IP为192.168.1.6路由器上 Ethernet0的IP为192.168.1.5Ethernet1的IP为192.168.1.

34、6firewall 设置默认为 deny华为路由器交换机 VLAN 配置实施命令列表:交换机上设置,划分VLAN :sys/切换到系统视图QuidwayvlanenableQuidwayvlan2Quidway-vlan2port e0/1toe0/8Quidway-vlan2quit/默认所有端口都属于VLAN1, 指定交换机的 e0/1到e0/8八个端口属于VLAN2Quidwayvlan3Quidway-vlan3port e0/9toe0/16Quidway-vlan3quit/指定交换机的 e0/9到e0/16八个端口属于 VLAN3QuidwaydisvlanallQuidwayd

35、iscu华为路由器交换机 VLAN 设置,实现访问控制:Routerinterface ethernet0Router-Ethernet0ip address 192.168.1.5 255.255.255.0Router-Ethernet0quit名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 10 页,共 11 页 - - - - - - - - - /指定 ethernet0的ipRouterinterface ethernet1Router-Ethernet1ip addre

36、ss192.168.1.6 255.255.255.0Router-Ethernet1quit/开启 firewall ,并将默认华为路由器交换机设置为denyRouterfireenableRouterfiredefaultdeny/允许 192.168.1.1访问 192.168.1.3/firewall 策略可根据需要再进行添加Routeracl101Router-acl-101rulepermitipsource192.168.1.1255.255.255.0destination192.168.1.3255.255.255.0Router-acl-101quit/启用 101规则名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 11 页,共 11 页 - - - - - - - - -

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 建筑/环境 > 施工组织

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号