Network Command Cheat Sheets

One practical page for common network checks. Pick a topic, run the smallest useful command set, then move to packet capture, logs, or config only when the first signals disagree.

Cisco IOS

Cisco Show Commands

Use these first to prove interface state, routes, neighbors, errors, and recent device events.

NeedCommandHow to read the output
Interface summaryshow ip interface briefStatus is physical; Protocol is line protocol. up/down usually means Layer 2 or keepalive issue.
Interface detailshow interfaces Gi0/1Read input/output errors, CRC, drops, resets, bandwidth, duplex, speed, and last flap time.
Switch port stateshow interfaces statusShows connected/notconnect, VLAN, duplex, speed, and port type. Good first check for wrong VLAN or down cable.
Error countersshow interfaces counters errorsCRC/input errors suggest cable, optics, speed/duplex, or physical layer problems.
Device neighborsshow cdp neighbors detailConfirms connected device name, platform, local interface, remote interface, and management IP.
LLDP neighborsshow lldp neighbors detailUse when CDP is disabled or the neighbor is non-Cisco.
Routing tableshow ip routeLook for route source, prefix, next hop, exit interface, metric, and route age.
Specific routeshow ip route 10.10.10.10Shows the selected route for one destination. If missing, check default route or routing protocol.
Forwarding pathshow ip cef 10.10.10.10 detailConfirms hardware/software forwarding adjacency and next hop used by CEF.
ARP tableshow arpMaps IP to MAC. Incomplete ARP means Layer 2, VLAN, gateway, or host reachability issue.
MAC tableshow mac address-table dynamicShows learned MAC, VLAN, and port. MAC on wrong port can indicate loop, move, or cabling issue.
Logsshow loggingLook for link flaps, protocol resets, authentication failures, STP events, and hardware warnings.
CPUshow processes cpu sortedHigh CPU process names point to control-plane load, logging storms, routing churn, or bugs.
Memoryshow memory statisticsLow free memory or processor memory growth can explain instability.
Platform/versionshow versionConfirms uptime, reload reason, IOS version, model, serial, license, and config register.

Workflow: link state, errors, VLAN, ARP/MAC, route, CEF, logs, CPU/memory. Browse the Cisco command reference for configuration examples.

Routing

OSPF Commands

Use these when routes are missing, neighbors are stuck, or OSPF behaves differently per interface.

NeedCommandHow to read the output
Neighbor stateshow ip ospf neighborFULL is healthy. Stuck in INIT, 2WAY, EXSTART, or EXCHANGE points to hello, network type, MTU, or master/slave negotiation.
Neighbor detailshow ip ospf neighbor detailShows dead timer, retransmissions, adjacency uptime, and neighbor interface details.
Interface summaryshow ip ospf interface briefConfirms interface, area, cost, state, neighbor count, and process ID.
Interface detailshow ip ospf interface Gi0/1Read area, network type, timers, cost, DR/BDR, authentication, MTU, and passive state.
OSPF routesshow ip route ospfO is intra-area, O IA inter-area, O E1/E2 external. Missing route means LSDB, area, filter, or redistribution issue.
LSDB summaryshow ip ospf databaseConfirms router, network, summary, and external LSAs exist in the local database.
Specific LSAshow ip ospf database router A.B.C.DUse to inspect links advertised by one router; mismatched LSDB explains missing routes.
External routesshow ip ospf database externalConfirms type 5 LSAs from redistribution. If absent, check ASBR and filters.
Process settingsshow ip protocolsShows router ID, networks, passive interfaces, redistribution, timers, and route filters.
Running configshow running-config | section router ospfConfirms network statements, area mapping, passive-interface, authentication, and redistribution.
OSPF eventsshow logging | include OSPFShows adjacency resets, duplicate router ID, authentication mismatch, or SPF churn.
IPv6 OSPFv3show ipv6 ospf neighborSame neighbor-state logic for OSPFv3; also verify IPv6 enabled on interface.

Check first: area, network type, timers, MTU, passive interface, authentication. Practice the failure states in the OSPF troubleshooting lab.

Routing

BGP Commands

Use these to verify peer state, received prefixes, advertised prefixes, policy impact, and next-hop reachability.

