Handle minigraph.xml "OutAcl" keyword and support Acl on VlanInterface #3433
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.
- What I did
Parse OutAcl keyword. Config now adds "stage" keyword to generated config with Ingress for InAcl and egress for OutAcl
Also allow Vlan interfaces on Acl configuration
- How I did it
Updated minigraph.py in sonic-config-engine as well as associated test scripts
- How to verify it
Added below section in minigraph.xml and successfully parse it
<AclInterfaces> <AclInterface><ElementType>DataAcl</ElementType><Name i:nil="true"/><AttachTo>Vlan101</AttachTo><OutAcl>v4-A-Out</OutAcl><Type>DataPlane</Type><File i:nil="true"/></AclInterface> <AclInterface><ElementType>DataAcl</ElementType><Name i:nil="true"/><AttachTo>Vlan101</AttachTo><OutAcl>v6-A-Out</OutAcl><Type>DataPlane</Type><File i:nil="true"/></AclInterface> <AclInterface><ElementType>DataAcl</ElementType><Name i:nil="true"/><AttachTo>Vlan102</AttachTo><OutAcl>v4-b-Out</OutAcl><Type>DataPlane</Type><File i:nil="true"/></AclInterface> <AclInterface><ElementType>DataAcl</ElementType><Name i:nil="true"/><AttachTo>Vlan102</AttachTo><OutAcl>v6-b-Out</OutAcl><Type>DataPlane</Type><File i:nil="true"/></AclInterface> <AclInterface><ElementType>DataAcl</ElementType><Name i:nil="true"/><AttachTo>VTY_LINE</AttachTo><InAcl>ipv6-ssh-only</InAcl><Type>SSH</Type><File i:nil="true"/></AclInterface> </AclInterfaces>
/usr/local/bin/sonic-cfggen -H -m minigraph.xml -j /etc/sonic/init_cfg.json --print-data "ACL_TABLE": { "v4-b-Out": { "policy_desc": "v4-b-Out", "ports": [ "Vlan102" ], "stage": "egress", "type": "L3" }, "v6-b-Out": { "policy_desc": "v6-b-Out", "ports": [ "Vlan102" ], "stage": "egress", "type": "L3" }, "v4-A-out": { "policy_desc": "v4-A-out", "ports": [ "Vlan101" ], "stage": "egress", "type": "L3" }, "v6-A-out": { "policy_desc": "v6-A-out", "ports": [ "Vlan101" ], "stage": "egress", "type": "L3" },
- Description for the changelog
Handle "OutAcl" keyword in minigraph.xml for egress ACLs. Support Vlan interfaces for ACL configuration.
- A picture of a cute animal (not mandatory but encouraged)