sys
display interface brief /查看端口连接状态
display interface description
display interface brief
display ip interface brief
具体请参考: https://www.wjxy.net.cn/?p=1660
dns resolve /开启域名解析功能
dns server 223.5.5.5 /指定dns服务器
dns server 61.177.7.1
ip route-static 0.0.0.0 0.0.0.0 192.168.100.1 /配置交换机的路由(外网网关应设置一条路由表反指向到交换机 192.168.0.0 255.255.0.0 192.168.100.2)
二级以下交换机也需要指定到 ip route-static 0.0.0.0 0.0.0.0 192.168.100.2 否则局域网访问不了
aaa /进入认证模式设置
local-user admin password /设置交换机密码
local-user admin privilege level 15 /定义用户级别,最高15
local-user admin service-type telnet terminal ssh http /为用户开启连接服务
telnet server enable /打开 telnet
user-interface vty 0 4 /进入0~4的VTY用户视图
authentication-mode aaa /配置VTY用户的验证界面为AAA
protocol inbound all /配置VTY用户界面支持的协议为所有
建VLAN
vlan 100 /建vlan 100
vlan batch 10 20 /批量建vlan
interface Vlanif100 /建VLANIF
ip address 192.168.100.2 255.255.255.0 /指定vlanif ip地址
dhcp select global /指定dhcp地址池
ip pool vlan100 /建IP POOL 给DHCP服务器
gateway-list 192.168.100.2 /DHCP网关
network 192.168.100.0 mask 255.255.255.0 /DHCP网段
excluded-ip-address 192.168.162.2 192.168.162.20 /DHCP保留段
excluded-ip-address 192.168.162.255 /DHCP保留段
dns-list 192.168.100.1 /DNS
port-group group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/46 /批量配置端口
description link-to-user /定义端口提示信息
port link-type access /access模式
port default vlan 100 /默认VLAN 100
quit
interface GigabitEthernet 0/0/47
description link-to-AP
port link-type trunk /trunk 模式
port trunk pvid vlan 110 /默认这个端口获取到的IP是VLAN110(此处按实际需要设置,交换机连接可去除)
port trunk allow-pass vlan 2 to 4094 /允许通过TRUNK的VLAN
acl number 3000 /定义ACL3000
rule 5 deny ip source 192.168.165.0 0.0.0.255 destination 192.168.134.0 0.0.0.255 /拒绝192.168.165.0/24 访问 192.168.134.0/24
rule 10 deny ip source 192.168.165.0 0.0.0.255 destination 192.168.135.0 0.0.0.255
rule 15 deny ip source 192.168.165.0 0.0.0.255 destination 192.168.136.0 0.0.1.255 /拒绝192.168.165.0/24 访问 192.168.136.0/23
rule 100 permit ip source 192.168.165.0 0.0.0.255 /允许192.168.165.0/24内部互访
traffic classifier c1 operator or
if-match acl 3000
traffic behavior b1
permit
traffic policy p1 match-order config
classifier c1 behavior b1
vlan 165
description guest-wifi
traffic-policy p1 inbound
traffic-filter vlan 165 outbound acl 3000