Linux Networking
Cheat sheet · https://pcornel.dk/topic.php?topic=129
Answer
Linux networking is configured in the kernel (interfaces, addresses, routes, neighbour cache, netfilter) and made persistent by one management tool: NetworkManager, systemd-networkd (often via Netplan on Ubuntu) or ifupdown.
Remember
The ip command shows and changes the live kernel state, but changes are lost at reboot — make them in the managing tool. Find out first which tool owns the interface; two tools fighting over one interface cause settings that revert.
First checks
ip -br addr— interfaces and addressesip route— routing table and default routeip neigh— ARP/neighbour cacheip route get <dest>— route, interface and source chosen for a destinationnmcli device status / networkctl— which tool manages each interface
Commands
ip- Inspect or change Linux networking objects through the iproute2 interface.
ip addr- Inspect or change IPv4 and IPv6 addresses assigned to network interfaces.
ip link- Inspect or change interface link state, MTU, MAC address and link-layer properties.
ip -s link show [DEV]- Interface state and counters.
ip route- Inspect or change kernel routing-table entries and route-selection attributes.
ip neigh- Inspect or change ARP and IPv6 neighbor-cache entries and reachability state.
nmcli- Inspect or change NetworkManager devices, connections, addressing and activation state.
ip addr show [DEV]- Display interface addresses and state.
ip neigh show [to ADDRESS]- Display ARP/ND neighbor cache.
ip -br linkip -br addrip route get <destination>ss -lntupshow vlan brief
Verify in this order
management tool applies config → interface up with carrier → address → route/gateway → neighbour resolved → remote reachable
Where it usually breaks
First mismatch in link/interface → address/namespace → route/neighbor → firewall/policy → socket/daemon → DNS/TLS/SSH/application peer path; preserve identity/native diagnostic/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=129