1
My pc has a network configuration IP- 192.168.0.99 192.168.4.20 Mask- 255.255.255.0 255.255.255.0 Gateway- 192.168.0.1 192.168.4.1
I am connecting to the internet through the gateway 192.168.4.1. I want to disable the internet sometimes, so i need to remove the gateway 192.168.4.1, How can I achieve this through a batch file... I have created a batch file to add ip address to the interface.
netsh int ip set address "LAN" static 192.168.0.99 255.255.255.0 192.168.0.1
netsh int ip add address "LAN" static 192.168.4.20 255.255.255.0 192.168.4.1
interface ip set dns "LAN" static 192.168.0.1
interface ip add dns "LAN" static 8.8.8.8
but this gives errors.If I use 'set' instead of ip 'add' in the second line, 192.168.0.99 is overwritten by 192.168.4.1.
possible duplicate of Windows command-line: Fastest way to disable internet (keeping LAN)?
– DavidPostill – 2014-10-17T07:05:34.507