NeedCommandHow to read the output
Peer summaryshow ip bgp summaryState/PfxRcd should show a number. Idle, Active, or Connect means session is not established.
Neighbor detailshow ip bgp neighbors A.B.C.DRead BGP state, uptime, last reset reason, capabilities, timers, message counters, and policy references.
BGP tableshow ip bgp* valid, > best, i iBGP. No best path usually means next hop unreachable or policy rejection.
Specific prefixshow ip bgp 203.0.113.0/24Shows AS path, next hop, local preference, MED, origin, communities, and best-path reason.
Advertised routesshow ip bgp neighbors A.B.C.D advertised-routesConfirms what this router sends to the peer after outbound policy.
Received routesshow ip bgp neighbors A.B.C.D received-routesRequires soft reconfiguration inbound. Shows routes before inbound policy.
Accepted routesshow ip bgp neighbors A.B.C.D routesShows routes accepted from the neighbor after inbound policy.
BGP routes in RIBshow ip route bgpConfirms BGP best paths installed into the routing table. If missing, compare administrative distance and next hop.
Next-hop reachabilityshow ip route A.B.C.DBGP path cannot install if the next hop is unreachable.
Policy objectsshow route-map, show ip prefix-listCheck sequence numbers, permit/deny action, hit counts, and exact prefix length matching.
Config sectionshow running-config | section router bgpVerify remote AS, update source, ebgp-multihop, address-family, route maps, and networks.
VPNv4/VRFshow bgp vpnv4 unicast all summaryFor MPLS/VRF environments, confirms VPNv4 peers and route exchange.

Common miss: next hop unreachable, route-map filtering, prefix-list mismatch, wrong AS, MD5 mismatch. Review the BGP troubleshooting lab.

Switching

VLAN and Trunk Commands

Use these when a host lands in the wrong VLAN, trunk traffic is missing, or MAC learning looks wrong.

NeedCommandHow to read the output
VLAN listshow vlan briefConfirms VLAN exists and which access ports belong to it.
Port switchport modeshow interfaces Gi0/1 switchportRead administrative/operational mode, access VLAN, trunk native VLAN, and allowed VLANs.
Trunk summaryshow interfaces trunkCheck trunking status, native VLAN, allowed VLANs, and VLANs forwarding/not pruned.
Port statusshow interfaces statusShows connected state, VLAN, duplex, speed, and type.
Access port configshow running-config interface Gi0/1Confirms switchport mode, VLAN, port-security, voice VLAN, storm control, and descriptions.
MAC table allshow mac address-table dynamicShows learned MAC, VLAN, and interface. Missing MAC means host silent, wrong VLAN, or blocked path.
MAC by VLANshow mac address-table dynamic vlan 10Limits output to one VLAN when troubleshooting one subnet.
MAC by interfaceshow mac address-table interface Gi0/1Confirms what endpoint or downstream switch is learned on a specific port.
ARP mappingshow ip arp vlan 10Connects IP-to-MAC for the SVI. Incomplete entries show unresolved hosts.
SVI stateshow ip interface brief | include VlanSVI must be up/up for Layer 3 gateway service. Down/down usually means no active ports in VLAN.
Port channelshow etherchannel summaryP means bundled. I or suspended means LACP/config mismatch.
Port securityshow port-security interface Gi0/1Read violation mode, max MACs, current MACs, and security violation count.

Check first: access VLAN, allowed VLAN list, native VLAN, SVI up/up, spanning-tree blocking.

Switching

STP Troubleshooting

Use these when ports block unexpectedly, the root bridge changes, or users report intermittent loops/flapping.

NeedCommandHow to read the output
VLAN STP stateshow spanning-tree vlan 10Read root bridge, local bridge ID, port role, port state, cost, and designated port.
Root summaryshow spanning-tree rootShows root bridge per VLAN. Unexpected root means priority/design issue.
Blocked portsshow spanning-tree blockedportsLists ports intentionally blocking to prevent loops.
Topology changesshow spanning-tree vlan 10 detailRead last topology change, from which port, and how often changes occur.
Inconsistent portsshow spanning-tree inconsistentportsIdentifies ports blocked by Root Guard, Loop Guard, or type inconsistency.
PortFast/BPDU Guardshow spanning-tree interface Gi0/1 detailConfirms edge/portfast state and BPDU activity on a port.
Errdisabled portsshow interfaces status err-disabledShows ports disabled by BPDU Guard, port-security, UDLD, link-flap, or storm-control.
Errdisable reasonshow errdisable recoveryShows causes enabled for auto recovery and remaining timers.
MAC flappingshow logging | include MACFLAP|SPANTREE|STPMAC flaps often point to a loop, wrong port-channel, or unmanaged switch.
Root priority configshow running-config | include spanning-tree vlanConfirms root primary/secondary or manual priority settings.
UDLDshow udld neighborsUse on fiber links to confirm unidirectional link detection state.

