CLI development changes for PNAC HLD PR 1292 #2859
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
Adding CLI development code changes for the feature PNAC as per HLD PR 1292.
How I did it
Added code changes at CLI's 'config' and 'show' module sets to configure and monitor the PNAC feature via SONiC CLI
Code changes at:
How to verify it
Existing SONiC CLI framework is enhanced to support this new CLI additions and these commands available similar to other command sets.
To verify it,
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)
Configure & set NAC feature globally
admin@sonic:
$ sudo -i# show nacroot@sonic:
NAC Global Information:
NAC Admin State: down
NAC Type : port
NAC Authentication Type : local
root@sonic:
# config nac enable#root@sonic:
root@sonic:
## show nacroot@sonic:
NAC Global Information:
NAC Admin State: up
NAC Type : port
NAC Authentication Type : local
root@sonic:
##root@sonic:
root@sonic:
## config nac disableroot@sonic:
root@sonic:
##root@sonic:
root@sonic:~# show nac
NAC Global Information:
NAC Admin State: down
NAC Type : port
NAC Authentication Type : local
root@sonic:~#
Configure & set NAC Type:
root@sonic:
# config nac type mac#NAC feature not enabled. Enable feature to configure NAC settings
root@sonic:
root@sonic:
# config nac enable#root@sonic:
root@sonic:
## config nac type macroot@sonic:
root@sonic:
##root@sonic:
root@sonic:~# show nac
NAC Global Information:
NAC Admin State: up
NAC Type : mac
NAC Authentication Type : local
Configure & set NAC Interface level:
root@sonic:
# show nac interface all#+-----------------+------------------+-----------------------+------------------+
| InterfaceName | NAC AdminState | Authorization State | Mapped Profile |
+=================+==================+=======================+==================+
| Ethernet0 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet100 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet104 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet108 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet112 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet116 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet12 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet120 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet124 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet16 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet20 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet24 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet28 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet32 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet36 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet4 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet40 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet44 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet48 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet52 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet56 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet60 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet64 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet68 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet72 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet76 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet8 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet80 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet84 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet88 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet92 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
| Ethernet96 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
root@sonic:
root@sonic:
##root@sonic:
root@sonic:
##root@sonic:
root@sonic:
# config nac interface enable Ethernet0#root@sonic:
root@sonic:
# show nac interface Ethernet0#+-----------------+------------------+-----------------------+------------------+
| InterfaceName | NAC AdminState | Authorization State | Mapped Profile |
+=================+==================+=======================+==================+
| Ethernet0 | up | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
root@sonic:
root@sonic:
## config nac interface disable Ethernet0root@sonic:
root@sonic:
##root@sonic:
root@sonic:
# show nac interface Ethernet96#+-----------------+------------------+-----------------------+------------------+
| InterfaceName | NAC AdminState | Authorization State | Mapped Profile |
+=================+==================+=======================+==================+
| Ethernet96 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
root@sonic: