Interfaces & Routing
The ip command (iproute2)
ip replaces the deprecated ifconfig/route/netstat tools.
| Command | Shows / does |
|---|---|
ip addr (ip a) | Interface addresses |
ip link | Interface state (up/down) |
ip route (ip r) | Routing table |
ip addr add 192.168.1.5/24 dev eth0 | Add an address |
ip link set eth0 up | Bring interface up |
ip route add default via 192.168.1.1 | Set default gateway |
$ ip -br addr
lo UNKNOWN 127.0.0.1/8
eth0 UP 192.168.1.10/24
Exam tip: Changes made withipare not persistent - they vanish on reboot. Persist them via NetworkManager (nmcli) or config files.