Skip to content
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

CLI development changes for PNAC HLD PR 1292 #2859

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

thovikeerthi
Copy link

@thovikeerthi thovikeerthi commented Jun 2, 2023

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:

  • sonic-utilities/config/main.py
  • sonic-utilities/show/main.py
  • sonic-utilities/show/nac.py

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,

  1. Enter the SONiC CLI
  2. Enter into root user mode
  3. Run the new NAC CLI commands

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
root@sonic:
# show nac

NAC Global Information:
NAC Admin State: down
NAC Type : port
NAC Authentication Type : local
root@sonic:# config nac enable
root@sonic:
#
root@sonic:#
root@sonic:
# show nac

NAC Global Information:
NAC Admin State: up
NAC Type : port
NAC Authentication Type : local
root@sonic:#
root@sonic:
#
root@sonic:#
root@sonic:
# config nac disable
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:#
root@sonic:
# config nac type mac
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:#
root@sonic:
# config nac interface disable Ethernet0
root@sonic:#
root@sonic:
#
root@sonic:# show nac interface Ethernet96
+-----------------+------------------+-----------------------+------------------+
| InterfaceName | NAC AdminState | Authorization State | Mapped Profile |
+=================+==================+=======================+==================+
| Ethernet96 | down | unauthorized | |
+-----------------+------------------+-----------------------+------------------+
root@sonic:
#

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 2, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@maipbui
Copy link
Contributor

maipbui commented Jun 29, 2023

@thovikeerthi Please merge latest master code to trigger Semgrep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants