Trying to blackhole or reject attacking IPs with route fails
My server is under heavy attack from an ip group in Hong Kong.
Trying to add a blackhole route in Yosemite with any of these commands or similar:
sudo route -v add -net 103.41.124.0/24 -blackhole
sudo route -v add -net 103.41.124.0/24 -reject
sudo route -v add -host 103.41.124.48 -reject
results in something like:
sudo route -v add -net 103.41.124.0/24 -blackhole
Password:
u: inet 103.41.124.0; RTM_ADD: Add Route: len 116, pid: 0, seq 1, errno 0, flags:<UP,GATEWAY,STATIC,BLACKHOLE>
locks: inits:
sockaddrs: <DST,NETMASK>
103.41.124.0 (0) 0 ffff ff
route: writing to routing socket: Invalid argument
add net 103.41.124.0: Invalid argument
What's the problem here?