下午题现在搭建地方比较多,偏重于分析网络环境,给出优化方案,了解协议作用等
但是命令仍占有很大的分值,在此写出一部分命令重点以作复习
命令部分可能有简写,需要进入特定接口的命令使用【】进行标识
基础配置:
system-view //进入配置窗口
sysname net32h //修改系统名
quit
设置接口ip:
interface GigabitEthernet 0/0/1 //进入接口配置界面
ip address 192.168.1.1 24 //配置接口ip地址
访问认证:
telnet server enable //开启telnet服务器
user-interface vty 0 4 //VTY用户界面
protocol inbound telnet //进方向允许telnet协议
authentication-mode aaa //认证方式
AAA:
aaa //进入aaa配置界面
[net32h-aaa]
local-user admin123 password irreversible-cipher admin!@#
//创建本地用户admin123,密码admin!@#,使用不可逆算法加密
local-user admin123 service-type telnet //用户接入方式为telnet
local-user admin123 privilege leverl 15 //级别15
[net32h-ui-vty0-4]
authentication-mode password //认证方式为密码
set authentication password cipher admin!@# //配置登录密码为admin!@#。使用可逆算法加密
user privileger level 15
VLAN 接口划分:
vlan50
vlan betch 10 20 30 40 to 50
[net32h-GigabitEthernet0/0/1]
port link-type access
port default vlan 10
[net32h-GigabitEthernet0/0/2]
port link-type trunk
port trunk allow-pass vlan 20
[net32h-vlan10]
mac-vlan mac-address 0001-0203-0405
[net32h-GigabitEthernet0/0/1]
mac-vlan enable //基于mac划分vlan
display vlan
display port vlan //查看vlan上的接口信息
display mac-vlan //查看基于mac地址划分的vlan配置信息
display ip-subnet-vlan //查看vlan上子网信息
STP:
stp mode stp
stp root primary/secondary //设置优先级为0/4096,且不可修改
stp priority 4096 //默认32768
stp pathcost-standard legacy/dot1t/dot1d-1998 //配置接口路径开销算法
[net32h-GigabitEthernet0/0/1]
stp cost 100
[net32h-GigabitEthernet0/0/2]
stp edged-port enable //设置为边缘接口
stp bpdu-filter enable //启用端口的BPDU报文过滤
#
display stp brief
display stp bridge
display stp topology-change
display stp vlan
MSTP
stp region-configuration
[swA-mst-region]
region-name net32h //域名
instance 1 vlan 20 to 30 //实例1对应vlan20to30
instance 2 vlan 31 to 40
active region-configuration //启用配置
stp instance 1 root primary/secondary
stp bpdu-protection //启用交换机的bpdu保护功能
ACL
acl 2000
rule 5 deny source 192.168.1.0 0.0.0.255 //使用通配符掩码
rule 10 deny source 192.168.2.0 0.0.0.255
rule 15 permit source 192.168.3.0 0.0.0.255
rule 20 permit source 10.1.1.0 0.0.0.255 time-range worktime //匹配worktime的时间段
//2000-2999基本acl,3000-3999高级acl,4000-4999二层acl
acl name net32h 2000 //命名型acl,创建一个名为net32h的acl,编号2000
acl排序方法:自动排序(auto,按照精确度从高到低),配置模式(config,acl编号从小到大)
time-range
time-range worktime 09:00 to 17:00 working-day //工作日
time-range worktime 14:30 to 17:00 off-day //休息日
time-range worktime from 00:00 2024/5/1 to 23:59 2027/5/1
gvrp
[switch-gigabitethernet 0/0/1]
gvrp
gvrp registration normal/fixed/forbidden //设置GVRP的注册模式
trunk
interface eth-trunk 1
[switch-Eth-Trunk 1]
trunkport gigabitethernet 0/0/1 to 0/0/3
或
[switch-gigabitethernet 0/0/1]
eth-trunk 1
port link-type trunk
port trunk allow-pass vlan 20 30
load-blance src-dst-mac //设置负载均衡模式为源-目的-mac方式
lacp
[switch-Eth-Trunk 1]
mode lacp
max active-link number 2 //活动接口上限
[switch]
lacp priority 100 //设置lacp优先级