Skip to content

Commit dc52015

Browse files
prprakasjleveque
authored andcommitted
[Sonic-utilities]: Added commands to view acl and port running configs (#557)
[show] Add commands to view acl and port running configs
1 parent c7f45c3 commit dc52015

File tree

2 files changed

+56
-1
lines changed

2 files changed

+56
-1
lines changed

doc/Command-Reference.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -2785,6 +2785,8 @@ This sub-section explains the show commands for displaying the running configura
27852785
3) ntp
27862786
4) snmp
27872787
5) all
2788+
6) acl
2789+
7) interface
27882790

27892791
**show runningconfiguration all**
27902792

@@ -2851,6 +2853,36 @@ This command displays the running configuration of the snmp module.
28512853
admin@sonic:~$ show runningconfiguration snmp
28522854
```
28532855

2856+
**show runningconfiguration acl**
2857+
2858+
This command displays the running configuration of the acls
2859+
2860+
- Usage:
2861+
show runningconfiguration acl
2862+
2863+
2864+
- Example:
2865+
```
2866+
admin@sonic:~$ show runningconfiguration acl
2867+
```
2868+
2869+
**show runningconfiguration interface <interfacename>**
2870+
2871+
This command displays the running configuration of the ports
2872+
2873+
- Usage:
2874+
show runningconfiguration interface <interfacename>
2875+
2876+
2877+
- Example:
2878+
```
2879+
admin@sonic:~$ show runningconfiguration interface
2880+
```
2881+
2882+
```
2883+
admin@sonic:~$ show runningconfiguration interface <interfacename>
2884+
```
2885+
28542886
Go Back To [Beginning of the document](#SONiC-COMMAND-LINE-INTERFACE-GUIDE) or [Beginning of this section](#Startup--Running-Configuration)
28552887

28562888

@@ -3677,4 +3709,4 @@ Once if users go to "vtysh", they can use the routing stack specific commands as
36773709
Refer the routing stack [Quagga Command Reference](https://www.quagga.net/docs/quagga.pdf) or [FRR Command Reference](https://buildmedia.readthedocs.org/media/pdf/frrouting/latest/frrouting.pdf) to know more about about the routing stack configuration.
36783710

36793711

3680-
Go Back To [Beginning of the document](#SONiC-COMMAND-LINE-INTERFACE-GUIDE)
3712+
Go Back To [Beginning of the document](#SONiC-COMMAND-LINE-INTERFACE-GUIDE)

show/main.py

+23
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,29 @@ def all(verbose):
13291329
run_command(cmd, display_cmd=verbose)
13301330

13311331

1332+
# 'acl' subcommand ("show runningconfiguration acl")
1333+
@runningconfiguration.command()
1334+
@click.option('--verbose', is_flag=True, help="Enable verbose output")
1335+
def acl(verbose):
1336+
"""Show acl running configuration"""
1337+
cmd = "sonic-cfggen -d --var-json ACL_RULE"
1338+
run_command(cmd, display_cmd=verbose)
1339+
1340+
1341+
# 'interface' subcommand ("show runningconfiguration interface <interfacename>")
1342+
@runningconfiguration.command()
1343+
@click.argument('interfacename', required=False)
1344+
@click.option('--verbose', is_flag=True, help="Enable verbose output")
1345+
def interface(interfacename, verbose):
1346+
"""Show port running configuration"""
1347+
cmd = "sonic-cfggen -d --var-json PORT"
1348+
1349+
if interfacename is not None:
1350+
cmd += " {0} {1}".format("--interface", interfacename)
1351+
1352+
run_command(cmd, display_cmd=verbose)
1353+
1354+
13321355
# 'bgp' subcommand ("show runningconfiguration bgp")
13331356
@runningconfiguration.command()
13341357
@click.option('--verbose', is_flag=True, help="Enable verbose output")

0 commit comments

Comments
 (0)