acl-loader update command enhancement #1287
Open
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
Added incremental update for datapath acl.
To support backward incremental effect use 'load' command. Now three options for update:
full (add/delete)
incremental (add/delete/update)
load (add/update)
And fixed python3 (cmp not available).
- How I did it
- How to verify it
root@sonic:
# config acl add table MYTESTACL l3# config acl update full acl_rule_1_2.jsonroot@sonic:
root@sonic:~# show acl rule
Table Rule Priority Action Match
MYTESTACL RULE_1 9999 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.1/32
MYTESTACL RULE_2 9998 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.2/32
MYTESTACL DEFAULT_RULE 1 DROP ETHER_TYPE: 2048
root@sonic:
# config acl update incremental acl_rule_1_4.json# show acl ruleroot@sonic:
Table Rule Priority Action Match
MYTESTACL RULE_1 9999 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.1/32
MYTESTACL RULE_2 9998 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.2/32
MYTESTACL RULE_3 9997 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.3/32
MYTESTACL RULE_4 9996 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.4/32
MYTESTACL DEFAULT_RULE 1 DROP ETHER_TYPE: 2048
root@sonic:
# config acl update load acl_rule_1_4.json# show acl ruleroot@sonic:
Table Rule Priority Action Match
MYTESTACL RULE_1 9999 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.1/32
MYTESTACL RULE_2 9998 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.2/32
MYTESTACL RULE_3 9997 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.3/32
MYTESTACL RULE_4 9996 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.4/32
MYTESTACL DEFAULT_RULE 1 DROP ETHER_TYPE: 2048
root@sonic:
## config acl add table MYTESTACL l3- Previous command output (if the output of a command-line utility has changed)
root@sonic:
root@sonic:
# config acl update full acl_rule_1_2.json# show acl ruleroot@sonic:
Table Rule Priority Action Match
MYTESTACL RULE_1 9999 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.1/32
MYTESTACL RULE_2 9998 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.2/32
MYTESTACL DEFAULT_RULE 1 DROP ETHER_TYPE: 2048
root@sonic:
# config acl update incremental acl_rule_1_4.json# show acl ruleroot@sonic:
Table Rule Priority Action Match
MYTESTACL RULE_1 9999 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.1/32
MYTESTACL RULE_2 9998 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.2/32
MYTESTACL RULE_3 9997 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.3/32
MYTESTACL RULE_4 9996 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.4/32
MYTESTACL DEFAULT_RULE 1 DROP ETHER_TYPE: 2048
root@sonic:~
- New command output (if the output of a command-line utility has changed)
oot@sonic:
# config acl update load acl_rule_1_4.json# show acl ruleroot@sonic:
Table Rule Priority Action Match
MYTESTACL RULE_1 9999 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.1/32
MYTESTACL RULE_2 9998 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.2/32
MYTESTACL RULE_3 9997 FORWARD IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.3/32
MYTESTACL RULE_4 9996 DROP IP_PROTOCOL: 6
L4_DST_PORT: 22
SRC_IP: 192.168.1.4/32
MYTESTACL DEFAULT_RULE 1 DROP ETHER_TYPE: 2048