Setting VLAN ports with SNMP and PHP on D-Link DGS-1210-28

Should be similar on other switch types.

  1. Retrieve current settings about tagged/untagged VLAN
  2. Modify VLAN settings
  3. Write it back
  4. Save switch state

Be sure not to cut yourself from switch management 🙂

You should have SNMP enabled and configured on switch (user with permission to read and write). We are using there two functions to decompose and compose HEX-STRING readed from switch. Also SNMP PHP package need to be compiled and enabled.

Full example, we are removing port 10 from VLAN1 and adding port 9 tagged:



Share Button

Napsat komentář

Vaše e-mailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *