JSI Tip 8923. When you use Windows Server 2003 to establish a VPN connection, you receive 'Error 633 - the modem (or other connecting device) is already in use or is not configured properly'?

When you attempt to use a VPN (Virtual Private Network) connection on a Windows Server 2003 computer, you receive a message similar to:

Error 633 - the modem (or other connecting device) is already in use or is not configured properly.

This behavior will occur if TCP port 1723, which VPN uses to establish a connection, is being used by another program.

To resolve this issue, you must:

  • Reserve TCP port 1723.
  • Identify and kill the program that is currently using TCP port 1723.
  • Restart your Windows Server 2003 computer. This may cause the program to use a different port.

I have scripted FixVPN.bat to assist you in this task. When you open a CMD.EXE window on your Windows Server 2003 and type FixVPN, the script will:

  • Add 1723-1723 to the ReservedPorts Value Name, a REG_MULTI_SZ data type, at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters.
  • Use netstat -aon to determine the process that is using TCP port 1723.
  • Prompt you to kill the offending process.

FixVPN.bat contains:

@echo off
set key=HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
call :getRP>nul 2>&1
@echo reg add %key% /V ReservedPorts /T REG_MULTI_SZ /D "%ReservedPorts%" /F
reg add %key% /V ReservedPorts /T REG_MULTI_SZ /D "%ReservedPorts%" /F
@echo Proto  Local Address          Foreign Address        State           PID
for /f "Tokens=*" %%a in ('netstat -aon^|FIND "TCP "^|FINDSTR /L /C:":1723 "') do (
 set line=%%a
 for /f "Tokens=4,5" %%b in ('@echo %%a') do (
  if "%%c" EQU "" call :TK %%b
  if "%%c" NEQ "" call :TK %%c
goto :EOF
set ReservedPorts=##
for /f "Tokens=3" %%a in ('reg query %key% /V ReservedPorts ^|FIND "\0\0"') do (
 set ReservedPorts=%%a##
if "%ReservedPorts%" EQU "##" set ReservedPorts=1723-1723&goto :EOF
set ReservedPorts=%ReservedPorts:\0\0=\01723-1723%
set ReservedPorts=%ReservedPorts:##=%
goto :EOF
@echo %line%
set /P ans=Do you want to kill PID %1^? Reply Y or N. 
if /i "%ans%" EQU "N" goto :EOF
if /i "%ans%" NEQ "Y" goto TK1
taskkill /PID %1 /F

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.