Kill sockets by filter

Forcibly close matching sockets (kernel>=4.9); needs CONFIG_INET_DIAG_DESTROY

ss -K dst <ip> dport = :8080

tool
iproute212 commands
tags
iproute2ssnetworktroubleshootingsecurity

More iproute2 commands

  • ip addr add 10.0.0.5/24 dev <name> && ip addr show dev <name>

    Assign a secondary IP/prefix live; note: not persisted across reboot

  • ip link set dev <name> mtu 9000 && ip link set dev <name> up

    Set jumbo MTU and bring link up; note: path MTU must match end-to-end

  • ip -j a | jq -r '.[] | select(.operstate=="UP") | .ifname + " " + (.addr_info[]?.local // "-")'

    Machine-readable interface dump; list UP links with their local IPs

  • ip route get <ip>

    Show the exact route, src IP and oif the kernel picks for a destination

  • ip rule add from <ip> table 100 && ip route add default via 192.168.1.1 dev <name> table 100

    Route by source IP via a separate table; check with ip rule show

all 12 iproute2 commands