Watch: wrong root, BPDU Guard, Root Guard, native VLAN mismatch, MAC flapping.

Linux

Linux Networking Commands

Use these on servers, jump hosts, and appliances to prove local addressing, routes, sockets, DNS, and packets.

NeedCommandHow to read the output
Addressesip addr showCheck interface state, IP/mask, secondary addresses, and whether the interface is UP.
Routesip route showRead default gateway, destination prefixes, interface, and selected source IP.
Route decisionip route get 8.8.8.8Shows exact egress interface, gateway, and source address used for one destination.
Neighbor tableip neigh showREACHABLE is good; FAILED means ARP/ND failure; STALE may still work.
Listening portsss -tulpenShows protocol, local address, port, process, and whether service is bound to loopback or all interfaces.
Active sessionsss -tan state establishedConfirms current TCP sessions and remote endpoints.
Pingping -c 4 8.8.8.8Packet loss, latency, and duplicate packets point to reachability or path quality.
Path tracetraceroute 8.8.8.8 or tracepath 8.8.8.8Shows hop path and where responses stop. tracepath can reveal MTU.
DNS resolverresolvectl statusShows DNS servers, search domains, per-interface DNS, and DNSSEC state on systemd hosts.
DNS querydig example.com A +shortReturns only answer records; empty output means no answer or resolver issue.
Firewall rulessudo nft list ruleset or sudo iptables -SCheck default policy, drops, accepts, NAT, and rule order.
Interface countersip -s link show eth0Read RX/TX packets, drops, errors, overruns, and carrier issues.

Order: IP, route, DNS, port, firewall, packet capture. Verify the path with the Ping & Latency Checker and Traceroute Tool.

Packets

tcpdump Cheat Sheet

Use tcpdump when logs disagree or you need proof that packets reached the interface.

NeedCommandHow to read the output
Host traffictcpdump -i eth0 -nn host 10.0.0.10Shows packets to or from the host. No packets means wrong interface, path, filter, or traffic not generated.
Source onlytcpdump -i eth0 -nn src host 10.0.0.10Proves whether the host sends traffic toward this interface.
Destination onlytcpdump -i eth0 -nn dst host 10.0.0.10Proves return or inbound traffic toward a host.
Port traffictcpdump -i eth0 -nn port 443Shows both TCP/UDP traffic for that port. Add tcp or udp to narrow it.
TCP handshaketcpdump -i eth0 -nn 'tcp[tcpflags] & (tcp-syn|tcp-ack) != 0'SYN without SYN-ACK means server/path/firewall issue. SYN/SYN-ACK/ACK means TCP established.
DNS onlytcpdump -i eth0 -nn udp port 53Look for query and response. Query without response means resolver/path/firewall issue.
ICMPtcpdump -i eth0 -nn icmpShows ping, unreachable, TTL exceeded, and fragmentation-needed messages.
VLAN tagtcpdump -i eth0 -nn -e vlan-e displays Ethernet header, including VLAN tag when visible.
Packet detailtcpdump -i eth0 -nn -vvv host 10.0.0.10More protocol detail: TTL, flags, options, lengths, and DNS details.
Save pcaptcpdump -i eth0 -nn -s 0 -w capture.pcap-s 0 captures full packets. Open the pcap later in Wireshark.
Read pcaptcpdump -nn -r capture.pcapReads saved capture without name resolution.
Rotate filestcpdump -i eth0 -nn -w cap-%H%M.pcap -G 300 -W 12Creates 5-minute capture files and keeps 12 files, useful for intermittent issues.

Tip: use -nn to avoid DNS lookups changing the timing of your capture. For full website path checks, use the Website Not Opening Troubleshooting Guide.

Security

Firewall Troubleshooting Checklist

Use this when traffic is denied, NAT is wrong, VPN traffic fails, or return traffic takes a different path.

