Linux – Block an IP on Linux without the use of iptables

linuxnetworking

I would like to temporarily block all traffic from a single ip address to my host (Ubuntu 10.10, 2.6.35). Normally I'd use iptables but that package is not installed, and while I have root on this box, installing packages is out of the question.

Best Answer

If it would suffice to block the return packets from your host back to the IP in question, you could null route their /32:

# ip route add prohibit w.x.y.z/32 

Inbound traffic will still arrive, but the three-way handshake on TCP connections will not complete, so any new inbound connection (and indeed existing connections) will be rendered useless.