Close sockets by filter

Force-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>

    Add a secondary IP with a prefix on the fly. Note: it is not saved after reboot

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

    Set a jumbo MTU and bring the link up. Note: the MTU must match along the whole path

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

    Get interfaces as JSON and list UP links with their local IPs

  • ip route get <ip>

    Show the route, source IP and outgoing interface that 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 traffic from a source IP through a separate table. Check it with ip rule show

all 12 iproute2 commands