《2022年2022年华为基本命令详解 .pdf》由会员分享,可在线阅读,更多相关《2022年2022年华为基本命令详解 .pdf(5页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、1.清空日志reset logbuffer2.清空配置在用户视图下敲reset saved-con然后重启即可交换机命令 Quidwaysuper password 修改特权用户密码Quidwaysysname 交换机命名Quidwayinterface ethernet 0/1 进入接口视图Quidwayinterface vlan x 进入接口视图Quidway-Vlan-interfacexip address 10.65.1.1 255.255.0.0 Quidwayip route-static 0.0.0.0 0.0.0.0 10.65.1.2 静态路由网关Quidwayuser-
2、interface vty 0 4 S3026-ui-vty0-4authentication-mode password S3026-ui-vty0-4set authentication-mode password simple 222 S3026-ui-vty0-4user privilege level 3 Quidway-Ethernet0/1duplex half|full|auto 配置端口双工工作状态Quidway-Ethernet0/1speed 10|100|auto 配置端口工作速率Quidway-Ethernet0/1flow-control 配置端口流控Quidway
3、-Ethernet0/1mdi across|auto|normal 配置端口 MDI/MDIX 状态平接或扭接Quidway-Ethernet0/1port link-type trunk|access|hybrid 设置接口工作模式Quidway-Ethernet0/1shutdown 关闭 /重起接口Quidway-Ethernet0/2quit 退出系统视图Quidwayvlan 3 创建 /删除一个 VLAN/ 进入 VLAN 模式Quidway-vlan3port ethernet 0/1 to ethernet 0/4 在当前 VLAN 增加 /删除以太网接口Quidway-Et
4、hernet0/2port access vlan 3 将当前接口加入到指定VLAN Quidway-Ethernet0/2port trunk permit vlan ID|All 设 trunk 允许的 VLAN Quidway-Ethernet0/2port trunk pvid vlan 3 设置 trunk 端口的 PVID Quidwaymonitor-port 指定和清除镜像端口Quidwayport mirror 指定和清除被镜像端口Quidwayport mirror int_list observing-port int_type int_num 指定镜像和被镜像Quidw
5、aydescription string 指定 VLAN 描述字符Quidwaydescription 删除 VLAN 描述字符名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 5 页 - - - - - - - - - Quidwaydisplay vlan vlan_id 查看 VLAN 设置Quidwaystp enable|disable 开启 /关闭生成树 ,默认关闭Quidwaystp priority 4096 设置交换机的优先级Quidwaystp root
6、 primary|secondary 设置交换机为根或根的备份Quidway-Ethernet0/1stp cost 200 设置交换机端口的花费SwitchA-vlanxisolate-user-vlan enable 设置主 vlan SwitchAIsolate-user-vlan secondary 设置主 vlan 包括的子 vlan Quidway-Ethernet0/2port hybrid pvid vlan 设置 vlan 的 pvid Quidway-Ethernet0/2port hybrid pvid 删除 vlan 的 pvid Quidway-Ethernet0/2
7、port hybrid vlan vlan_id_list untagged 设置无标识的vlan 如果包的 vlan id 与 PVId 一致,则去掉vlan 信息 . 默认 PVID=1 。所以设置 PVID 为所属 vlan id, 设置可以互通的vlan 为 untagged. 路由器命令 Quidwaydisplay version 显示版本信息Quidwaydisplay current-configuration 显示当前配置Quidwaydisplay interfaces 显示接口信息Quidwaydisplay ip route 显示路由信息Quidwaysysname a
8、abbcc 更改主机名Quidwaysuper passwrod 123456 设置口令Quidwayinterface serial0 进入接口Quidway-serial0ip address Quidway-serial0undo shutdown 激活端口Quidwaylink-protocol hdlc 绑定 hdlc 协议Quidwayuser-interface vty 0 4 Quidway-ui-vty0-4authentication-mode password Quidway-ui-vty0-4set authentication-mode password simple
9、 222 Quidway-ui-vty0-4user privilege level 3 Quidway-ui-vty0-4quit Quidwaydebugging hdlc all serial0 显示所有信息Quidwaydebugging hdlc event serial0 调试事件信息Quidwaydebugging hdlc packet serial0 显示包的信息静态路由:Quidwayip route-static interface number|nexthopvaluereject|blackhole 例如:Quidwayip route-static 129.1.0.
10、0 16 10.0.0.2 Quidwayip route-static 129.1.0.0 255.255.0.0 10.0.0.2 Quidwayip route-static 129.1.0.0 16 Serial 2 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 5 页 - - - - - - - - - Quidwayip route-static 0.0.0.0 0.0.0.0 10.0.0.2 动态路由:Quidwayrip Quidwayrip work
11、 Quidwayrip input Quidwayrip output Quidway-ripnetwork 1.0.0.0 ;可以 all Quidway-ripnetwork 2.0.0.0 Quidway-rippeer ip-address Quidway-ripsummary Quidwayrip version 1 Quidwayrip version 2 multicast Quidway-Ethernet0rip split-horizon ;水平分隔Quidwayrouter id A.B.C.D 配置路由器的ID Quidwayospf enable 启动 OSPF 协议Q
12、uidway-ospfimport-route direct 引入直联路由Quidway-Serial0ospf enable area 配置 OSPF 区域标准访问列表命令格式如下:acl match-order config|auto 默认前者顺序匹配。rule normal|specialpermit|deny source source-addr source-wildcard|any 例:Quidwayacl 10 Quidway-acl-10rule normal permit source 10.0.0.0 0.0.0.255 Quidway-acl-10rule normal
13、deny source any 扩展访问控制列表配置命令配置 TCP/UDP 协议的扩展访问列表:rule normal|specialpermit|denytcp|udpsource |anydestination |any operate 配置 ICMP 协议的扩展访问列表:rule normal|specialpermit|denyicmp source |anydestination |any icmp-code logging 扩展访问控制列表操作符的含义equal portnumber 等于greater-than portnumber 大于名师资料总结 - - -精品资料欢迎下载
14、 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 5 页 - - - - - - - - - less-than portnumber 小于not-equal portnumber 不等range portnumber1 portnumber2 区间扩展访问控制列表举例Quidwayacl 101 Quidway-acl-101rule deny souce any destination any Quidway-acl-101rule permit icmp source any destination any
15、 icmp-type echo Quidway-acl-101rule permit icmp source any destination any icmp-type echo-reply Quidwayacl 102 Quidway-acl-102rule permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.0.0.0 Quidway-acl-102rule deny ip source any destination any Quidwayacl 103 Quidway-acl-103rule permit tcp sour
16、ce any destination 10.0.0.1 0.0.0.0 destination-port equal ftp Quidway-acl-103rule permit tcp source any destination 10.0.0.2 0.0.0.0 destination-port equal www Quidwayfirewall enable Quidwayfirewall default permit|deny Quidwayint e0 Quidway-Ethernet0firewall packet-filter 101 inbound|outbound 地址转换配
17、置举例Quidwayfirewall enable Quidwayfirewall default permit Quidwayacl 101 Quidway-acl-101rule deny ip source any destination any Quidway-acl-101rule permit ip source 129.38.1.4 0 destination any Quidway-acl-101rule permit ip source 129.38.1.1 0 destination any Quidway-acl-101rule permit ip source 129.
18、38.1.2 0 destination any Quidway-acl-101rule permit ip source 129.38.1.3 0 destination any Quidwayacl 102 Quidway-acl-102rule permit tcp source 202.39.2.3 0 destination 202.38.160.1 0 Quidway-acl-102rule permit tcp source any destination 202.38.160.1 0 destination-port great-than 1024 Quidway-Ethern
19、et0firewall packet-filter 101 inbound Quidway-Serial0firewall packet-filter 102 inbound Quidwaynat address-group 202.38.160.101 202.38.160.103 pool1 Quidwayacl 1 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 5 页 - - - - - - - - - Quidway-acl-1rule permit sourc
20、e 10.110.10.0 0.0.0.255 Quidway-acl-1rule deny source any Quidway-acl-1int serial 0 Quidway-Serial0nat outbound 1 address-group pool1 Quidway-Serial0nat server global 202.38.160.101 inside 10.110.10.1 ftp tcp Quidway-Serial0nat server global 202.38.160.102 inside 10.110.10.2 www tcp Quidway-Serial0n
21、at server global 202.38.160.102 8080 inside 10.110.10.3 www tcp Quidway-Serial0nat server global 202.38.160.103 inside 10.110.10.4 smtp udp PPP 验证:主验方: pap|chap Quidwaylocal-user u2 password simple|cipher aaa Quidwayinterface serial 0 Quidway-serial0ppp authentication-mode pap|chap Quidway-serial0pp
22、p chap user u1 /pap时,不用此句pap 被验方:Quidwayinterface serial 0 Quidway-serial0ppp pap local-user u2 password simple|cipher aaa chap 被验方:Quidwayinterface serial 0 Quidway-serial0ppp chap user u1 Quidway-serial0local-user u2 password simple|cipher aaa名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 5 页,共 5 页 - - - - - - - - -