CheckCommand or evidenceHow to read the output
Policy matchTraffic log or policy testConfirm source zone, destination zone, source IP, destination IP, service, app, action, and rule name.
Policy orderRulebase lookupFirst match wins. A broad deny or older allow rule can shadow the intended rule.
Source NATNAT rule hit/session translationVerify original source becomes expected translated source and egress interface is correct.
Destination NATNAT rule hit/session translationVerify public destination maps to the correct private IP and port.
Route lookupFirewall route lookup for destinationForward path must leave the expected interface/zone. Check return path separately.
Session tableSession details for 5-tupleLook for allow/deny, timeout, bytes both directions, NAT, ingress/egress, and end reason.
LogsTraffic, threat, system, VPN logsRead deny reason, reset source, policy name, URL/app identification, and decryption status.
Packet captureCapture ingress and egress interfacesIngress only means firewall/routing/NAT/policy issue. Egress only means return path issue.
VPN selectorsProxy ID / traffic selector checkLocal and remote subnets must mirror the peer. Wrong selectors drop interesting traffic.
VPN tunnelIKE/IPsec SA statusPhase 1 up proves peer/auth; Phase 2 up proves selectors/proposals. Counters should increase.
MTU/MSSDF ping, packet size test, TCP MSS profileSmall traffic works but large traffic fails when MTU/MSS/fragmentation is wrong.
Asymmetric pathSession bytes and captures both sidesOne-way byte counters or missing return capture indicate a different return path.

Best evidence: policy hit, session entry, packet capture on ingress and egress. For web outages, pair this checklist with the Website Not Opening Troubleshooting Guide.

DNS

DNS Troubleshooting

Use these when a name resolves differently by location, record type, resolver, or TTL.

NeedCommandHow to read the output
A recorddig example.com A +shortReturns IPv4 answers only. Empty output means no A answer or resolver problem.
AAAA recorddig example.com AAAA +shortReturns IPv6 answers. If clients prefer IPv6, bad AAAA records can break access.
Specific resolverdig @8.8.8.8 example.com ACompares public resolver output with internal resolver output.
Authoritative NSdig example.com NS +shortShows delegated name servers. Wrong NS means delegation issue.
Authoritative answerdig @ns1.example.com example.com AQueries authoritative server directly, bypassing recursive cache.
Trace delegationdig example.com +traceWalks root, TLD, and authoritative servers. Failure point shows delegation/DNSSEC issue.
MX recordsdig example.com MXRead priority and mail host. Lower preference number wins.
TXT recordsdig example.com TXTCheck SPF, verification records, and split long TXT values.
CNAME chaindig www.example.com CNAMEShows alias target. Then resolve the target A/AAAA records.
SOA/serialdig example.com SOASerial helps prove whether authoritative servers have the same zone version.
Reverse DNSdig -x 8.8.8.8Checks PTR record. Useful for mail, logging, and ownership clues.
DNSSECdig example.com DNSKEY +dnssecUse when validation fails; compare DS at parent and DNSKEY at child.

Check: record type, authoritative server, TTL, split DNS, stale resolver cache. Compare results with the DNS Lookup and DNS Propagation Checker.

TLS

SSL Certificate Troubleshooting

Use these when HTTPS fails, certificate chains are incomplete, or the certificate does not match the hostname.

NeedCommandHow to read the output
Live TLS handshakeopenssl s_client -connect example.com:443 -servername example.comCheck certificate chain, verify return code, protocol, cipher, and whether SNI returns the right certificate.
Show full chainopenssl s_client -showcerts -connect example.com:443 -servername example.comConfirms server sends leaf plus required intermediate certificates.
Expiryopenssl x509 -in cert.pem -noout -datesnotBefore and notAfter show validity window.
Subject and issueropenssl x509 -in cert.pem -noout -subject -issuerSubject identifies leaf certificate; issuer should be a trusted CA/intermediate.
SAN namesopenssl x509 -in cert.pem -noout -ext subjectAltNameHostname must match SAN. Common Name alone is not enough for modern clients.
Fingerprintopenssl x509 -in cert.pem -noout -fingerprint -sha256Use to compare deployed cert with expected cert.
Certificate textopenssl x509 -in cert.pem -noout -textShows key usage, extended key usage, SAN, serial, signature algorithm, and public key size.
Verify chainopenssl verify -CAfile chain.pem cert.pemOK means chain validates against provided CA bundle. Errors name the broken link.
Private key matchopenssl x509 -noout -modulus -in cert.pem | openssl md5Compare with private key modulus hash. Hashes must match.
Key modulusopenssl rsa -noout -modulus -in private.key | openssl md5Use with previous command to prove cert and key pair belong together.
TLS versionsopenssl s_client -tls1_2 -connect example.com:443 -servername example.comConfirms whether TLS 1.2 works. Use -tls1_3 for TLS 1.3 checks.
HTTP headers over TLScurl -Iv https://example.comShows TLS negotiation, HTTP status, redirects, HSTS, server header, and certificate subject in curl output.

Common miss: missing intermediate, wrong SNI, expired cert, SAN mismatch, old TLS policy. Confirm the deployed chain with the SSL Certificate Checker.