Skip to content

Instantly share code, notes, and snippets.

@ya-pulser
Created April 3, 2012 17:33
Show Gist options
  • Save ya-pulser/2293927 to your computer and use it in GitHub Desktop.
Save ya-pulser/2293927 to your computer and use it in GitHub Desktop.
Set of cmd/bat files to turn routing under Windows 7 from one network card to other
route delete 0.0.0.0
set INTERFACE=11
set ROUTER=192.168.12.1
route add 0.0.0.0 MASK 0.0.0.0 %ROUTER% IF %INTERFACE%
netsh interface ip set dns %INTERFACE% static %ROUTER% register=primary validate=no
netsh interface ip add dns %INTERFACE% 212.48.193.36 index=2 no
netsh interface ip add dns %INTERFACE% 8.8.8.8 index=3 no
netsh interface ip add dns %INTERFACE% 8.8.4.4 index=4 no
route print 0.*.0
route delete 0.0.0.0
set INTERFACE=12
set ROUTER=192.168.1.1
route add 0.0.0.0 MASK 0.0.0.0 %ROUTER% IF %INTERFACE%
route add 192.168.100.0 MASK 255.255.255.0 %ROUTER% IF %INTERFACE%
netsh interface ip set dns %INTERFACE% static %ROUTER% validate=no
netsh interface ip add dns %INTERFACE% 87.237.112.10 index=2 no
netsh interface ip add dns %INTERFACE% 8.8.8.8 index=3 no
netsh interface ip add dns %INTERFACE% 8.8.4.4 index=4 no
route print 0.*.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment