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

tool
iproute212 commands
tags
iproute2networksecuritytroubleshooting

More iproute2 commands

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

    Create an isolated network namespace and run commands inside it

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

    Simulate WAN latency/packet loss for testing; remove with tc qdisc del

  • tc qdisc del dev <name> root

    Drop the root qdisc to restore normal traffic after netem testing

  • ip monitor all

    Live stream of route/link/addr/neigh changes; great for flapping debug

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

    Inspect L2 forwarding DB (MAC->port) and bridge port states

all 12 iproute2 commands