Force Windows Local Subnet Traffic through a Gateway
        Posted  
        
            by 
                Beerey
            
        on Server Fault
        
        See other posts from Server Fault
        
            or by Beerey
        
        
        
        Published on 2011-02-17T06:44:16Z
        Indexed on 
            2011/02/17
            7:27 UTC
        
        
        Read the original article
        Hit count: 692
        
Hi all,
We are attempting to route all traffic from a certain machine to a gateway. This works ok for traffic destined for subnets outside of the machine's subnet. However, traffic to machines in the same subnet as the source machine goes through an On-Link gateway in Windows. This means that the default gateway is ignored, and traffic in a subnet (for example, 192.168.50.10 -> 192.168.50.11) flows.
Destination Netmask     Gateway     Interface   Metric
192.168.50.0    255.255.255.0   On-link     192.168.50.214  276
- This route can be deleted from Windows, but when the machine is rebooted it always comes back.
 - Adding a persistant static route to the gateway with a lower metric doesn't work, since it will still try the On-Link gateway after the persistant route fails.
 - Adding each machine in a VLAN isn't an option due to the setup we have
 - Adding a startup script to delete the gateway isn't a great option either, since users will have full admin access to the machine and might disable the script.
 - We cannot transperantly intercept all network traffic on the subnet using Gratuitous ARPs or transparent proxying, since there are other machines on the subnet which use a different gateway
 
The only way we have gotten it to work is by adding a persistant route to the gateway for the subnet traffic, and deleting the On-link route on reboot.
The question is then.
- Is there a way to permanently remove this On-link route
 - If not, is there a way to otherwise force even local subnet traffic to go through a gateway?
 
© Server Fault or respective owner