1 查看版本信息 display version 此命令用于查看交换机的版本信息,包括交换机的软件版本、硬件版本、启动程序版本等。 2 查看系统时间 display clock 此命令用于查看交换机的系统时间。 3 设置系统时间 clock datetime 2023-11-21 10:30:00 此命令用于设置交换机的系统时间。 4 查看设备名称 display current-configuration | include sysname 此命令用于查看交换机的设备名称。 5 设置设备名称 sysname Switchcore 此命令用于设置交换机的设备名称。
1 查看接口状态 display interface GigabitEthernet0/0/1 此命令用于查看指定接口的状态,包括接口速率、协议状态等。 2 配置接口IP地址 interface GigabitEthernet0/0/1 ip address 192.168.1.100 24 此命令用于配置指定接口的IP地址及子网掩码。 3 配置接口VLAN interface GigabitEthernet0/0/1 port link-type access port default vlan 10 此命令用于配置指定接口的VLAN,将接口加入到指定的VLAN中。 4 配置接口链路聚合 interface Eth-Trunk1 trunkport GigabitEthernet0/0/1 to GigabitEthernet0/0/2 此命令用于配置链路聚合,将多个接口聚合成一个逻辑接口,提高带宽和可靠性。
1 创建VLAN vlan batch 10 to 20 此命令用于创建多个VLAN。 2 配置VLAN名称 vlan 10 name Sales 此命令用于为指定的VLAN配置名称。 3 将接口加入VLAN interface GigabitEthernet0/0/1 port link-type accessport default vlan 10 此命令用于将指定接口加入到指定的VLAN中。
1配置静态路由 ip route-static 0.0.0.0 0.0.0.0 192.168.1.254 此命令用于配置静态路由,将指定的目的网络流量路由到指定的下一跳地址。 2 查看路由表 display ip routing-table 此命令用于查看交换机的路由表。 3 配置OSPF ospf area 0network 192.168.1.0 0.0.0.255 此命令用于配置OSPF协议,将指定的网络加入到指定的区域中。
1 配置Telnet用户 user-interface vty 0 4 authentication-mode schemeprotocol inbound telnet 此命令用于配置Telnet用户,允许用户通过Telnet协议登录交换机。 2 配置SSH用户 user-interface vty 0 4 authentication-mode aaaprotocol inbound ssh 此命令用于配置SSH用户,允许用户通过SSH协议登录交换机。 3 配置ACL acl number 3000 rule permit tcp source 192.168.1.0 0.0.0.255 destination any eq 80 此命令用于配置ACL,限制指定的源IP地址访问指定的目的IP地址和端口。
1 配置流量管控 traffic classifier test operator and if-match acl 3000traffic behavior testremark ip-precedence 5qos policy testclassifier test behavior testinterface GigabitEthernet0/0/1qos apply policy test inbound 此命令用于配置流量管控,通过ACL匹配指定的流量,然后对匹配的流量进行处理,例如标记IP优先级。 2 配置队列调度 interface GigabitEthernet0/0/1 qos queue 1queue-length 1024 packetsqos queue 2queue-length 2048 packetsqos queue 3queue-length 4096 packetsqos queue 4queue-length 8192 packetsqos schedule wfq 此命令用于配置队列调度,将交换机的端口划分为多个队列,并为每个队列配置不同的队列长度和队列调度算法。 3 查看QoS配置 display qos interface GigabitEthernet0/0/1 此命令用于查看指定接口的QoS配置信息。
1 备份配置文件 backup startup-configuration to flash:/backup.cfg 此命令用于备份交换机的配置文件到指定的存储介质中。 2 恢复配置文件 startup saved-configuration flash:/backup.cfg 此命令用于从指定的存储介质中恢复交换机的配置文件。 3 清除交换机配置 reset saved-configuration 此命令用于清除交换机的配置文件,恢复出厂设置。
1、交换机开启dhcp服务 [Huawei] dhcp enable 2、配置用户网关,并在接口下开启dhcp全局模式 [Huawei] interface vlanif 10 [Huawei-Vlanif10] ip address 192.168.10.254 255.255.255.0 [Huawei-Vlanif10] dhcp select global [Huawei-Vlanif10] quit [Huawei] 3、创建地址池 [Huawei] ip pool vlan10 [Huawei-ip-pool-pool1] network 192.168.10.0 mask 255.255.255.0 [Huawei-ip-pool-pool1] dns-list 114.114.114.114 [Huawei-ip-pool-pool1] gateway-list 192.168.10.254 4、保留 192.168.10.1-192.168.10.10 不下发 [Huawei-ip-pool-pool1] excluded-ip-address 192.168.10.1 192.168.10.10 [Huawei-ip-pool-pool1] quit
开启telent telnet service enable 设置AAA local-user admin password cipher admin privilege level 15 创建一个用户 local-user admin service-type telnet 用户远程类型 进入远程视图 user-interface vty 0 4 //用户指定虚拟用户终端接口 authentication-mode aaa //配置认证模式为aaa protocol inbound telnet quit //退出