Quick tip for null routing an IP or subnet in Linux.
My method I’ve always used is:
route add -host 1.2.3.4 reject
For a subnet:
route add -net 1.2.3.0 netmask 255.255.255.0 reject
To remove the null route, you simply replace add with del.
route del -host 4.2.2.2 reject
Sweet, glad I made a note of this. Just needed to use it to emulate a failure for a specific IP so I could test a failure scenario in a bash script.