Implement VLAN distribution functionality for H3C switches and RFC 2868 compliant devices #191
+138
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Users were unable to configure VLAN assignment for H3C switches through the ToughRadius web interface. While the database schema already included
vlanid1andvlanid2fields in theRadiusUsermodel, there was no UI to configure these values and no backend logic to send VLAN assignment attributes during RADIUS authentication.Solution
This PR implements complete VLAN distribution functionality using RFC 2868 tunnel attributes:
UI Enhancements
Backend Implementation
Added VLAN assignment logic in
auth_accept_config.gothat automatically sends RFC 2868 tunnel attributes when users have configured VLAN IDs:Logic Flow
vlanid1) is used first if configuredvlanid2) if primary is not setDocumentation
Added comprehensive documentation in
/docs/VLAN_DISTRIBUTION.mdcovering:Testing
Verified functionality with test cases demonstrating proper tunnel attribute configuration:
Compatibility
This implementation uses standard RFC 2868 tunnel attributes, making it compatible with:
Impact
Resolves the issue where administrators couldn't configure VLAN distribution for H3C switches through the ToughRadius interface.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.