-
Notifications
You must be signed in to change notification settings - Fork 103
Initial implementation of iol2 STP #2481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
91904cf
Enable STP module on ioll2. Add initial STP template
db273fb
Handle "normal", ensuring no portfast
88b90e6
nitial documenation in STP module docs.
e9775c3
Fix empty line deleted by mistake in STP module docs.
9d5e434
If stp is diabled, disable valns 1-4094, instead
fef75ca
Clean template in the light of prevoious commit to ease mentenance
f4168fc
Guard against undefined stp.enable
0ad436d
Unconditionally default to "long" pathcost calculations.
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| {% if stp.enable == False %} | ||
| no spanning-tree vlan 1-4094 | ||
| {% else %} | ||
|
|
||
| {% set proto_map = { 'stp': 'mst', 'rstp': 'mst', 'pvrst': 'rapid-pvst', 'mstp': 'mst' } %} | ||
| {% set mode = proto_map[stp.protocol] %} | ||
|
|
||
| {# options are stp rstp, rapid-pvst or mstp (default if not set) #} | ||
|
|
||
| spanning-tree mode {{ mode }} | ||
|
|
||
|
|
||
| {% if stp.port.type is defined and stp.port.type == 'auto' %} | ||
| spanning-tree portfast default | ||
| {% endif %} | ||
|
|
||
| {% if 'priority' in stp %} | ||
| {% if stp.protocol != 'pvrst' %} | ||
| spanning-tree mst 0 priority {{ stp.priority }} | ||
| {% endif %} | ||
| {% endif %} | ||
|
|
||
| {# Check for per-VLAN enable and priority; implies Rapid-PVST #} | ||
| {% if vlans is defined and stp.protocol == 'pvrst' %} | ||
| {% for vname,vdata in vlans.items() %} | ||
| {% if not vdata.stp.enable|default(True) %} | ||
| no spanning-tree vlan {{ vdata.id }} | ||
| {% elif vdata.stp.priority is defined %} | ||
| spanning-tree vlan {{ vdata.id }} priority {{ vdata.stp.priority }} | ||
| {% elif stp.priority is defined %} | ||
| spanning-tree vlan {{ vdata.id }} priority {{ stp.priority }} | ||
| {% endif %} | ||
| {% endfor +%} | ||
| {% endif %} | ||
|
|
||
| {% for ifdata in interfaces if 'stp' in ifdata %} | ||
| {% if ifdata.vlan.trunk_id is defined or ifdata.vlan.access_id is defined %} | ||
| interface {{ ifdata.ifname }} | ||
| {% if not ifdata.stp.enable|default(True) %} | ||
| ! Disable STP on this interface, i.e. dont receive or send BPDUs | ||
| spanning-tree bpdufilter enable | ||
| {% elif 'port_priority' in ifdata.stp %} | ||
| # | ||
| # Use 16x port_priority to get the correct 4-bit value on the wire | ||
| # | ||
| {% if stp.protocol == 'pvrst' %} | ||
| spanning-tree port-priority {{ ifdata.stp.port_priority * 16 }} | ||
| {% else %} | ||
| spanning-tree mst 0 port-priority {{ ifdata.stp.port_priority * 16 }} | ||
| {% endif %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {% if ifdata.stp.port_type is defined %} | ||
| {% set _ptype = ifdata.stp.port_type %} | ||
| {% if _ptype == 'network' or _ptype == 'normal'%} | ||
| no spanning-tree portfast | ||
| {% elif _ptype == 'edge' %} | ||
| spanning-tree portfast | ||
| {% if ifdata.vlan.trunk_id is defined%} | ||
| spanning-tree portfast trunk | ||
| {% endif %} | ||
| {% endif %} {# _ptype #} | ||
| {% endif %} {# ifdata.stp.port.type#} | ||
| {% endfor %} | ||
| {% endif %} {# stp.enable #} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.