Windows – does this ROUTE ADD command fail

networkingroutingwindowswindows xp

I am trying to block access to a single IP address by adding a specific route that leads "nowhere" (instead of the default gateway):


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?


Best Answer

  • You cannot have the loopback device ( be the gateway. It doesn't make sense.

    What you are saying with this command is "route all traffic that goes to this address(es) through this gateway". Because loopback does not route to any network, it does not work.

    Find out which gateway you want this traffic to go through and use that instead. In a comment you mentioned using your own IP address. That might work because your IP would just fail routing the traffic. I have not tested this so ymmv:

    route ADD MASK <OWN_IP> METRIC 10

    Might be worth for you to check out Wikipedia's article on loopback for more information. Also, check out this superuser question for information on the gateway's role in routing.

  • Related Question