Run a command in a netns

Create an isolated network namespace and run commands inside it

ip netns add test && ip netns exec test ip -br a

tool
iproute212 commands
tags
iproute2networkk8sdebug

More iproute2 commands

  • tc qdisc add dev <name> root netem delay 100ms loss 1% && tc -s qdisc show dev <name>

    Simulate WAN latency and packet loss for tests. Remove it with tc qdisc del

  • tc qdisc del dev <name> root

    Delete the root qdisc to get normal traffic back after netem tests

  • ip monitor all

    Live stream of route, link, address and neighbor changes. Useful when a link keeps going up and down

  • bridge fdb show br <name>; bridge link show

    Show the L2 forwarding table (MAC->port) and bridge port states

  • ss -tip state established '( dport = :443 )'

    Show rtt, cwnd and retransmits for each connection to remote port 443. Helps find slow or lossy peers

all 12 iproute2 commands