Network Command Reference


This page is a practical command reference for checking addressing, interfaces, routing, switching, DNS, sockets, packet flow, and device state. Command availability and exact output vary by operating system and network platform.

Linux: Interfaces and Addressing

ip -brief address
ip address show
ip -s link show
ip link show dev eth0
ip neigh show
ethtool eth0
ethtool -S eth0

Linux: Routing

ip route show
ip -6 route show
ip route get 203.0.113.25
ip -6 route get 2001:db8::25
ip rule show
ip route show table all

Connectivity and Path Testing

ping 192.0.2.1
ping -6 2001:db8::1
traceroute 203.0.113.25
traceroute6 2001:db8::25
tracepath 203.0.113.25
mtr -rwzbc 100 203.0.113.25
curl -v https://example.com/
nc -vz example.com 443

DNS

dig example.com
dig example.com A
dig example.com AAAA
dig example.com MX
dig @1.1.1.1 example.com
dig +trace example.com
host example.com
resolvectl status
resolvectl query example.com

Listening Ports and Connections

ss -lntup
ss -ntp
ss -s
lsof -i :443
curl -I https://example.com/
openssl s_client -connect example.com:443 -servername example.com

Packet Capture

tcpdump -D
tcpdump -ni eth0
tcpdump -ni eth0 host 192.0.2.25
tcpdump -ni eth0 port 53
tcpdump -ni eth0 'tcp port 443 and host 203.0.113.10'
tcpdump -ni eth0 -s 0 -w capture.pcap

Use -n to avoid DNS lookups during capture, -i to select an interface, -s 0 to capture complete packets, and -w to save a file for Wireshark.

Cisco IOS: Switching

show interfaces status
show interfaces counters errors
show interfaces trunk
show vlan brief
show mac address-table
show mac address-table interface GigabitEthernet1/0/10
show spanning-tree
show spanning-tree interface GigabitEthernet1/0/10 detail
show etherchannel summary
show cdp neighbors detail
show lldp neighbors detail

Cisco IOS: Routing and Services

show ip interface brief
show ipv6 interface brief
show ip route
show ipv6 route
show ip route 203.0.113.25
show ip cef 203.0.113.25 detail
show arp
show ipv6 neighbors
show ip ospf neighbor
show ip bgp summary
show ip bgp neighbors
show access-lists
show logging
show processes cpu sorted
show memory statistics

VyOS

show interfaces
show interfaces ethernet eth0 physical
show ip route
show ipv6 route
show arp
show ipv6 neighbors
show protocols ospf neighbor
show protocols bgp summary
show log
monitor traffic interface eth0
compare
show configuration commands

Evidence Before Changes

Capture command output before clearing counters, restarting services, or changing configuration. The original state may contain the only evidence of the root cause.