We have a D-Link DGS-1216T managed switch with two VLANs, VID25 is connected to port 15 and VID26 is connected to port 16.
Users should be able to log in (hardcoded username/password) to a custom webpage (php?) and select which of the switch ports 1-14 that should belong to either of the two VLANs above.
When the click the webpage's Apply button the switch' VLAN settings should be configured accordingly via SNMP.
## Deliverables
You need to have access to a managed switch compatible with D-Link DGS-1216T to be able to test your script.
Please state if you have a clever solution to 'hide' the login credentials for users selecting the 'view source' of the web page ;-) We don't need .gov protection, but we are open for clever solutions.
The web page itself should be simple with a title and 14 radio group pairs:
D-Link switch VLAN settings
Port 1 2 3 4 5 6 7 8
VID-25 o o o o
VID-26 o o o o
Apply btn.
If the spaces are stripped above I meant to indicate in the example that port 1,2 and 5,6 are member of VID-25 and port 3,4 and 7,8 are member of VID26.
The script should read the current VLAN settings from the switch IP and display the radio group settings according to the VLAN membership of port 1-14.
If the switch is unavailable or it does not have VLANs VID25 and VID26, an appropriate error message should be displayed.
When the webpage's Apply button is clicked the currect configuration should be sent to the switch via SNMP and a confirmation message displayed when the switch has acknowledged the setting.
Let me know if you need further details, and I will add it here.