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> #iproute2#network#troubleshooting 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 #iproute2#network#performance 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 // "-")' #iproute2#observability#network Which route is chosen Show the exact route, src IP and oif the kernel picks for a destination ip route get <ip> #iproute2#network#troubleshooting#debug 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 #iproute2#network#security#troubleshooting 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 #iproute2#network#k8s#debug 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> #iproute2#network#performance#troubleshooting Remove netem qdisc Drop the root qdisc to restore normal traffic after netem testing tc qdisc del dev <name> root #iproute2#network#performance Watch route/link events Live stream of route/link/addr/neigh changes; great for flapping debug ip monitor all #iproute2#monitoring#network#debug Bridge FDB and ports Inspect L2 forwarding DB (MAC->port) and bridge port states bridge fdb show br <name>; bridge link show #iproute2#network#troubleshooting#k8s Per-socket TCP internals Show rtt/cwnd/retrans per socket for 443; pinpoint slow/lossy peers ss -tip state established '( dport = :443 )' #iproute2#ss#performance#network#debug Kill sockets by filter Forcibly close matching sockets (kernel>=4.9); needs CONFIG_INET_DIAG_DESTROY ss -K dst <ip> dport = :8080 #iproute2#ss#network#troubleshooting#security
no commands match