Skip to content

Commit 7d46a06

Browse files
sajusalhellt
andauthored
multicli-blog (#194)
* Create multicli-plugin.md * added multicli * update link * remove unused diagrams script --------- Co-authored-by: Roman Dodin <[email protected]>
1 parent 7494178 commit 7d46a06

File tree

3 files changed

+164
-1
lines changed

3 files changed

+164
-1
lines changed

docs/blog/posts/2023/sr-linux-kubernetes-anycast-lab.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ The topology consists of:
7474

7575
### Kubernetes Service
7676

77-
To illustrate the integration between the workloads running in the k8s cluster and the IP fabric, we will deploy a simple NGINX Echo service replicated across the three k8s nodes. A [MetalLB](https://metallb.universe.tf/)-based [LoadBalancer](https://tkng.io/services/loadbalancer/) service is created to expose the NGINX Echo instances to the fabric and the outside world by establishing BGP sessions with Leaf switches to announce the IP addresses of the exposed services to the IP fabric.
77+
To illustrate the integration between the workloads running in the k8s cluster and the IP fabric, we will deploy a simple NGINX Echo service replicated across the three k8s nodes. A [MetalLB](https://metallb.universe.tf/)-based [LoadBalancer](https://www.tkng.io/services/loadbalancer/) service is created to expose the NGINX Echo instances to the fabric and the outside world by establishing BGP sessions with Leaf switches to announce the IP addresses of the exposed services to the IP fabric.
7878

7979
!!!note
8080
The external IP address that a Load Balancer associates with the service is often called a "virtual IP address" or "VIP".

docs/cli/plugins/multicli.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
# SR Linux MultiCLI project
2+
3+
SR Linux is the industry's most modern Network Operating System (NOS) enabling unmatched automation and programmability features. One of its capabilities is the ability to [customize the CLI](index.md) on SR Linux.
4+
5+
All `show` commands shipped with the SR Linux software are written in executable python scripts leveraging the model-driven infrastructure to query the state.
6+
7+
Users are allowed to take those python scripts, modify them to fit their use case or build a brand new CLI command leveraging the same workflow as our R&D team.
8+
These user-provided CLI scripts are called **Custom CLI plugins** in SR Linux.
9+
10+
Since everything in SR Linux is modeled in YANG from the ground up, this allows the user to accesses any state object or attribute in the system and display it in the format they are familiar with.
11+
12+
So a valid question arises - can we make SR Linux CLI look and feel like another NOS for show commands?
13+
The simple answer is a big **YES WE CAN**.
14+
15+
Let's take an example for the BGP neighbor show command on 4 different Operating Systems.
16+
17+
/// tab | SR Linux
18+
19+
```
20+
$ show network-instance default protocols bgp neighbor
21+
22+
-------------------------------------------------------------------------------------------------------------------------------------------------------
23+
BGP neighbor summary for network-instance "default"
24+
Flags: S static, D dynamic, L discovered by LLDP, B BFD enabled, - disabled, * slow
25+
-------------------------------------------------------------------------------------------------------------------------------------------------------
26+
-------------------------------------------------------------------------------------------------------------------------------------------------------
27+
+-----------------+------------------------+-----------------+------+---------+--------------+--------------+------------+------------------------+
28+
| Net-Inst | Peer | Group | Flag | Peer-AS | State | Uptime | AFI/SAFI | [Rx/Active/Tx] |
29+
| | | | s | | | | | |
30+
+=================+========================+=================+======+=========+==============+==============+============+========================+
31+
| default | 10.10.10.10 | evpn | S | 65500 | established | 0d:0h:52m:0s | evpn | [41/33/14] |
32+
| default | 192.168.10.3 | ebgp | S | 64500 | established | 0d:0h:52m:29 | ipv4- | [4/3/1] |
33+
| | | | | | | s | unicast | |
34+
| default | 192:168:10::3 | ebgp | S | 64500 | established | 0d:0h:52m:34 | ipv6- | [4/3/1] |
35+
| | | | | | | s | unicast | |
36+
| default | 2001::10 | evpn | S | 65500 | established | 0d:0h:52m:0s | evpn | [55/0/14] |
37+
+-----------------+------------------------+-----------------+------+---------+--------------+--------------+------------+------------------------+
38+
-------------------------------------------------------------------------------------------------------------------------------------------------------
39+
Summary:
40+
4 configured neighbors, 4 configured sessions are established, 0 disabled peers
41+
0 dynamic peers
42+
```
43+
44+
///
45+
46+
/// tab | Arista
47+
48+
```
49+
$ show ip bgp summary
50+
51+
BGP summary information for VRF default
52+
Router identifier 1.1.1.1, local AS number 64501
53+
Neighbor Status Codes: m – Under maintenance
54+
Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State PfxRcd PfxAcc
55+
10.10.10.10 E 65500 157 126 0 0 52m Estab 41 33
56+
192.168.10.3 4 64500 113 111 0 0 53m Estab 4 3
57+
192:168:10::3 6 64500 114 111 0 0 53m Estab 4 3
58+
2001::10 E 65500 170 126 0 0 52m Estab 55 0
59+
```
60+
61+
///
62+
63+
/// tab | Cisco NX-OS
64+
65+
```
66+
$ show ip bgp summary
67+
68+
BGP summary information for VRF default, address family IPv4 Unicast
69+
BGP router identifier 1.1.1.1, local AS number 64501
70+
71+
Neighbor V AS MsgRcvd MsgSent InQ OutQ Up/Down State/PfxRcd
72+
---------------------------------------------------------------------------
73+
10.10.10.10 4 65500 159 128 0 0 53m None
74+
192.168.10.3 4 64500 115 113 0 0 54m 4
75+
192:168:10::3 4 64500 116 113 0 0 54m None
76+
2001::10 4 65500 172 128 0 0 53m None
77+
```
78+
79+
///
80+
81+
/// tab | Nokia SR OS
82+
83+
```
84+
$ show router bgp summary
85+
86+
===============================================================================
87+
BGP Router ID:1.1.1.1 AS:64501 Local AS:64501
88+
===============================================================================
89+
BGP Admin State : Up BGP Oper State : Up
90+
Total Peer Groups : 2 Total Peers : 4
91+
Total VPN Peer Groups : 0 Total VPN Peers : 0
92+
Current Internal Groups : 1 Max Internal Groups : 1
93+
Total BGP Paths : 52 Total Path Memory : 18872
94+
--snip---
95+
===============================================================================
96+
BGP Summary
97+
===============================================================================
98+
Legend : D - Dynamic Neighbor
99+
===============================================================================
100+
Neighbor
101+
Description
102+
AS PktRcvd InQ Up/Down State|Rcv/Act/Sent (Addr Family)
103+
PktSent OutQ
104+
-------------------------------------------------------------------------------
105+
10.10.10.10
106+
65500 161 0 00h54m49s
107+
130 0
108+
41/33/14 (Evpn)
109+
110+
192.168.10.3
111+
64500 117 0 00h55m18s
112+
115 0
113+
4/3/1 (IPv4)
114+
115+
192:168:10::3
116+
64500 118 0 00h55m24s
117+
115 0
118+
4/3/1 (IPv6)
119+
120+
2001::10
121+
65500 174 0 00h54m49s
122+
130 0
123+
55/0/14 (Evpn)
124+
125+
-------------------------------------------------------------------------------
126+
```
127+
128+
///
129+
130+
As you can see from the above outputs, each NOS has a unique command and output format to check BGP neighbor status.
131+
132+
What if someone can run all those 4 commands on a single NOS?
133+
134+
This is the power of custom CLI plugins in SR Linux. All the 4 outputs seen above are from the same SR Linux node.
135+
136+
## Introducing MultiCLI project for SR Linux
137+
138+
MultiCLI project is an open source initiative to build SR Linux plugins for 3rd party NOS show commands.
139+
140+
The objective of the project is to help with user onboarding, training and re-use of existing tools in a network while adopting SR Linux.
141+
142+
The first phase of this project includes commands from 4 different NOS - Arista EOS, Cisco NX-OS, Juniper JunOS and Nokia SR OS.
143+
144+
Visit the [MultiCLI](https://github.com/srl-labs/MultiCLI/) git repo to see these plugins and try them using the built-in lab in the repo.
145+
146+
### SR Linux Advantages with plugins
147+
148+
As you test these plugins, you will notice some cool CLI features that comes natively with SR Linux CLI.
149+
150+
1. The native command auto-completion feature also applies to plugins.
151+
152+
2. Using the `tab` key will display the next options that can be navigated using the arrow keys on your keyboard.
153+
154+
3. As you type in a keyword, you will see a lighter shade of the full keyword.
155+
156+
4. Each option can have an associated help section which is fully programmable.
157+
158+
At the end of each command's output, we are also providing the equivalent SR Linux command for users to learn and navigate the SR Linux CLI.
159+
160+
### I need more plugins like this. What should I do?
161+
162+
MultiCLI is an open source project. If you have a command in mind and are willing to develop the plugin, join the project and contribute. Take a look at the tutorial and existing plugins to learn more about developing a plugin.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ nav:
9696
- CLI Plugins:
9797
- cli/plugins/index.md
9898
- Getting started: cli/plugins/getting-started.md
99+
- MultiCLI Project: cli/plugins/multicli.md
99100
- Tutorials:
100101
# - SR Linux tutorials: tutorials/about.md
101102
- tutorials/index.md

0 commit comments

Comments
 (0)