how to configure windows to not use default route if static route exists

0

i have server with ip 192.168.0.1 .my gateway is 192.168.0.243 .after adding gateway it adds default route in routing table .

i have remote site 192.168.2.0 when i restricting this remote site to connect to my above server i am adding static route with wrong gateway in my server with lowest metric than default route have . but still the server is using the default route .

khalid khan

Posted 2016-03-30T05:09:58.350

Reputation: 3

Perhaps this could help you out Add a static ip route windows

– NetworkKingPin – 2016-03-30T05:35:06.423

Answers

0

If a valid static route exists it is always preferred over the default. You don't have to configure anything. That is simply the default behavior. The 'default' route is always the route of last resort.

If your static route isn't being use, this almost certainly means it isn't correct.

i am adding static route with wrong gateway

What are you trying to accomplish here? If a system detects and invalid route it is will continue to use the other entries in the route table.

If you are trying to null route a network send it to the loopback address or 0.0.0.0, not some random valid, but inactive IP.

Zoredache

Posted 2016-03-30T05:09:58.350

Reputation: 18 453

thank you Zoredache for the answer ::: when my branch network slows down due to load because of bandwidth issue i am adding static route with wrong gateway so that specific branch should not connect to our server for taking updates . – khalid khan – 2016-03-30T08:52:05.200

i want if static route exists then server should not go default route even if static route gateway is wrong . when this server was on server window 2003 it was working fine but i didn't checked its setting and i upgraded it to server 2008 . – khalid khan – 2016-03-30T08:57:05.900

hi i added route like :: route add 192.168.2.0 mask 255.255.255.0 192.168.0.233 if 1 . here 1 is loopback address 127.0.0.1 .now it works . packets are dropping .....does this route have any side effects eg slowing server etc ? – khalid khan – 2016-03-30T09:42:33.780

Hi Zoredache

with bad luck still the remote site can ping the server . but from server i cannot ping the remote site. – khalid khan – 2016-04-02T06:48:00.507