ARTICLES

Cisco Guest Shell Explained

What is Gues Shell:

In addition to the NX-OS CLI and Bash access on the underlying Linux environment, switches support access to a decoupled execution space running within a Linux Container (LXC) called the “Guest Shell”.

Guestshell is a virtualized Linux-based environment (Shell Container) , designed to run custom Linux applications, including Python for automated control and management of Cisco devices.

From within the Guest Shell the network-admin has the following capabilities:

  • Access to the network over Linux network interfaces.
  • Access to the switch’s bootflash.
  • Access to the switch’s CLI.
  • Access to Cisco NX-API REST.
  • The ability to install and run python scripts.

How Guest Shell works:

How to access Guest shell:

switch_X# guestshell
[guestshell@guestshell ~]$ sudo su
[root@guestshell admin]#

Examples:

  • checking the latency across the network using Iperf
[root@guestshell admin]# iperf -c 10.10.23.1
Connecting to host 10.10.23.1, port 5205
  • Running Python:
Switch> enable
Switch# guestshell enable 
Switch#guestshell run python
Python 2.7.11 (default, March 16 2017, 16:50:55)
[GCC 4.7.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>>>
  • Linux basics commands:
[guestshell@guestshell~]$ pwd
/home/guestshell

[guestshell@guestshell~]$ whoami
guestshell

[guestshell@guestshell~]$ uname -a
Linux guestshell 3.10.101.cge-rt110 #1 SMP Sat Apr 01 08:02:01

References:

[1] developer.cisco.com/docs/nx-os/#!guides-guest-shell/application-hosting-in-nx-os-guest-shell

[2] www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/166/b_166_programmability_cg/guest_shell.html

Related Articles

Back to top button
error: Content is protected !!