返回首页 沁安 · 技术报告

企业交换网络搭建与安全配置(eNSP)

一、实验拓扑概述

1.1 网络拓扑结构

企业交换网络拓扑图

实验拓扑:核心层 + 接入层,VLAN隔离 + 链路聚合

1.2 IP地址规划

设备IP地址子网掩码网关VLAN
PC1192.168.10.1255.255.255.0192.168.10.254VLAN 10
PC2192.168.20.1255.255.255.0192.168.20.254VLAN 20
PC3192.168.10.2255.255.255.0192.168.10.254VLAN 10
PC4192.168.20.2255.255.255.0192.168.20.254VLAN 20
LSW6 Vlanif10192.168.10.254255.255.255.0—VLAN 10
LSW6 Vlanif20192.168.20.254255.255.255.0—VLAN 20

二、配置命令汇总

2.1 LSW6(核心交换机)配置

sysname LSW6 vlan batch 10 20 interface Eth-Trunk 1 description To-LSW4-LSW5 port link-type trunk port trunk allow-pass vlan 10 20 interface GigabitEthernet 0/0/1 eth-trunk 1 interface GigabitEthernet 0/0/2 eth-trunk 1 interface Vlanif 10 ip address 192.168.10.254 255.255.255.0 interface Vlanif 20 ip address 192.168.20.254 255.255.255.0

2.2 LSW4(接入交换机)配置

sysname LSW4 vlan batch 10 20 interface Ethernet 0/0/1 description To-PC1 port link-type access port default vlan 10 port-security enable port-security max-mac-num 1 port-security protect-action restrict interface Ethernet 0/0/2 description To-PC2 port link-type access port default vlan 20 port-security enable port-security max-mac-num 1 port-security protect-action restrict interface Eth-Trunk 10 description To-LSW5 port link-type trunk port trunk allow-pass vlan 10 20 interface Ethernet 0/0/21 eth-trunk 10 interface Ethernet 0/0/22 eth-trunk 10 interface Ethernet 0/0/3 description To-LSW6 port link-type trunk port trunk allow-pass vlan 10 20

2.3 LSW5(接入交换机)配置

sysname LSW5 vlan batch 10 20 interface Ethernet 0/0/1 description To-PC3 port link-type access port default vlan 10 port-security enable port-security max-mac-num 1 port-security protect-action restrict interface Ethernet 0/0/2 description To-PC4 port link-type access port default vlan 20 port-security enable port-security max-mac-num 1 port-security protect-action restrict interface Eth-Trunk 10 description To-LSW4 port link-type trunk port trunk allow-pass vlan 10 20 interface Ethernet 0/0/21 eth-trunk 10 interface Ethernet 0/0/22 eth-trunk 10 interface Ethernet 0/0/3 description To-LSW6 port link-type trunk port trunk allow-pass vlan 10 20

三、核心技术点及实现效果

3.1 VLAN与三层交换

3.2 端口安全

启用端口安全 port-security enable
限制MAC数量 port-security max-mac-num 1
违规处理 port-security protect-action restrict
✔ 防止非法设备接入 · 每端口限1台设备 · 违规可监控

3.3 链路聚合

四、数据流向分析

同VLAN通信(二层转发)

路径:PC1(VLAN10) → LSW4(E0/0/1) → LSW4(Eth-Trunk10) → LSW5 → PC3(VLAN10)

不经过网关,直接在接入层交换机间转发

跨VLAN通信(三层路由)

路径:PC1(VLAN10) → LSW4 → LSW6(路由转发) → LSW4 → PC2(VLAN20)

必须经过LSW6三层路由,实现VLAN间通信