通过 SNMP 在 Netgear 交换机上配置 vlan

通过 SNMP 在 Netgear 交换机上配置 vlan

我正在尝试使用 netsnmp 从 Linux 命令行配置 netgear GS752TSX 上的 vlan。我在 Web 界面上创建了 vlan 99,现在想要控制 pvid 设置、出口和标记。我已将这些标识为需要更改的 MIB:

dot1qPvid.<port>
dot1qVlanStaticEgressPorts.99
dot1qVlanStaticUntaggedPorts.99

Pvid 的工作方式与我预期的一样:

$ snmpset -r 1 -t 20 -v 2c -c private <switch> dot1qPvid.17 u 99
Q-BRIDGE-MIB::dot1qPvid.17 = Gauge32: 99
$ snmpget -r 1 -t 20 -v 2c -c private <switch> dot1qPvid.17
Q-BRIDGE-MIB::dot1qPvid.17 = Gauge32: 99

出站端口也是如此:

$ snmpset -r 1 -t 20 -v 2c -c private <switch> dot1qVlanStaticEgressPorts.99 x 'ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
Q-BRIDGE-MIB::dot1qVlanStaticEgressPorts.99 = Hex-STRING: FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 
$ snmpget -r 1 -t 20 -v 2c -c private <switch> dot1qVlanStaticEgressPorts.99
Q-BRIDGE-MIB::dot1qVlanStaticEgressPorts.99 = Hex-STRING: FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 

但取消标记端口似乎无法记住我的设置:

$ snmpset -r 1 -t 20 -v 2c -c private <switch> dot1qVlanStaticUntaggedPorts.99 x 'ff ff ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
Q-BRIDGE-MIB::dot1qVlanStaticUntaggedPorts.99 = Hex-STRING: FF FF FF FF FF FF 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 
$ snmpget -r 1 -t 20 -v 2c -c private <switch> dot1qVlanStaticUntaggedPorts.99
Q-BRIDGE-MIB::dot1qVlanStaticUntaggedPorts.99 = Hex-STRING: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 

我已经尝试过 netsnmp 5.4.1 和 5.7.2。

我做错什么了吗?

相关内容