@echo off
setlocal enabledelayedexpansion

set IP=%1
set MASK=%2
set GATEWAY=%3
set SERVERIP=%4
set DEFAULT_GATEWAY=%5

netsh interface ip set address name="FSTVPN" source=static addr=%IP% mask=%MASK% gateway=%GATEWAY%

route add %SERVERIP% %DEFAULT_GATEWAY% metric 5

netsh interface ipv4 set dnsservers name="FSTVPN" source=static address=127.0.0.1 validate=no

netsh advfirewall firewall delete rule name="Block DNS UDP 53 (All)" dir=out >nul
netsh advfirewall firewall delete rule name="Block DNS TCP 53 (All)" dir=out >nul

netsh advfirewall firewall add rule name="Block DNS UDP 53 (All)" dir=out action=block protocol=UDP remoteport=53 profile=any
netsh advfirewall firewall add rule name="Block DNS TCP 53 (All)" dir=out action=block protocol=TCP remoteport=53 profile=any

echo OK
exit /b 0