Wiki Home Troubleshoots Change gateway for clients for different interent

Change gateway for clients for different interent

2017/04/25 00:23

We all have used one or two internet connection in our cafe and have faced the issue of changing the gateway for client so they can access faster internet for smoother game play for online games. So, let's learn how to do it automatically.

1. Create a batch file using the following commands

@echo off
:start
ECHO.
ECHO 1. Internet
ECHO 2. Game
ECHO 3. Exit
set choice=
set /p choice=Type the number of the menu you want to keep.
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto con1
if '%choice%'=='2' goto con2
if '%choice%'=='3' goto end
ECHO "%choice%" Is conflicting with an error, try again.
ECHO.
goto start
:con1
ECHO internet connection
route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 192.168.1.1 metric 1
goto end
:con2
ECHO game connection
route delete 0.0.0.0
route add 0.0.0.0 mask 0.0.0.0 192.168.1.2 metric 1
goto end
:bye
ECHO BYE
goto end
:end


The batch file (Figure 1)


Figure 1

2. Make sure you run the batch file in "Administrator" mode or the batch file will not execute the gateway change command.

3. You can add as many gateway as you want, just add choice for it and the IP according the above batch commands.

4. You can change the above gateway to your desired gateway just change "192.168.1.1" and "192.168.1.2" before "metric 1".

Related:

Use multiple internet connection in clients