Network
found top level header in "/notes/linux/network/" that didn't match meta title ("Network Configuration" != "Network")
Modern Linux networking is typically managed through ip commands (from iproute2), NetworkManager (nmcli), or systemd-networkd. This note covers common tasks using these tools.
Viewing Network State
List all interfaces and their addresses:
Show the routing table:
| |
Show active connections and listening ports:
| |
Static IP Address
Using ip commands (temporary, lost on reboot)
Using NetworkManager (persistent)
To modify an existing connection:
Additional IP Addresses
Add a second address to an interface:
| |
With NetworkManager:
Bridges
Create a bridge and add an interface to it:
With NetworkManager:
Spanning Tree
Disable spanning tree on a bridge (common for VM host bridges):
| |
NIC Bonding
Create a bond with two interfaces in active-backup mode:
Common bond modes:
balance-rr(0) - Round-robin for load balancingactive-backup(1) - Only one active interface, failover802.3ad(4) - LACP, requires switch support
VLANs
Create a VLAN interface:
With NetworkManager:
Routing
Enable IP forwarding (required for any routing):
| |
Make it persistent in /etc/sysctl.d/99-routing.conf:
| |
Add a static route:
| |
Useful Tools
ss- Socket statistics (replacement for netstat)ip- Network interface and routing configurationnmcli- NetworkManager command line interfaceconntrack- View/manage connection tracking entriestcpdump- Packet capturemtr- Combines traceroute and ping for network path analysis