Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save RafalSladek/c467c74b2c50ec7e5b31efc7f88a6812 to your computer and use it in GitHub Desktop.

Select an option

Save RafalSladek/c467c74b2c50ec7e5b31efc7f88a6812 to your computer and use it in GitHub Desktop.
how to separate which ips get routed over specific nic under windows
@echo off
rem works for windows server 2008
rem 192.168.43.1 - wifi/tethering over phone (IF 25)
rem 10.0.32.200 - lan (IF 11)
rem delete routes to internet
route delete 0.0.0.0
route delete 0.0.0.0 MASK 0.0.0.0 10.0.32.200 IF 11
route delete 0.0.0.0 MASK 0.0.0.0 192.168.43.1 IF 25
rem add routes for special subnets over interface 25 (wifi/lte) only
route -p add 79.137.82.0 MASK 255.255.255.0 192.168.43.1 METRIC 5 IF 25
route -p add 213.32.29.0 MASK 255.255.255.0 192.168.43.1 METRIC 5 IF 25
rem add route for internet over interface 11 (lan)
route -p add 0.0.0.0 MASK 0.0.0.0 10.0.32.200 METRIC 100 IF 11
route print
timeout /t 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment