Linux for Networking Quick Start Cheat Sheet

Using Linux for networking completely unifies the network stack. The switch from traditional networking operating systems is easy and can be done with existing skill sets.
This handy cheat sheet is a quick reference as you learn and use NVIDIA® Cumulus® Linux. It features the most common native Linux, as well as Cumulus NVUE, commands with explanations on how to use them.

Common Linux Commands

sudo command
Run a command in root
man program
Display help menu for program
kill PID
Halt process by process-id
killall proccess_name
Halt any processes based on a name
Display recently entered commands
sudo reboot
Reboot the switch immediately
command -h
Display commands help menu
command &
Send command execution to the background
(use “fg” to send command to the foreground)

Linux User Administration Commands

sudo adduser username
Add a user
sudo userdel -r username
Delete a user
sudo passwd username
Change a user password
sudo passwd -l username
Disable a user
id username
Display user information
Display all logged-in users and their activity
Display the current logged-in user
su username
Switch user
Display last login of a user(s)
Logout of the current session

Linux Monitoring and Troubleshooting Commands

View real-time CPU/memory info
free -m
Show free memory in MB
ps aux
Show all running processes
Display uptime info
nslookup hostname
Perform DNS lookup
ntpq -pn
Perform ntp query
Print the current date and time
tcpdump -i interface
Collect control plane traffic from an interface
Clear a command-line screen
smonctl -v
Show PSU/FAN/Temp information
ping ip_address
Check connectivity status to remote IP
sudo cl-support
Create an archive file for troubleshooting.
A tar file will be created in the /var/support/ directory.

Working with Files and Folders

nano file_name
Edit a text file
Show filesystem hierarchy
Print current folder name
head -n 5 file_name
Display top 5 lines of a file
tail -n 5 file_name
Display last 5 lines of a file
tail -f file_name
Follow file and disaplay new lines
mkdir folder
Make new folder
cd folder
Change into different folder
ls -lha
List the files in the current folder
find / -name file_name
Find file named file_name
find / -name "string"
Find file_name containing string
chmod 777 file_name
Change file permissions to all
mv old_file new_file
Move/rename a file
cp old_file new_file
Copy a file
rm file_name
Delete a file
chown username file_name
Change file ownership
grep "string" file_name
Search file for a text string
touch file_name
Create a new file
cat file_name
Display a text file
command > new_file
Redirect stadndard command output to a file.
e.g. ip link show > ip_addr_output
cat /path/file_name | grep "string" > new_file
Filter one program’s/files output to a file.
e.g. cat /var/log/syslog | grep kernel > syslog_kernel_output
command & > new_file
Redirect stadndard command output and Standard error to a file.
e.g. ifreload -a & > ifreload_output

NVUE (NVIDIA User Experience) General Commands

nv list-commands
List all NVUE commands
nv show [options] attribute
Show system configuration
nv set attribute
Modify system configurations
nv unset attribute
Remove system configurations attribute
nv config command
Manage/Apply system configurations
nv command -h
Show command usage with all its options and attributes

System Software and Hardware Commands

sudo -E apt list package_name
Show the list of packages based on package name
(all if package_name not specified)
sudo -E apt-get install package_name
Install a package from the repository
sudo -E apt-get update
Update software packages to latest versions
sudo apt-cache search string
Look for packages containing string
sudo systemctl [start|stop|restart|reload] program.service
Control current execution of a service
sudo systemctl [enable|disable] program.service
Set/unset a service to start on system boot
cat /etc/image-release
Show precise software version
nv show system global
Show switch global configuration
nv show platform software installed package_name
Show a specific installed software package on the switch
(all if package_name not specified)
nv show platform capabilities
Show switch hardware information
nv show platform hardware component_device
Show switch hardware information
nv show platform hardware component device fan
Show switch PSU/FAN/Temp information

Working with Interfaces

Using Linux Commands

ip addr show interface
Layer 2 and 3 interface status
Display interfaces counters
ifup interface
Set port admin UP
ifdown interface
Set port admin DOWN
ifreload -a
Apply interface configuration changes
ip addr set ip_address/mask dev interface
Set IP address and mask to an interface
ifquery -s
Show ALL interface keywords
ifquery -a
Show interfaces config (to be applied)
ethtool interface
Show transceiver information
ethtool -S interface
Show port statistics
ethtool -s interface speed speed
Set physical interface's speed
ip monitor link
Monitor changes to link state in real time

Using NVUE Commands

nv show interface
High-level interfaces status
nv show interface interface
Detailed interface status and counters
nv set interface interface link state down
Administratively disable physical port
nv set interface interface link state up
Administratively enable physical port
(by default all ethernet ports are disabled)
nv set interface interface ip address ip_address/mask
Set IP address to physical layer 3 port or loopback
nv set interface bridge domain br_default
Creates a default bridge and sets physical port/s as its member
nv unset interface interface ip address
Unset IP address from an inteface (SVI/layer 3/Lo)
nv set interface vlan vlan_id ip address ip_address/mask
Create and set IP address to logical layer 3 port (SVI)
nv set interface bond0 bond member interface(s)
Create bond(LAG) interface and set physical member(s) into it
nv set interface interface link speed speed
Set physical interface's speed
nv show interface interface [attribute]
Show interface's configuration
nv set interface interface link breakout breakout_options
Breakout physical interfaces according to the supported options

Important Log Files

cat /var/log/apt
Logs for apt utility
cat /var/log/audit/*
Logs for auditd service
cat /var/log/syslog
The main system log
cat /var/log/clagd
Logs status of the clagd service
cat /var/log/frr/frr.log
Location of the FRRouting log (if enabled)
cat /var/log/rdnbrd.log
Logs for redistribute neighbor
cat /var/log/netd.log
Log file for NVUE
cat /var/log/ptmd
Logs file for ptmd service
cat /var/log/switchd.log
The HAL log for NVIDIA Cumulus Linux
cat /var/log/autoprovision
Logs output generated by running the ZTP script
cat /var/log/dpkg.log
Log file for packages added or removed using dpkg command
cat /var/log/installer/*
Directory containing files related to the NVIDIA Cumulus Linux installation
(driver message) is a command that prints the message buff of the kernel

Configuration Management with NVUE Commands

nv config apply
Applies the pending configuration
nv config detach
Detaches the configuration from the current pending
nv config save
Overwrites startup configuration with the applied configuration (writes to /etc/nvue.d/startup.yaml). This configuration persists after reboot.
nv config diff revision_1 revision_2
Compares between two configuration types (e.g. pending vs. applied)
nv config history nvue-file
Shows applied configuration history for the revision
nv config patch nvue-file
Updates pending configuration with a YAML file
nv config replace nvue-file
Replaces pending configuration with a YAML file