The operating system for Arista switches is called the Extensible Operating System, or EOS for short. Arista describes EOS as “...the interface between the switch and the software that controls the switch and manages the network.” This is sort of like Apple’s macOS in that what you see is actually a kind of Unix (actually a derivative of FreeBSD in OS X) shell; Unix is doing all the heavy lifting behind the scenes. Arista switches run Unix (actually Fedora Core Linux) natively, but to make them easier for nonprogrammers to understand, EOS makes them look more like industry-standard networking devices.
The word extensible means “capable of being extended,” and EOS was designed from the ground up to allow third-party development of add-ons. This is a first in the networking world and is a big departure from traditional proprietary operating systems.
Arista is a big believer in open standards, and there are no proprietary protocols found in EOS that I am aware of. Even features such as Multi-Chassis Link Aggregation Group (MLAG) and Virtual Address Resolution Protocol (VARP), both Arista developments, use behaviors found in existing open-standard protocols, the details of which we cover later in Chapter 18 and Chapter 19.
Perhaps even more impressively, Arista allows the user to access the underlying Linux operating system (OS) and even to write Python and Bash scripts that can control the switch. This is a significant difference from other vendors that advertise that their switches run a derivative of Linux. Although those switches might be based on Linux, you might not be able to get to it, and all the power of Linux remains just out of your grasp while you struggle with a new OS that’s almost like the one you’ve grown accustomed to.
On an Arista switch, the switch is running Linux. In fact, the switch is actually a Linux server with custom hardware that has a lot of interfaces. I’ll show you just how true that is in this book.
Some customers have even built their own interface to the switches, bypassing EOS altogether. Arista offers APIs for programmers toward this end and even hosts a website, EOS Central, where customers can share their ideas or scripts with other users (registration is required).
Arista switches have, at their heart, a database called SysDB (Chapter 7). This database contains the state information and settings for the switch, organized in such a way that every Arista process or agent can access it with ease.
SysDB is a database in the computer science sense of the term, meaning that it is a collection of data in a single place. It is not a database like MySQL with a query language that you can use to access and update tables; rather it’s more like a hierarchical tree of state information that can be accessed and updated by Arista agents.
Traditional networking hardware uses a monolithic software architecture. This means that there is a pretty significant risk of a bug in one section of code affecting or even bringing down the entire device. Furthermore, updating one section of code can be difficult because there can be repercussions in other areas unforeseen by the developer.
Arista’s EOS is more modular. Not only does EOS separate the networking state from the processing, but drivers, processes, management, and even security patches run in user address space, not in memory shared with the kernel. This means that almost any process can be restarted without affecting the state of the network that it controls. This also means that any agent can be upgraded without affecting traffic flow. Agents can be added with ease, and faults are isolated to their individual user spaces. Should one process crash, it cannot affect the rest of the system. Should the process crash or lock up, the EOS process manager (ProcMgr) can restart it without affecting other modules and without affecting the networking state. Because SysDB is just a hierarchy of state information and contains no application code, it is extremely reliable.
Because EOS is so modular, the drivers for the Application-Specific Integrated Circuits (ASICs) are merely agents. Because of this, EOS is the same for every switch Arista makes. There are no release trains, no hardware-specific downloads, and no hours wasted trying to find the right code. If you want EOS 4.21.1F, you download the code named EOS-4.21.1F.swi. If you have a 384-port 7508R chassis switch or a 72-port 7280R fixed-configuration switch, the software image is the same.
If you’ve used an industry-standard switch, you can use an Arista switch. As soon as you log in to an Arista switch, you’ll recognize the look and feel because it’s very similar to, for example, IOS. The important distinction is that it is not IOS because the internals have been completely written from scratch. Only the command-line interface (CLI) is similar.
One of the things that frustrated me when I hooked up my first Arista switch was the fact that telnet is not enabled. In its default configuration, Secure Shell (SSH) is the only means allowed to remotely access EOS. Certainly, console access is allowed, and telnet can be enabled, but in this time of Payment Card Industry (PCI) regulations, Sarbanes-Oxley, and countless other security-centric requirements, keeping telnet disabled is a good idea. As I joke in my training classes, “it’s 20-freaking-19; stop using telnet!”
For my examples, I’m connecting through the console (through a console server). Logging into EOS is as simple as it is with IOS:
Arista-7280 login: admin Last login: Fri Sep 16 15:33:59 on ttyS0 Arista-7280>
With only simple login authentication configured, I am dropped into EXEC mode, which should look pretty familiar. At this point, I can access Privileged EXEC mode by using the enable
command:
Arista-7280>en Arista-7280#
The prompt has changed, as I’d expect it to, and I now have the power. At this point, I’ll add my own username because I like to be accountable for my actions. Actually, that’s a lie. I’m so lazy that I like to have the same username and password on every device I’ve ever configured so that I don’t need to remember them. OK, so that’s not true either, but I thought I’d configure a username just to show how the process of configuration works in EOS.
Again, this is just like the industry standard. Here, I configure from the terminal using the config terminal
command, then configure my username, and then exit:
Arista-7280#conf Arista-7280(config)#
At this point, I am in global configuration mode. By the way, notice how I didn’t type conf t
? Although the CLI will take configure terminal
, the terminal
part is no longer necessary. Why not? I often ask the students in my class what options there are other than terminal. Usually only the old guys know the answer because we haven’t used any of them in years.
I should point out, though, that this has changed in the past couple of years with the advent of features such as config replace
and config session
(Chapter 9), which makes it even more interesting to me that you can still just type conf
to get into configuration mode. Let’s get back to our example:
Arista-7280(config)#username GAD secret ILikePie Arista-7280(config)#exit Arista-7280#exit Arista-7280 login: GAD Password: ILikePie Arista-7280>en Arista-7280#
EOS does not support clear-text passwords, and there is no command service password-encryption
like there is in other operating systems. EOS no longer uses MD5 for encryption of passwords, either, opting instead for the much more powerful and secure SHA512. As such, the running configuration for my user now looks like this:
username GAD secret sha512 $6$dxUPdkGx22Cn5pUd$mok04fVNTa0Z3vvFCvrpNboushWBdiJGi waBcuiLPCAclETvUt.rfENIRbRfFv9TAZmn2JP5u1OBErznruhXu1
Now let’s try entering an abbreviated command:
Arista-7280#ro % Incomplete command
Because that’s ambiguous, I get an Incomplete command error. I can, however, find out what commands are available in one of two ways. First, I can press the “?” (question mark) key. This will give me a list of available commands that match what I’ve entered so far:
Arista-7280(config)#ro? role route-map router
I should also point out that EOS does not show you where you made an error if you make one. IOS will show you a little carrot and point out where you fat-fingered the command. Here’s an example from an old Cisco 3750:
3750(config)#routter ^ % Invalid input detected at '^' marker.
EOS does not do this, instead just giving a generic Invalid Input message:
Arista(config)#routter % Invalid input
Back to figuring out commands from the CLI, I can also press the Tab key, at which point the switch will respond with the longest match based on what I’ve typed so far:
Arista-7280(config)#rou<TAB> Arista-7280(config)#route
Note that I did not type the word route
; the switch inserted that via autocompletion when I pressed Tab. At this point I decided that it’s the router
command I was looking for, so I added the r
and then pressed “?”. The switch then recognized that router
is a command and listed the possible associated keywords:
Arista-7280(config)#router ? bgp Border Gateway Protocol general Protocol independent routing configuration igmp Internet Group Management Protocol (IGMP) isis Intermediate System - Intermediate System (IS-IS) kernel Routes installed by kernel msdp Multicast Source Discovery Protocol (MSDP) multicast Multicast routing commands ospf Open Shortest Path First (OSPF) ospfv3 OSPF Version 3 pim Protocol Independent Multicast rip Routing Information Protocol traffic-engineering traffic-engineering global config
I chose one of these protocols, after which the switch put me into protocol-specific mode and altered the command line to show where I was:
Arista-7280(config)#router ospf 100 Arista-7280(config-router-ospf)#
As with the industry standard, typing exit
(or its nonambiguous abbreviation) got me out of the current level and popped me back up one level:
Arista-7280(config-router-ospf)#ex Arista-7280(config)#
You don’t need to type exit. If you want to work in another mode, you can just type in the command, and EOS will switch modes for you, assuming that it can figure out the proper mode.
By typing end
, or Control-Z, I was able to exit configuration mode entirely:
Arista-7280(config-router-ospf)#end Arista-7280#
At this point I’d like to add that the EOS CLI recognizes some Emacs control characters. I am constantly amazed that even networking guys with decades of experience are unaware of these simple CLI key combinations. The following Control key combinations will have the effects listed:
Entering the interface command, followed by the interface name, puts you into interface configuration mode. Interface configuration mode is similar to IOS, but more robust.
Front-panel interfaces on Arista switches are all Ethernet and are not named in accordance with their speed or type. All Ethernet interfaces on a fixed configuration switch have the name ethernet
interface#
(the space is optional). Ethernet interfaces on modular switches have the name ethernet slot#/interface#
. For example, the first interface on an Arista 7150 is ethernet1
, or e1
for short. The first interface in slot number three of an Arista 7508R modular switch is ethernet 3/1
or e3/1
. On interfaces with lanes such as a 40 Gbps interface, an additional field is added so that the interface name becomes slot#/interface#/laneid
. Thus, on a 7508R with a 40 Gbps blade in slot3, the first interface on the blade would be ethernet 3/1/1
.
Here, I’ve entered the interface configuration mode for ethernet 1
:
Arista-7280#conf Arista-7280(config)#int e1 Arista-7280(config-if-Et1)#
One of the nice enhancements to EOS is that it has no interface range command. To configure multiple interfaces at one time, simply enter them separated by either a hyphen (for a range) or a comma (for a list). In the example that follows, I’ve entered configuration mode for the interfaces e1, e2, e3, and e10. I’ve included the first three as a range:
Arista-7280(config)#int e1-3, e10 Arista-7280(config-if-Et1-3,10)#
Check out the command prompt. It doesn’t show just “range,” but rather shows what interfaces are being configured. I love this feature because I can never remember what I typed a few short seconds ago.
Here’s a super-cool feature that’s been around for a while that was shown to me by Rich Parkin, who gets named credit because I’d been at Arista for five years and didn’t know it was possible only to be shown by the new guy who blew me away with this amazing feature. Imagine that you need to apply IP addresses to a range of interfaces. Wouldn’t it be cool if you could do that in some sort of cool automated fashion? Check this out:
Arista(config)#int e1-4 Arista(config-if-Et1-4)#no switchporth Arista(config-if-Et1-4)#ip address 10.1.{1,4}.1/24
Whoa! Curly braces? In networking?
I joke in my classes all the time that many networking people, upon seeing a curly brace, immediately check out because it looks like programming. If curly braces freak you out, make sure to read my rant about programming in Chapter 30.
Let’s see what this command has done by looking at the running-config:
Arista(config-if-Et1-4)#sho run int e1-4 interface Ethernet1 no switchport ip address 10.1.1.1/24 interface Ethernet2 no switchport ip address 10.1.2.1/24 interface Ethernet3 no switchport ip address 10.1.3.1/24 interface Ethernet4 no switchport ip address 10.1.4.1/24
How cool is that? The third octet has been applied starting at one and incrementing until it got to four. That’s the meaning of {1,4}
. But wait; there’s more! The first two fields that we used are called start and end. You can also add a field to this bit of curly-braced madness, which is called a step. This will allow you to do things like put in only even numbers. Let’s clear the IP addresses and put in the same IP addresses, but this time the third octet will have the numbers 2,4,6,8:
Arista(config-if-Et1-4)#ip address 10.1.{2,8,2}.1/24 Arista(config-if-Et1-4)#sho run int e1-4 interface Ethernet1 no switchport ip address 10.1.2.1/24 interface Ethernet2 no switchport ip address 10.1.4.1/24 interface Ethernet3 no switchport ip address 10.1.6.1/24 interface Ethernet4 no switchport ip address 10.1.8.1/24
Want odd numbers? Start with 1, go to 7, and step 2:
Arista(config-if-Et1-4)#ip address 10.1.{1,7,2}.1/24 Arista(config-if-Et1-4)#sho run int e1-4 interface Ethernet1 no switchport ip address 10.1.1.1/24 interface Ethernet2 no switchport ip address 10.1.3.1/24 interface Ethernet3 no switchport ip address 10.1.5.1/24 interface Ethernet4 no switchport ip address 10.1.7.1/24
But wait; there’s more! You can even use this functionality to name your interfaces—and not only that, you can format the output with padding by adding a pad field. Here I’m adding a description to each interface that reads DC1-Row-XX where XX is a two-digit, right-justified, zero-padded field:
Arista(config-if-Et1-4)#desc DC1-Row-{1,7,2,2} Arista(config-if-Et1-4)#sho run int e1-4 interface Ethernet1 description DC1-Row-01 no switchport ip address 10.1.1.1/24 interface Ethernet2 description DC1-Row-03 no switchport ip address 10.1.3.1/24 interface Ethernet3 description DC1-Row-05 no switchport ip address 10.1.5.1/24 interface Ethernet4 description DC1-Row-07 no switchport ip address 10.1.7.1/24
How cool is that? Pretty darn cool, I’d say.
Back to interface ranges, be warned that the prompt can get a bit unwieldy with long lists of interfaces because they will all show up in the command prompt:
Arista-7280(config)#int e1,3,5,7,9,11,13,15,17,19 Arista-7280R(config-if-Et1,3,5,7,9,11,13,15,17,19)#no ip address Arista-7280R(config-if-Et1,3,5,7,9,11,13,15,17,19)#no description Arista-7280R(config-if-Et1,3,5,7,9,11,13,15,17,19)#switchport Arista-7280(config-if-Et1,3,5,7,9,11,13,15,17,19)#description Odd
Another nice feature of EOS is that I don’t need to exit configuration mode to run exec mode commands. I just run them, and EOS figures it all out. There is no do
command necessary with EOS:
Arista-7280R(config-if-Et1,3,5,7,9,11,13,15,17,19)#sho active interface Ethernet1 description Odd interface Ethernet3 description Odd interface Ethernet5 description Odd interface Ethernet7 description Odd interface Ethernet9 description Odd interface Ethernet11 description Odd interface Ethernet13 description Odd interface Ethernet15 description Odd interface Ethernet17 description Odd interface Ethernet19 description Odd
By the way, that show active command is the same as doing a sho running-config section-name
for the current section when in configuration mode, which in this case happens to be a range of interfaces.
Ooh, here’s another cool Aristacism (I totally made up that word. See Chapter 33): when specifying interface ranges, you can use the dollar sign to indicate the last interface within the range. On an Arista 7010T, this results in the following:
Arista-7010T(config)#int e1-$ Arista-7010T(config-if-Et1-52)#
On a switch that has interfaces with lanes or blades (or both) this will appear to not work:
Arista-7280R(config)#int e1-$ % Incomplete command
This is because some of the interfaces on this switch have lanes and thus are referenced (for example) as int e50/1
. To use the dollar sign in the range on a switch like this you must include all of the possible fields:
Arista-7280R(config)#int e1-$/$ Arista-7280R(config-if-Et1-49/1,50/1,...,53/1,54/1)#
Notice the ellipsis in that range prompt? The developers have made it so that very long ranges are abbreviated to prevent unusable prompts.
Technically, any mode can run commands from any parent mode. If you enter commands from a different mode at the same level (interface- and protocol-specific mode, for example), the mode will switch accordingly. You cannot, however, execute child mode commands from a parent mode. For example, you cannot execute interface-specific commands from within the global configuration mode.
I was able to pipe the output of show run
to include
, which outputs only what I wanted to see. This behavior is similar to the grep
command in Linux. There are a bunch of options for piping in EOS, which you can see by entering | ?
(vertical bar, question mark) after any show
command:
Arista-7280(config)#sho run | ? LINE Filter command by common Linux tools such as grep/awk/sed/wc append Append redirected output to URL begin Begin with the line that matches exclude Exclude lines that match include Include lines that match json Produce JSON output for this command no-more Disable pagination for this command nz Include only non-zero counters redirect Redirect output to URL section Include sections that match tee Copy output to URL
Though include
is similar to grep
, it differs in a significant way. This distinction is important when stacking pipes. The command sho int | inc Ethernet
will output the following:
Arista-7280(config)#sho int | inc Ethernet Ethernet1 is up, line protocol is up (connected) Hardware is Ethernet, address is 001c.7390.93d0 (bia 001c.7390.93d0) Ethernet MTU 9214 bytes , BW 1000000 kbit Ethernet2 is down, line protocol is notpresent (notconnect) Hardware is Ethernet, address is 001c.7390.93d1 (bia 001c.7390.93d1) Ethernet MTU 9214 bytes , BW 10000000 kbit Ethernet3 is down, line protocol is notpresent (notconnect) Hardware is Ethernet, address is 001c.7390.93d2 (bia 001c.7390.93d2) Ethernet MTU 9214 bytes , BW 10000000 kbit [--- output truncated ---]
Now suppose that I wanted to further filter that output and include only the lines that contain the word Hardware. My inclination would be to add another pipe with another include, like this: sho int | inc Ethernet | inc Hardware
. The problem is, this doesn’t work properly (if at all):
Arista-7280#sho int | inc Ethernet | inc Hardware Ethernet MTU 9214 bytes , BW 1000000 kbit Ethernet MTU 9214 bytes , BW 10000000 kbit Ethernet MTU 9214 bytes , BW 10000000 kbit Ethernet MTU 9214 bytes , BW 10000000 kbit Ethernet MTU 9214 bytes , BW 10000000 kbit Ethernet MTU 9214 bytes , BW 10000000 kbit Ethernet MTU 9214 bytes , BW 10000000 kbit
If I change my include
s to grep
s, it works as I desire:
Arista-7280#sho int | grep Ethernet | grep Hardware Hardware is Ethernet, address is 001c.7390.93d0 (bia 001c.7390.93d0) Hardware is Ethernet, address is 001c.7390.93d1 (bia 001c.7390.93d1) Hardware is Ethernet, address is 001c.7390.93d2 (bia 001c.7390.93d2) Hardware is Ethernet, address is 001c.7390.93d3 (bia 001c.7390.93d3) Hardware is Ethernet, address is 001c.7390.93d4 (bia 001c.7390.93d4) Hardware is Ethernet, address is 001c.7390.93d5 (bia 001c.7390.93d5) Hardware is Ethernet, address is 001c.7390.93d6 (bia 001c.7390.93d6) Hardware is Ethernet, address is 001c.7390.93d7 (bia 001c.7390.93d7)
So why does this happen? Whereas include
is part of the command-line interpreter, grep
is a Linux command. Piping is a Linux function, so EOS behaves more like Linux when stacking Linux commands the way I have.
Note that you can also pipe to some Linux commands even though they’re not included in the help output. For example, egrep
is not included in the output, but we can use it from the CLI:
Arista-7280(config)#sho int | egrep -i hardware Hardware is Ethernet, address is 001c.7390.93d0 (bia 001c.7390.93d0) Hardware is Ethernet, address is 001c.7390.93d1 (bia 001c.7390.93d1) Hardware is Ethernet, address is 001c.7390.93d2 (bia 001c.7390.93d2) Hardware is Ethernet, address is 001c.7390.93d3 (bia 001c.7390.93d3) Hardware is Ethernet, address is 001c.7390.93d4 (bia 001c.7390.93d4) Hardware is Ethernet, address is 001c.7390.93d5 (bia 001c.7390.93d5)
Remember, Arista switches aren’t similar to Linux devices; they are Linux devices. If what you’re doing isn’t working the way you’d expect it to, try thinking in terms of a Linux OS. More often than not, you’ll find your answer in the way Linux works.
By the way, if you’re like me and have been forever frustrated by the inability to get a simple list of the Ethernet interface’s MAC addresses, check out this bit of Linux CLI/ Linux madness:
Arista(config)#show int | awk '/^[A-Z]/ {intf=$1} /, address is/{print intf, $6}' Ethernet1 001c.7390.93d0 Ethernet2 001c.7390.93d1 Ethernet3 001c.7390.93d2 Ethernet4 001c.7390.93d3 Ethernet5 001c.7390.93d4 Ethernet6 001c.7390.93d5 [--output truncated--]
If you think that’s cool, save it as an alias:
Arista(config)#alias shmc show int | awk '/^[A-Z]/ {intf=$1} /, address is/{print intf, $6}' Arista(config)#shmc Ethernet1 001c.7390.93d0 Ethernet2 001c.7390.93d1 Ethernet3 001c.7390.93d2 Ethernet4 001c.7390.93d3 Ethernet5 001c.7390.93d4 Ethernet6 001c.7390.93d5 [--output truncated--]
Note that the alias command is one line and is wrapped in print to fit within the margins—it won’t work if you enter it as two lines.
EOS runs a flavor of Linux, and many of the command behaviors reflect that ancestry. For example, by default there is no pagination enabled in EOS when using the console. Therefore, when you execute the show run
command, the output will scroll by until the entire running configuration has been displayed. To paginate on the fly, pipe your output to more
. Just like using more
in Linux, this will pause the output after the screen length (-1) has been met, at which point the prompt --more--
will be shown. At this point, user input is required to continue. Pressing Enter or Return will result in the advancement of a single line, whereas pressing the space bar will show another page. Pressing the letter q (or Q) or pressing Ctrl-C will break the output and return you to the command prompt:
Arista-7280#sho run | more ! Command: show running-config ! device: Arista-7280 (DCS-7280SE-72, EOS-4.16.6F.idboise) ! ! boot system flash:/EOS-4.16.6M.swi ! alias conint sh interface | i connected alias senz show interface counter error | nz alias snz show interface counter | nz alias spd show port-channel %1 detail all alias sqnz show interface counter queue | nz alias srnz show interface counter rate | nz ! alias intdesc !! Usage: intdesc interface-name description 10 config 20 int %1 30 desc %2 40 exit ! transceiver qsfp default-mode 4x10G --More--
Speaking of show running-config
, there’s a cool feature in EOS that will include all of the commands, even the defaults that aren’t usually shown. You do this by including the all
keyword, and you can do it even when showing parts of the configuration such as an interface. Let me show you what I mean. Here’s the output from the command show run int e24
:
Arista#sho run int e24 interface Ethernet24 switchport access vlan 901 switchport mode trunk
And here’s the output of the show run all int e24
command, truncated for brevity. All of the commands you see here are active; they’re just defaults, so they’re not usually shown:
Arista-7280#sho run all int e24 interface Ethernet24 description [ MLAG Peer ] no shutdown default load-interval logging event link-status use-global no dcbx mode no mac-address no link-debounce no flowcontrol send no flowcontrol receive no mac timestamp no speed no l2 mtu default logging event congestion-drops [-- output truncated --]
Another nice function that you can invoke while piping is the nz
command. This outputs only lines that have values of nonzero. Let’s look at an example. Here, we have the output from the command show interfaces counters errors
:
Arista-7280#sho int count error Port FCS Align Symbol Rx Runts Giants Tx Et1 0 0 0 4 4 0 0 Et2 0 0 0 1 1 0 0 Et3 15 0 0 16 1 0 0 Et4 15 0 0 18 3 0 0 Et5 0 0 0 1 1 0 0 Et6 0 0 0 1 1 0 0 Et7 0 0 0 0 0 0 0 Et8 94 0 0 94 0 0 0 Et9 0 0 0 0 0 0 0 Et10 0 0 0 0 0 0 0 Et11 0 0 0 0 0 0 0 Et12 0 0 0 0 0 0 0 Et13 0 0 0 0 0 0 0 Et14 0 0 0 0 0 0 0 Et15 0 0 0 0 0 0 0 [-- output truncated --]
Many of the lines have values of all zeros. Chances are, we don’t care about this information, so why not display the same output without those lines? As here:
Arista-7280#sho interfaces counters errors | nz Port FCS Align Symbol Rx Runts Giants Tx Et1 0 0 0 4 4 0 0 Et2 0 0 0 1 1 0 0 Et3 15 0 0 16 1 0 0 Et4 15 0 0 18 3 0 0 Et5 0 0 0 1 1 0 0 Et6 0 0 0 1 1 0 0 Et8 94 0 0 94 0 0 0 Et45 1 0 0 1 0 0 0
Notice that the lines that were all zero before are no longer included.
When I first started using Arista switches, I had been using Cisco Nexus switches for years, and the lack of the | last
output modifier bugged me when using commands like show log
. Then I sat and thought about what I knew about EOS and had a crazy idea. Remember earlier in this chapter when I showed how we could pipe to the Unix grep
command? It struck me that grep
was not listed as one of the options when piping:
Arista#sho run | ? LINE Filter command by common Linux tools such as grep/awk/sed/wc append Append redirected output to URL begin Begin with the line that matches exclude Exclude lines that match include Include lines that match json Produce JSON output for this command no-more Disable pagination for this command nz Include only non-zero counters redirect Redirect output to URL section Include sections that match tee Copy output to URL
I reasoned that if I could pipe to one Unix command, I would likely be able to pipe to others. The Unix command that would serve me here is tail
, so I cast caution to the wind and went for it with all the vigor of a sleep-deprived nerd hell-bent on discovery.
Here’s the output of the show log
command piped through more
:
Arista-7280#sho log | more Syslog logging: enabled Buffer logging: level debugging Console logging: level errors Monitor logging: level errors Synchronous logging: disabled Trap logging: level informational Sequence numbers: disabled Syslog facility: local4 Hostname format: Hostname only Repeat logging interval: disabled Facility Severity Effective Severity -------------------- ------------- ------------------ aaa debugging debugging accounting debugging debugging acl debugging debugging agent debugging debugging ale debugging debugging arp debugging debugging bfd debugging debugging bgp debugging debugging capacity debugging debugging capi debugging debugging card debugging debugging clear debugging debugging cvx debugging debugging dataplane debugging debugging dot1x debugging debugging envmon debugging debugging eth debugging debugging eventmon debugging debugging --More--
With bated breath, I entered my wicked conglomeration of EOS and Unix commands:
Arista-7280#sho log | tail Sep 16 15:38:02 Arista-7280 Launcher: %LAUNCHER-6-PROCESS_START: Configuring process 'FastClidHelper#2' to start in role 'AllSupervisors' Sep 16 15:38:02 Arista-7280 Launcher: %LAUNCHER-6-PROCMGR_WARMSTART: Initiating warm start of 'ProcMgr (worker)' Sep 16 15:40:18 Arista-7280 Launcher: %LAUNCHER-6-PROCESS_STOP: Configuring process 'FastClidHelper#2' to stop in role 'AllSupervisors' Sep 16 15:40:18 Arista-7280 Launcher: %LAUNCHER-6-PROCMGR_WARMSTART: Initiating warm start of 'ProcMgr (worker)' Sep 16 15:43:05 Arista-7280 Cli: %SYS-5-CONFIG_I: Configured from console by admin on con0 (0.0.0.0) Sep 16 15:45:48 Arista-7280 Cli: %SYS-5-CONFIG_E: Enter configuration mode from console by GAD on con0 (0.0.0.0) Sep 16 15:48:33 Arista-7280 Rib: %OSPF-5-CONVERGED: OSPF in VRF default has converged and its routes are in FIB Sep 16 15:49:16 Arista-7280 Cli: %SYS-5-CONFIG_I: Configured from console by GAD on con0 (0.0.0.0) Sep 16 15:49:59 Arista-7280 Cli: %SYS-5-CONFIG_E: Enter configuration mode from console by GAD on con0 (0.0.0.0) Sep 16 15:55:29 Arista-7280 Cli: %SYS-5-CONFIG_I: Configured from console by GAD on con0 (0.0.0.0)
Holy crap! It worked! Such was my enthusiasm that my wife came into my home office at 2 a.m. and told me to go to bed, or at least keep it down. I suppose I should be lucky to have a wife, being that I’m a guy who finds the ability to mix EOS and Unix commands exciting.
As previously discussed, you can even stack Unix pipes:
Arista-7280#sho log | tail | grep GAD Sep 16 15:45:48 Arista-7280 Cli: %SYS-5-CONFIG_E: Enter configuration mode from console by GAD on con0 (0.0.0.0) Sep 16 15:49:16 Arista-7280 Cli: %SYS-5-CONFIG_I: Configured from console by GAD on con0 (0.0.0.0) Sep 16 15:49:59 Arista-7280 Cli: %SYS-5-CONFIG_E: Enter configuration mode from console by GAD on con0 (0.0.0.0) Sep 16 15:55:29 Arista-7280 Cli: %SYS-5-CONFIG_I: Configured from console by GAD on con0 (0.0.0.0)
Why stop at two? Now that my wife had left me to my late-night spell casting, I ventured down the rabbit hole. How about adding some redirection?
Arista-7280#sho log | tail | grep GAD > /mnt/flash/GAD.txt
Because tail
is a Unix command, we must specify the full path to get to the flash drive. You’ll see what happens if you don’t in Chapter 12.
Now, my GAD.txt file is stored on the flash drive and can be seen with the dir
command from EOS:
Arista-7280#dir Directory of flash:/ -rwx 436644679 May 17 00:44 EOS-4.16.6M.swi -rwx 27 Sep 6 23:27 boot-config drwx 4096 Sep 6 23:34 debug -rwx 424 Sep 16 16:09 gad.txt -rwx 0 Aug 23 06:07 no_ssd_var drwx 4096 Sep 6 23:33 persist drwx 4096 Aug 15 05:38 schedule -rwx 1635 Sep 6 23:31 startup-config -rwx 0 Sep 6 23:33 zerotouch-config 3547889664 bytes total (2658754560 bytes free)
Oh, when it comes to the log, there’s a nifty capability called show logging follow
that shows real-time updates to the syslog from the CLI. I can’t really show that in a static book like this, but it behaves the same way as the tail –f filename
command in Linux.
Lastly, there is a very cool option with show running-config
that I really like. Have you ever wanted to see everything relating to Border Gateway Protocol (BGP)? Well, what if some of your BGP configuration isn’t part of the router BGP section? Check out this overly simplified BGP configuration example:
Arista-7280(config)#ip routing Arista-7280(config)#router bgp 65001 Arista-7280(config-router-bgp)#neighbor 10.0.0.100 remote-as 65100 Arista-7280(config-router-bgp)#comment Enter TEXT message. Type 'EOF' on its own line to end. GAD's Rockin BGP config EOF Arista-7280(config-router-bgp)#int e1 Arista-7280(config-if-Et1)#description BGP uplink Arista-7280(config-if-Et1)#exit Arista-7280(config)#
If I wanted to get all of the BGP commands in one fell swoop, how would I do it? I know, let’s try piping to inc
:
Arista-7280#sho run | inc bgp router bgp 65001 Arista-7280#
Huh...well, that didn’t work. What about all those lines with BGP in them? Maybe we need to search for BGP in all caps?
Arista-7280#sho run | inc BGP description BGP uplink !! GAD's Rockin BGP config Arista-7280#
Now I have the opposite problem where I got only the uppercase BGP matches! grep
to the rescue, right? Nope.
Arista-7280#sho run | grep BGP description BGP uplink !! GAD's Rockin BGP config Arista-7280#
Wait a sec. If I think like a Linux guy, I know that I can use the -i
flag with grep
in order to ignore case:
Arista-7280#sho run | grep -i BGP description BGP uplink router bgp 65001 !! GAD's Rockin BGP config Arista-7280#
Hooray! No, wait...that’s not good enough, either. Look at the description line. It doesn’t show what interface that description is attached to. Luckily, EOS has a way to solve this problem using section
. This works by using show running-config | section <regex>
, where <regex>
is a regular expression.
With this powerful command, check out the output we receive:
Arista-7280#sho run | section bgp interface Ethernet1 description BGP uplink ! router bgp 65001 !! GAD's Rockin BGP config neighbor 10.0.0.100 remote-as 65100 neighbor 10.0.0.100 maximum-routes 12000 Arista-7280#
Beautiful! Not only does it show every line that matches bgp
, but it matches regardless of case and includes the entire section in which that match was found. This is a fabulous tool, and after you become accustomed to using it, you’ll find that it’s damn hard to live without. When troubleshooting a feature like MLAG, the command show run | section mlag
is a powerful tool!
Although EOS has obvious similarities to the industry-standard CLI, there are also clear improvements and changes that should make any seasoned networking veteran happy. Not only that, but remember that the entire OS was written from scratch to be something new, so regardless of how things look, what’s under the covers is arguably better than anything else out there.