iproute2
12 commands
12 shown
Add secondary IP
Assign a secondary IP/prefix live; note: not persisted across reboot
ip addr add 10.0.0.5/24 dev <name> && ip addr show dev <name>
Set interface MTU
Set jumbo MTU and bring link up; note: path MTU must match end-to-end
ip link set dev <name> mtu 9000 && ip link set dev <name> up
JSON addr to jq
Machine-readable interface dump; list UP links with their local IPs
ip -j a | jq -r '.[] | select(.operstate=="UP") | .ifname + " " + (.addr_info[]?.local // "-")'
Which route is chosen
Show the exact route, src IP and oif the kernel picks for a destination
ip route get <ip>
Source-based policy routing
Route by source IP via a separate table; check with ip rule show
ip rule add from <ip> table 100 && ip route add default via 192.168.1.1 dev <name> table 100
Run command in netns
Create an isolated network namespace and run commands inside it
ip netns add test && ip netns exec test ip -br a
Inject latency and loss
Simulate WAN latency/packet loss for testing; remove with tc qdisc del
tc qdisc add dev <name> root netem delay 100ms loss 1% && tc -s qdisc show dev <name>
Remove netem qdisc
Drop the root qdisc to restore normal traffic after netem testing
tc qdisc del dev <name> root
Watch route/link events
Live stream of route/link/addr/neigh changes; great for flapping debug
ip monitor all
Bridge FDB and ports
Inspect L2 forwarding DB (MAC->port) and bridge port states
bridge fdb show br <name>; bridge link show
Per-socket TCP internals
Show rtt/cwnd/retrans per socket for 443; pinpoint slow/lossy peers
ss -tip state established '( dport = :443 )'
Kill sockets by filter
Forcibly close matching sockets (kernel>=4.9); needs CONFIG_INET_DIAG_DESTROY
ss -K dst <ip> dport = :8080
no commands match