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
commandRun a command in root | man
programDisplay help menu for program | kill
PIDHalt process by process-id | killall
proccess_nameHalt any processes based on a name |
| historyDisplay recently entered commands | sudo rebootReboot the switch immediately | command
-hDisplay commands help menu | command
&Send command execution to the background(use “fg” to send command to the foreground) |
Linux User Administration Commands
sudo adduser
usernameAdd a user | sudo userdel -r
usernameDelete a user | sudo passwd
usernameChange a user password | sudo passwd -l
usernameDisable a user | id
usernameDisplay user information |
| whoDisplay all logged-in users and their activity | whoamiDisplay the current logged-in user | su
usernameSwitch user | lastDisplay last login of a user(s) | exitLogout of the current session |
Linux Monitoring and Troubleshooting Commands
| topView real-time CPU/memory info | free -mShow free memory in MB | ps auxShow all running processes |
| uptimeDisplay uptime info | nslookup
hostnamePerform DNS lookup | ntpq -pnPerform ntp query |
| datePrint the current date and time | tcpdump -i
interfaceCollect control plane traffic from an interface | clearClear a command-line screen |
| smonctl -vShow PSU/FAN/Temp information | ping
ip_addressCheck connectivity status to remote IP | sudo cl-supportCreate an archive file for troubleshooting.A tar file will be created in the /var/support/ directory. |
Working with Files and Folders
nano
file_nameEdit a text file | treeShow filesystem hierarchy | pwdPrint current folder name | head -n 5
file_nameDisplay top 5 lines of a file |
tail -n 5
file_nameDisplay last 5 lines of a file | tail -f
file_nameFollow file and disaplay new lines | mkdir
folderMake new folder | cd
folderChange into different folder |
| ls -lhaList the files in the current folder | find / -name
file_nameFind file named file_name | find / -name
"string"Find file_name containing string | chmod 777
file_nameChange file permissions to all |
mv
old_file
new_fileMove/rename a file | cp
old_file
new_fileCopy a file | rm
file_nameDelete a file | chown
username
file_nameChange file ownership |
grep
"string"
file_nameSearch file for a text string | touch
file_nameCreate a new file | cat
file_nameDisplay a text file | command
>
new_fileRedirect stadndard command output to a file.e.g. ip link show > ip_addr_output |
cat
/path/file_name
| grep
"string"
>
new_fileFilter one program’s/files output to a file.e.g. cat /var/log/syslog | grep kernel > syslog_kernel_output | command
& >
new_fileRedirect stadndard command output and Standard error to a file.e.g. ifreload -a & > ifreload_output |
NVUE (NVIDIA User Experience) General Commands
| nv list-commandsList all NVUE commands | nv show
[options] attributeShow system configuration | nv set
attributeModify system configurations |
nv unset
attributeRemove system configurations attribute | nv config
commandManage/Apply system configurations | nv
command
-hShow command usage with all its options and attributes |
System Software and Hardware Commands
sudo -E apt list
package_nameShow the list of packages based on package name(all if package_name not specified) | sudo -E apt-get install
package_nameInstall a package from the repository | sudo -E apt-get updateUpdate software packages to latest versions |
sudo apt-cache search
stringLook for packages containing string | sudo systemctl
[start|stop|restart|reload] program.serviceControl current execution of a service | sudo systemctl
[enable|disable] program.serviceSet/unset a service to start on system boot |
| cat /etc/image-releaseShow precise software version | nv show system globalShow switch global configuration | nv show platform software installed
package_nameShow a specific installed software package on the switch(all if package_name not specified) |
| nv show platform capabilitiesShow switch hardware information | nv show platform hardware
component_deviceShow switch hardware information | nv show platform hardware component device fanShow switch PSU/FAN/Temp information |
Working with Interfaces
Using Linux Commands
ip addr show
interfaceLayer 2 and 3 interface status | cl-netstatDisplay interfaces counters | ifup
interfaceSet port admin UP | ifdown
interfaceSet port admin DOWN |
| ifreload -aApply interface configuration changes | ip addr set
ip_address/mask
dev
interfaceSet IP address and mask to an interface | ifquery -sShow ALL interface keywords | ifquery -aShow interfaces config (to be applied) |
ethtool
interfaceShow transceiver information | ethtool -S
interfaceShow port statistics | ethtool -s
interface
speed
speedSet physical interface's speed | ip monitor linkMonitor changes to link state in real time |
Using NVUE Commands
| nv show interfaceHigh-level interfaces status | nv show interface
interfaceDetailed interface status and counters | nv set interface
interface
link state downAdministratively disable physical port |
nv set interface
interface
link state upAdministratively enable physical port(by default all ethernet ports are disabled) | nv set interface
interface
ip address
ip_address/maskSet IP address to physical layer 3 port or loopback | nv set
interface
bridge domain br_defaultCreates a default bridge and sets physical port/s as its member |
nv unset interface
interface
ip addressUnset IP address from an inteface (SVI/layer 3/Lo) | nv set interface vlan
vlan_id
ip address
ip_address/maskCreate 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
speedSet physical interface's speed | nv show interface
interface
[attribute]Show interface's configuration | nv set interface
interface
link breakout
breakout_optionsBreakout physical interfaces according to the supported options |
Important Log Files
| cat /var/log/aptLogs for apt utility | cat /var/log/audit/*Logs for auditd service | cat /var/log/syslogThe main system log | cat /var/log/clagdLogs status of the clagd service |
| cat /var/log/frr/frr.logLocation of the FRRouting log (if enabled) | cat /var/log/rdnbrd.logLogs for redistribute neighbor | cat /var/log/netd.logLog file for NVUE | cat /var/log/ptmdLogs file for ptmd service |
| cat /var/log/switchd.logThe HAL log for NVIDIA Cumulus Linux | cat /var/log/autoprovisionLogs output generated by running the ZTP script | cat /var/log/dpkg.logLog file for packages added or removed using dpkg command |
| cat /var/log/installer/*Directory containing files related to the NVIDIA Cumulus Linux installation | dmesg(driver message) is a command that prints the message buff of the kernel |
Configuration Management with NVUE Commands
| nv config applyApplies the pending configuration | nv config detachDetaches the configuration from the current pending |
nv config saveOverwrites startup configuration with the applied configuration (writes to /etc/nvue.d/startup.yaml). This configuration persists after reboot. |
nv config diff
revision_1
revision_2Compares between two configuration types (e.g. pending vs. applied) | nv config history
nvue-fileShows applied configuration history for the revision |
nv config patch
nvue-fileUpdates pending configuration with a YAML file | nv config replace
nvue-fileReplaces pending configuration with a YAML file |