软交换配置
2025/10/29大约 2 分钟
软交换配置
功能说明
软交换口是将防火墙的多个 3 层接口,通过软件的方式,组成一个 2 层交换接口。 当 FortiGate 的每个口都为 3 层路由接口时,可以将其中的接口组成软件交换接口。
VLAN/Hardware 与 Software Switch 的区别
| 功能 | VLAN/Hardware switch | Software switch |
|---|---|---|
| 转发 | 数据包由设备硬件交换机或 SPU 在硬件层面处理 | 数据包由 CPU 处理 |
| STP | 支持 | 不支持 |
| 无线 SSIDs | 不支持 | 支持 |
| 交换接口互访 | 默认允许 | 默认允许,可以通过策略控制 |
功能配置
添加聚合接口,进入网络 → 接口,新建接口。

类型选择软件交换,选择物理接口成员。

重要
建议在不需要的情况下关闭接口配置下的“设备探测”(Device detection)功能,该功能用于 MAC 地址厂商设备信息识别及 MAC 地址过滤,会消耗较多的设备资源,可能导致流量无法被芯片加速。
接口配置页面查看建立的软交换口。

在命令行查看软交换接口的配置。
FortiGate # show full-configuration system switch-interface sw1 config system switch-interface edit "sw1" set vdom "root" set member "port2" "port3" set type switch set intra-switch-policy implicit set mac-ttl 300 set span disable next end
注意事项
软交换口是通过软件的方式模拟出的,需要由 CPU 处理,无法被芯片加速,会影响系统的性能,谨慎使用。(部分型号的设备自带硬交换接口,支持硬件加速,如 100F)。
默认配置下,交换机内部的成员接口之间通信是放通的,可以通过如下命令修改为必须匹配防火墙策略。
FortiGate # config sys switch-interface FortiGate (switch-interface) # edit sw1 FortiGate (test) # set intra-switch-policy ? implicit Traffic between switch members is implicitly allowed. //默认配置,成员之间的流量全部放通 explicit Traffic between switch members must match firewall policies. //根据配置的防火墙策略执行放通或拒绝动作