1、交换机命令Quidwaydis cur ;显示当前配置Quidwaydisplay current-configuration ;显示当前配置Quidwaydisplay interfaces ;显示接口信息Quidwaydisplay vlan all ;显示路由信息Quidwaydisplay version ;显示版本信息Quidwaysuper password ;修改特权用户密码Quidwaysysname ;交换机命名Quidwayinterface ethernet 0/1 ;进入接口视图Quidwayinterface vlan x ;进入接口视图Quidway-Vlan-in
2、terfacexip 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 ;三层交换支持Quidwaylocal-user ftpQuidwayuser-interface vty 0 4 ;进入虚拟终端S3026-ui-vty0-4authentication-mode password ;设置口令模式S3026-ui-vty0-4set authentication-mode password simple 222 ;设置
3、口令S3026-ui-vty0-4user privilege level 3 ;用户级别Quidwayinterface ethernet 0/1 ;进入端口模式Quidwayint e0/1 ;进入端口模式Quidway-Ethernet0/1duplex half|full|auto ;配置端口工作状态Quidway-Ethernet0/1speed 10|100|auto ;配置端口工作速率Quidway-Ethernet0/1flow-control ;配置端口流控Quidway-Ethernet0/1mdi across|auto|normal ;配置端口平接扭接Quidway-E
4、thernet0/1port link-type trunk|access|hybrid ;设置端口工作模式Quidway-Ethernet0/1port access vlan 3 ;当前端口加入到VLANQuidway-Ethernet0/2port trunk permit vlan ID|All ;设 trunk允许的VLANQuidway-Ethernet0/3port trunk pvid vlan 3 ;设置 trunk端口的PVIDQuidway-Ethernet0/1undo shutdown ;激活端口Quidway-Ethernet0/1shutdown ;关闭端口Qui
5、dway-Ethernet0/1quit ;返回Quidwayvlan 3 ;创建 VLANQuidway-vlan3port ethernet 0/1 ;在 VLAN中增加端口Quidway-vlan3port e0/1 ;简写方式Quidway-vlan3port ethernet 0/1 to ethernet 0/4 ;在 VLAN中增加端口Quidway-vlan3port e0/1 to e0/4 ;简写方式Quidwaymonitor-port ;指定镜像端口Quidwayport mirror ;指定被镜像端口Quidwayport mirror int_list observ
6、ing-port int_type int_num ;指定镜像和被镜像Quidwaydescription string ;指定 VLAN描述字符Quidwaydescription ;删除 VLAN描述字符Quidwaydisplay vlan vlan_id ;查看 VLAN设置Quidwaystp enable|disable ;设置生成树,默认关闭Quidwaystp priority 4096 ;设置交换机的优先级Quidwaystp root primary|secondary ;设置为根或根的备份Quidway-Ethernet0/1stp cost 200 ;设置交换机端口的花
7、费Quidwaylink-aggregation e0/1 to e0/4 ingress|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 ;删除
8、vlan的 pvidQuidway-Ethernet0/2port 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 rou
9、te ;显示路由信息Quidwaysysname aabbcc ;更改主机名Quidwaysuper passwrod 123456 ;设置口令Quidwayinterface serial0 ;进入接口Quidway-serial0ip address ;配置端口 IP地址Quidway-serial0undo shutdown ;激活端口Quidwaylink-protocol hdlc ;绑定 hdlc协议Quidwayuser-interface vty 0 4Quidway-ui-vty0-4authentication-mode passwordQuidway-ui-vty0-4s
10、et 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 ;显示包的信息静态路由:Quidwayip route-static interface number|nexthopvaluereject|blackh
11、ole例如: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动态路由:Quidwayrip ;设置动态路由Quidwayrip work ;设置工作允许Quidwayrip input ;设置入口允许Quidwayrip output ;设置出口允许Quidway-rip
12、network 1.0.0.0 ;设置交换路由网络Quidway-ripnetwork all ;设置与所有网络交换Quidway-rippeer ip-address ;Quidway-ripsummary ;路由聚合Quidwayrip version 1 ;设置工作在版本 1Quidwayrip version 2 multicast ;设版本 2,多播方式Quidway-Ethernet0rip split-horizon ;水平分隔Quidwayrouter id A.B.C.D ;配置路由器的 IDQuidwayospf enable ;启动 OSPF协议Quidway-ospfi
13、mport-route direct ;引入直联路由Quidway-Serial0ospf enable area ;配置 OSPF区域标准访问列表命令格式如下:acl match-order config|auto ;默认前者顺序匹配。rule normal|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 a
14、ny扩展访问控制列表配置命令配置 TCP/UDP协议的扩展访问列表:rule normal|specialpermit|denytcp|udpsource |anydestination |anyoperate配置 ICMP协议的扩展访问列表:rule normal|specialpermit|denyicmp source |anydestination |anyicmp-code logging扩展访问控制列表操作符的含义equal portnumber ;等于greater-than portnumber ;大于less-than portnumber ;小于not-equal port
15、number ;不等range portnumber1 portnumber2 ;区间扩展访问控制列表举例Quidwayacl 101Quidway-acl-101rule deny souce any destination anyQuidway-acl-101rule permit icmp source any destination any icmp-type echoQuidway-acl-101rule permit icmp source any destination any icmp-type echo-replyQuidwayacl 102Quidway-acl-102ru
16、le permit ip source 10.0.0.1 0.0.0.0 destination 202.0.0.1 0.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.0 destination-port equal ftpQuidway-acl-103rule permit tcp source any destination 10.0.0.2 0.0.0.
17、0 destination-port equal wwwQuidwayfirewall enableQuidwayfirewall default permit|denyQuidwayint e0Quidway-Ethernet0firewall packet-filter 101 inbound|outbound地址转换配置举例Quidwayfirewall enableQuidwayfirewall default permitQuidwayacl 101 ;内部指定主机可以进入 e0Quidway-acl-101rule deny ip source any destination an
18、yQuidway-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 permit ip source 129.38.1.4 0 destination anyQuidway-acl-101quitQuidwayint e0Quidway
19、-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 destination 202.38.160.1 0Quidway-acl-102rule permit tcp source any destination 202.38.160.1 0 destination-p
20、ort 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从本接口出时变换源地址。内部服务器地址转换配置命令(静态 nat):nat server global port inside port protocol ;global_port不写时使用 inside_port
21、Quidway-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设有公网 IP:202.38.160.101202.38.160.103 可以使用。 ;对外访问(原例题)Quidwaynat address-group 202.38
22、.160.101 202.38.160.103 pool1 ;建立地址池Quidwayacl 1Quidway-acl-1rule permit source 10.110.10.0 0.0.0.255 ;指定允许的内部网络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
23、.10.1 ftp tcpQuidway-Serial0nat server global 202.38.160.102 inside 10.110.10.2 www tcpQuidway-Serial0nat server global 202.38.160.102 8080 inside 10.110.10.3 www tcpQuidway-Serial0nat server global 202.38.160.103 inside 10.110.10.4 smtp udpPPP设置:Quidway-s0link-protocol ppp ;默认的协议PPP验证:主验方:pap|chapQ
24、uidwaylocal-user q2 password simple|cipher hello ;路由器 1Quidwayinterface serial 0Quidway-serial0ppp authentication-mode pap|chapQuidway-serial0ppp chap user q1 ;pap时,没有此句pap被验方:Quidwayinterface serial 0 ;路由器 2Quidway-serial0ppp pap local-user q2 password simple|cipher hellochap被验方:Quidwayinterface se
25、rial 0 ;路由器 2Quidway-serial0ppp chap user q2 ;自己路由器名Quidway-serial0local-user q1 password simple|cipher hello ;对方路由器名帧中继 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 100
26、q1-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 numbe
27、rq1display 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 number启动 ftp服务:Quidwaylocal-user ftp password simple|cipher aaa service-type ftpQuidwayftp server enable