2
1
I am trying to block access to a single IP address by adding a specific route that leads "nowhere" (instead of the default gateway):
route ADD 199.239.136.200 MASK 255.255.255.255 127.0.0.1 METRIC 10
The problem is that this command fails with the following error:
The route addition failed: The parameter is incorrect.
It doesn't say which parameter is incorrect. I probably violated an implied rule of networking basics but I don't know what it is. Any idea which parameter is incorrect and, more importantly, why?
Thanks.
Yes, I realized that I cannot have 127.0.0.1 be the router for a non 127.0.0.0 destination. The example you gave, however, doesn't make sense either. In fact, I just tried it with ROUTE ADD and it fails because ROUTE ADD is smart enough to notice that "The route addition failed: Either the interface index is wrong or the gateway does not lie on the same network as the interface". At least that. If it were smarter and told me what and why that would've been so much better. In the meanwhile I found a ROUTE ADD variation that does work. See my comment to Nick below. – Android Eve – 2010-10-17T22:36:46.223
1My apologies. I'll edit my example. I was merely trying to help you figure out why 127.0.0.1 won't work. The problem is not about "cannot have 127.0.0.1 be the router for a non 127.0.0.0 destination". Has to do with loopback being a virtual device. Using your own IP address as the gateway could possibly work. – Belmin Fernandez – 2010-10-17T23:09:49.637
No problem. I already gave you +1 for the part that says "You cannot have the loopback device (127.0.0.1) be the gateway". Unlike Nick's answer which pointed at the mask, you correctly pointed at the gateway part of the ROUTE ADD command. I am still not sure, however, that I understand all the rules about what constitutes a valid gateway. I am going to accept your answer, though, because I have at least one version of the ROUTE ADD command that works for me. :) – Android Eve – 2010-10-18T00:11:18.190