├── ver ├── upg │ ├── ol │ │ ├── 7 │ │ │ └── swanver │ │ ├── 8 │ │ │ └── swanver │ │ ├── 9 │ │ │ └── swanver │ │ └── 10 │ │ │ └── swanver │ ├── alma │ │ ├── 8 │ │ │ └── swanver │ │ ├── 9 │ │ │ └── swanver │ │ └── 10 │ │ │ └── swanver │ ├── amzn │ │ └── 2 │ │ │ └── swanver │ ├── centos │ │ ├── 9s │ │ │ └── swanver │ │ └── 10s │ │ │ └── swanver │ ├── debian │ │ ├── 10 │ │ │ └── swanver │ │ ├── 11 │ │ │ └── swanver │ │ ├── 12 │ │ │ └── swanver │ │ ├── 13 │ │ │ └── swanver │ │ └── kalirolling │ │ │ └── swanver │ ├── rhel │ │ ├── 8 │ │ │ └── swanver │ │ ├── 9 │ │ │ └── swanver │ │ └── 10 │ │ │ └── swanver │ ├── rocky │ │ ├── 8 │ │ │ └── swanver │ │ ├── 9 │ │ │ └── swanver │ │ └── 10 │ │ │ └── swanver │ ├── v1 │ │ ├── alma │ │ │ ├── 8 │ │ │ │ └── swanver │ │ │ ├── 9 │ │ │ │ └── swanver │ │ │ └── 10 │ │ │ │ └── swanver │ │ ├── amzn │ │ │ └── 2 │ │ │ │ └── swanver │ │ ├── ol │ │ │ ├── 7 │ │ │ │ └── swanver │ │ │ ├── 8 │ │ │ │ └── swanver │ │ │ ├── 9 │ │ │ │ └── swanver │ │ │ └── 10 │ │ │ │ └── swanver │ │ ├── rhel │ │ │ ├── 8 │ │ │ │ └── swanver │ │ │ ├── 9 │ │ │ │ └── swanver │ │ │ └── 10 │ │ │ │ └── swanver │ │ ├── alpine │ │ │ ├── 3.21 │ │ │ │ └── swanver │ │ │ └── 3.22 │ │ │ │ └── swanver │ │ ├── centos │ │ │ ├── 10s │ │ │ │ └── swanver │ │ │ └── 9s │ │ │ │ └── swanver │ │ ├── debian │ │ │ ├── 10 │ │ │ │ └── swanver │ │ │ ├── 11 │ │ │ │ └── swanver │ │ │ ├── 12 │ │ │ │ └── swanver │ │ │ ├── 13 │ │ │ │ └── swanver │ │ │ └── kalirolling │ │ │ │ └── swanver │ │ ├── raspbian │ │ │ ├── 10 │ │ │ │ └── swanver │ │ │ ├── 11 │ │ │ │ └── swanver │ │ │ ├── 12 │ │ │ │ └── swanver │ │ │ └── 13 │ │ │ │ └── swanver │ │ ├── rocky │ │ │ ├── 8 │ │ │ │ └── swanver │ │ │ ├── 9 │ │ │ │ └── swanver │ │ │ └── 10 │ │ │ │ └── swanver │ │ └── ubuntu │ │ │ ├── trixiesid │ │ │ └── swanver │ │ │ ├── bookwormsid │ │ │ └── swanver │ │ │ └── bullseyesid │ │ │ └── swanver │ ├── alpine │ │ ├── 3.21 │ │ │ └── swanver │ │ └── 3.22 │ │ │ └── swanver │ ├── raspbian │ │ ├── 10 │ │ │ └── swanver │ │ ├── 11 │ │ │ └── swanver │ │ ├── 12 │ │ │ └── swanver │ │ └── 13 │ │ │ └── swanver │ ├── ubuntu │ │ ├── bookwormsid │ │ │ └── swanver │ │ ├── bullseyesid │ │ │ └── swanver │ │ └── trixiesid │ │ │ └── swanver │ └── docker │ │ ├── alpine │ │ ├── aarch64 │ │ │ └── swanver │ │ ├── armv7l │ │ │ └── swanver │ │ └── x86_64 │ │ │ └── swanver │ │ └── debian │ │ ├── aarch64 │ │ └── swanver │ │ ├── armv7l │ │ └── swanver │ │ └── x86_64 │ │ └── swanver └── v1 │ ├── ol │ ├── 7 │ │ └── swanver │ ├── 8 │ │ └── swanver │ ├── 9 │ │ └── swanver │ └── 10 │ │ └── swanver │ ├── alma │ ├── 8 │ │ └── swanver │ ├── 9 │ │ └── swanver │ └── 10 │ │ └── swanver │ ├── amzn │ └── 2 │ │ └── swanver │ ├── centos │ ├── 10s │ │ └── swanver │ └── 9s │ │ └── swanver │ ├── debian │ ├── 10 │ │ └── swanver │ ├── 11 │ │ └── swanver │ ├── 12 │ │ └── swanver │ ├── 13 │ │ └── swanver │ └── kalirolling │ │ └── swanver │ ├── rhel │ ├── 8 │ │ └── swanver │ ├── 9 │ │ └── swanver │ └── 10 │ │ └── swanver │ ├── rocky │ ├── 8 │ │ └── swanver │ ├── 9 │ │ └── swanver │ └── 10 │ │ └── swanver │ ├── alpine │ ├── 3.21 │ │ └── swanver │ └── 3.22 │ │ └── swanver │ ├── raspbian │ ├── 10 │ │ └── swanver │ ├── 11 │ │ └── swanver │ ├── 12 │ │ └── swanver │ └── 13 │ │ └── swanver │ └── ubuntu │ ├── bookwormsid │ └── swanver │ ├── bullseyesid │ └── swanver │ └── trixiesid │ └── swanver ├── .gitattributes ├── reg-files ├── Enable_Stronger_Ciphers_for_IKEv2_on_Windows.reg ├── Fix_VPN_Error_809_Allow_IPsec_Reboot_Required.reg ├── Fix_VPN_Error_809_Windows_XP_ONLY_Reboot_Required.reg └── Fix_VPN_Error_809_Windows_Vista_7_8_10_Reboot_Required.reg ├── scripts └── ikev2_config_import.cmd └── LICENSE.md /ver/upg/ol/7/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/ol/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/ol/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/ol/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/ol/7/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/ol/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/ol/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/alma/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/alma/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/alma/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/amzn/2/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/centos/9s/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/debian/10/swanver: -------------------------------------------------------------------------------- 1 | EOS -------------------------------------------------------------------------------- /ver/upg/debian/11/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/debian/12/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/debian/13/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/ol/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/rhel/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/rhel/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/rhel/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/rocky/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/rocky/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/rocky/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/alma/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/alma/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/amzn/2/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/ol/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/ol/7/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/ol/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/ol/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/rhel/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/rhel/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/alma/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/alma/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/alma/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/amzn/2/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/centos/10s/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/centos/9s/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/debian/10/swanver: -------------------------------------------------------------------------------- 1 | EOS -------------------------------------------------------------------------------- /ver/v1/debian/11/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/debian/12/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/debian/13/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/rhel/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/rhel/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/rhel/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/rocky/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/rocky/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/rocky/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/alpine/3.21/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/alpine/3.22/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/centos/10s/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/raspbian/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/raspbian/11/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/raspbian/12/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/raspbian/13/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/alma/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/alpine/3.21/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/alpine/3.22/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/centos/10s/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/centos/9s/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/debian/10/swanver: -------------------------------------------------------------------------------- 1 | EOS -------------------------------------------------------------------------------- /ver/upg/v1/debian/11/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/debian/12/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/debian/13/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/raspbian/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/raspbian/11/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/raspbian/12/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/raspbian/13/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/rhel/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/rocky/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/rocky/8/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/rocky/9/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/alpine/3.21/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/alpine/3.22/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/raspbian/10/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/raspbian/11/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/raspbian/12/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/raspbian/13/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/debian/kalirolling/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/ubuntu/bookwormsid/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/ubuntu/bullseyesid/swanver: -------------------------------------------------------------------------------- 1 | EOS -------------------------------------------------------------------------------- /ver/upg/ubuntu/trixiesid/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/ubuntu/trixiesid/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/debian/kalirolling/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/ubuntu/bookwormsid/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/v1/ubuntu/bullseyesid/swanver: -------------------------------------------------------------------------------- 1 | EOS -------------------------------------------------------------------------------- /ver/v1/ubuntu/trixiesid/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/docker/alpine/aarch64/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/docker/alpine/armv7l/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/docker/alpine/x86_64/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/docker/debian/aarch64/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/docker/debian/armv7l/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/docker/debian/x86_64/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/debian/kalirolling/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/ubuntu/bookwormsid/swanver: -------------------------------------------------------------------------------- 1 | 5.3 -------------------------------------------------------------------------------- /ver/upg/v1/ubuntu/bullseyesid/swanver: -------------------------------------------------------------------------------- 1 | EOS -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.cmd -text 3 | *.reg -text 4 | -------------------------------------------------------------------------------- /reg-files/Enable_Stronger_Ciphers_for_IKEv2_on_Windows.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdsl2/vpn-extras/HEAD/reg-files/Enable_Stronger_Ciphers_for_IKEv2_on_Windows.reg -------------------------------------------------------------------------------- /reg-files/Fix_VPN_Error_809_Allow_IPsec_Reboot_Required.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdsl2/vpn-extras/HEAD/reg-files/Fix_VPN_Error_809_Allow_IPsec_Reboot_Required.reg -------------------------------------------------------------------------------- /reg-files/Fix_VPN_Error_809_Windows_XP_ONLY_Reboot_Required.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdsl2/vpn-extras/HEAD/reg-files/Fix_VPN_Error_809_Windows_XP_ONLY_Reboot_Required.reg -------------------------------------------------------------------------------- /reg-files/Fix_VPN_Error_809_Windows_Vista_7_8_10_Reboot_Required.reg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hwdsl2/vpn-extras/HEAD/reg-files/Fix_VPN_Error_809_Windows_Vista_7_8_10_Reboot_Required.reg -------------------------------------------------------------------------------- /scripts/ikev2_config_import.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: IKEv2 Configuration Import Helper Script for Windows 8, 10 and 11 3 | :: Copyright (C) 2022 Lin Song 4 | :: This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 5 | :: Unported License: http://creativecommons.org/licenses/by-sa/3.0/ 6 | :: Attribution required: please include my name in any derivative and let me 7 | :: know how you have improved it! 8 | 9 | setlocal DisableDelayedExpansion 10 | set "SPath=%SystemRoot%\System32" 11 | if exist "%SystemRoot%\Sysnative\reg.exe" (set "SPath=%SystemRoot%\Sysnative") 12 | set "Path=%SPath%;%SystemRoot%;%SPath%\Wbem;%SPath%\WindowsPowerShell\v1.0\" 13 | set "_err====== ERROR =====" 14 | set "_work=%~dp0" 15 | if "%_work:~-1%"=="\" set "_work=%_work:~0,-1%" 16 | 17 | for /f "tokens=4-5 delims=. " %%i in ('ver') do set version=%%i.%%j 18 | if "%version%" == "10.0" goto :Check_Admin 19 | if "%version%" == "6.3" goto :Check_Admin 20 | if "%version%" == "6.2" goto :Check_Admin 21 | goto :E_Win 22 | 23 | :Check_Admin 24 | reg query HKU\S-1-5-19 >nul 2>&1 || goto :E_Admin 25 | 26 | where certutil >nul 2>&1 27 | if %errorlevel% neq 0 goto :E_Cu 28 | where powershell >nul 2>&1 29 | if %errorlevel% neq 0 goto :E_Ps 30 | 31 | title IKEv2 Configuration Import Helper Script 32 | setlocal EnableDelayedExpansion 33 | cd /d "!_work!" 34 | @cls 35 | echo =================================================================== 36 | echo Welcome^^! Use this helper script to import an IKEv2 configuration 37 | echo into a PC running Windows 8, 10 or 11. 38 | echo For more details, see https://vpnsetup.net/ikev2 39 | echo. 40 | echo Before continuing, you must put the .p12 file you transferred from 41 | echo the VPN server in the *same folder* as this script. 42 | echo =================================================================== 43 | 44 | set client_name_gen= 45 | for /F "eol=| delims=" %%f in ('dir "*.p12" /A-D /B /O-D /TW 2^>nul') do ( 46 | set "p12_latest=%%f" 47 | set "client_name_gen=!p12_latest:.p12=!" 48 | goto :Enter_Client_Name 49 | ) 50 | 51 | :Enter_Client_Name 52 | echo. 53 | echo Enter the name of the IKEv2 VPN client to import. 54 | echo Note: This is the same as the .p12 filename without extension. 55 | set client_name= 56 | set p12_file= 57 | if defined client_name_gen ( 58 | echo To accept the suggested client name, press Enter. 59 | set /p client_name="VPN client name: [%client_name_gen%] " 60 | if not defined client_name set "client_name=%client_name_gen%" 61 | ) else ( 62 | set /p client_name="VPN client name: " 63 | if not defined client_name goto :Abort 64 | ) 65 | set "client_name=%client_name:"=%" 66 | set "client_name=%client_name: =%" 67 | set "p12_file=%_work%\%client_name%.p12" 68 | if not exist "!p12_file!" ( 69 | echo. 70 | echo ERROR: File "!p12_file!" not found. 71 | echo You must put the .p12 file you transferred from the VPN server 72 | echo in the *same folder* as this script. 73 | goto :Enter_Client_Name 74 | ) 75 | 76 | echo. 77 | echo Enter the IP address (or DNS name) of the VPN server. 78 | echo Note: This must exactly match the VPN server address in the output 79 | echo of the IKEv2 helper script on your server. 80 | set server_addr= 81 | set /p server_addr="VPN server address: " 82 | if not defined server_addr goto :Abort 83 | set "server_addr=%server_addr:"=%" 84 | set "server_addr=%server_addr: =%" 85 | 86 | set "conn_name_gen=IKEv2 VPN %server_addr%" 87 | powershell -command "Get-VpnConnection -Name '%conn_name_gen%'" >nul 2>&1 88 | if !errorlevel! neq 0 ( 89 | goto :Enter_Conn_Name 90 | ) 91 | set "conn_name_gen=IKEv2 VPN 2 %server_addr%" 92 | powershell -command "Get-VpnConnection -Name '%conn_name_gen%'" >nul 2>&1 93 | if !errorlevel! neq 0 ( 94 | goto :Enter_Conn_Name 95 | ) 96 | set "conn_name_gen=IKEv2 VPN 3 %server_addr%" 97 | powershell -command "Get-VpnConnection -Name '%conn_name_gen%'" >nul 2>&1 98 | if !errorlevel! equ 0 ( 99 | set conn_name_gen= 100 | ) 101 | 102 | :Enter_Conn_Name 103 | echo. 104 | echo Provide a name for the new IKEv2 connection. 105 | set conn_name= 106 | if defined conn_name_gen ( 107 | echo To accept the suggested connection name, press Enter. 108 | set /p conn_name="IKEv2 connection name: [%conn_name_gen%] " 109 | if not defined conn_name set "conn_name=%conn_name_gen%" 110 | ) else ( 111 | set /p conn_name="IKEv2 connection name: " 112 | if not defined conn_name goto :Abort 113 | ) 114 | set "conn_name=%conn_name:"=%" 115 | powershell -command "Get-VpnConnection -Name '%conn_name%'" >nul 2>&1 116 | if !errorlevel! equ 0 ( 117 | echo. 118 | echo ERROR: A connection with this name already exists. 119 | goto :Enter_Conn_Name 120 | ) 121 | 122 | echo. 123 | echo Importing .p12 file... 124 | certutil -f -p "" -importpfx "%p12_file%" NoExport >nul 2>&1 125 | if !errorlevel! equ 0 goto :Create_Conn 126 | echo When prompted, enter the password for client config files, which can be found 127 | echo in the output of the IKEv2 helper script on your server. 128 | :Import_P12 129 | certutil -f -importpfx "%p12_file%" NoExport 130 | if !errorlevel! neq 0 goto :Import_P12 131 | 132 | :Create_Conn 133 | echo. 134 | echo Creating VPN connection... 135 | powershell -command "Add-VpnConnection -ServerAddress '%server_addr%' -Name '%conn_name%' -TunnelType IKEv2 -AuthenticationMethod MachineCertificate -EncryptionLevel Required -PassThru" 136 | if !errorlevel! neq 0 ( 137 | echo ERROR: Could not create the IKEv2 VPN connection. 138 | goto :Done 139 | ) 140 | 141 | echo Setting IPsec configuration... 142 | powershell -command "Set-VpnConnectionIPsecConfiguration -ConnectionName '%conn_name%' -AuthenticationTransformConstants GCMAES128 -CipherTransformConstants GCMAES128 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup Group14 -PassThru -Force" 143 | if !errorlevel! neq 0 ( 144 | echo ERROR: Could not set IPsec configuration for the IKEv2 VPN connection. 145 | goto :Done 146 | ) 147 | 148 | echo IKEv2 configuration successfully imported^^! 149 | echo To connect to the VPN, click on the wireless/network icon in your system tray, 150 | echo select the "%conn_name%" VPN entry, and click Connect. 151 | goto :Done 152 | 153 | :E_Admin 154 | echo %_err% 155 | echo This script requires administrator privileges. 156 | echo Right-click on the script and select 'Run as administrator'. 157 | goto :Done 158 | 159 | :E_Win 160 | echo %_err% 161 | echo This script requires Windows 8, 10 or 11. 162 | echo Windows 7 users can manually import IKEv2 configuration. See https://vpnsetup.net/ikev2 163 | goto :Done 164 | 165 | :E_Cu 166 | echo %_err% 167 | echo This script requires 'certutil', which is not detected. 168 | goto :Done 169 | 170 | :E_Ps 171 | echo %_err% 172 | echo This script requires 'powershell', which is not detected. 173 | goto :Done 174 | 175 | :Abort 176 | echo. 177 | echo Abort. No changes were made. 178 | 179 | :Done 180 | echo. 181 | echo Press any key to exit. 182 | pause >nul 183 | goto :eof 184 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | ### Creative Commons Attribution-ShareAlike 3.0 Unported License 2 | Link to license summary: https://creativecommons.org/licenses/by-sa/3.0/ 3 | 4 | Copyright (C) 2022-2025 [Lin Song](https://github.com/hwdsl2) 5 | 6 |

THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS 7 | OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR 8 | "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER 9 | APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS 10 | AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS 11 | PROHIBITED.

12 |

BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU 13 | ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. 14 | TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A 15 | CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE 16 | IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND 17 | CONDITIONS.

18 |

1. Definitions

19 |
    20 |
  1. "Adaptation" means a work based upon 21 | the Work, or upon the Work and other pre-existing works, 22 | such as a translation, adaptation, derivative work, 23 | arrangement of music or other alterations of a literary 24 | or artistic work, or phonogram or performance and 25 | includes cinematographic adaptations or any other form in 26 | which the Work may be recast, transformed, or adapted 27 | including in any form recognizably derived from the 28 | original, except that a work that constitutes a 29 | Collection will not be considered an Adaptation for the 30 | purpose of this License. For the avoidance of doubt, 31 | where the Work is a musical work, performance or 32 | phonogram, the synchronization of the Work in 33 | timed-relation with a moving image ("synching") will be 34 | considered an Adaptation for the purpose of this 35 | License.
  2. 36 |
  3. "Collection" means a collection of 37 | literary or artistic works, such as encyclopedias and 38 | anthologies, or performances, phonograms or broadcasts, 39 | or other works or subject matter other than works listed 40 | in Section 1(f) below, which, by reason of the selection 41 | and arrangement of their contents, constitute 42 | intellectual creations, in which the Work is included in 43 | its entirety in unmodified form along with one or more 44 | other contributions, each constituting separate and 45 | independent works in themselves, which together are 46 | assembled into a collective whole. A work that 47 | constitutes a Collection will not be considered an 48 | Adaptation (as defined below) for the purposes of this 49 | License.
  4. 50 |
  5. "Creative Commons Compatible 51 | License" means a license that is listed at 52 | https://creativecommons.org/compatiblelicenses that has 53 | been approved by Creative Commons as being essentially 54 | equivalent to this License, including, at a minimum, 55 | because that license: (i) contains terms that have the 56 | same purpose, meaning and effect as the License Elements 57 | of this License; and, (ii) explicitly permits the 58 | relicensing of adaptations of works made available under 59 | that license under this License or a Creative Commons 60 | jurisdiction license with the same License Elements as 61 | this License.
  6. 62 |
  7. "Distribute" means to make available 63 | to the public the original and copies of the Work or 64 | Adaptation, as appropriate, through sale or other 65 | transfer of ownership.
  8. 66 |
  9. "License Elements" means the 67 | following high-level license attributes as selected by 68 | Licensor and indicated in the title of this License: 69 | Attribution, ShareAlike.
  10. 70 |
  11. "Licensor" means the individual, 71 | individuals, entity or entities that offer(s) the Work 72 | under the terms of this License.
  12. 73 |
  13. "Original Author" means, in the case 74 | of a literary or artistic work, the individual, 75 | individuals, entity or entities who created the Work or 76 | if no individual or entity can be identified, the 77 | publisher; and in addition (i) in the case of a 78 | performance the actors, singers, musicians, dancers, and 79 | other persons who act, sing, deliver, declaim, play in, 80 | interpret or otherwise perform literary or artistic works 81 | or expressions of folklore; (ii) in the case of a 82 | phonogram the producer being the person or legal entity 83 | who first fixes the sounds of a performance or other 84 | sounds; and, (iii) in the case of broadcasts, the 85 | organization that transmits the broadcast.
  14. 86 |
  15. "Work" means the literary and/or 87 | artistic work offered under the terms of this License 88 | including without limitation any production in the 89 | literary, scientific and artistic domain, whatever may be 90 | the mode or form of its expression including digital 91 | form, such as a book, pamphlet and other writing; a 92 | lecture, address, sermon or other work of the same 93 | nature; a dramatic or dramatico-musical work; a 94 | choreographic work or entertainment in dumb show; a 95 | musical composition with or without words; a 96 | cinematographic work to which are assimilated works 97 | expressed by a process analogous to cinematography; a 98 | work of drawing, painting, architecture, sculpture, 99 | engraving or lithography; a photographic work to which 100 | are assimilated works expressed by a process analogous to 101 | photography; a work of applied art; an illustration, map, 102 | plan, sketch or three-dimensional work relative to 103 | geography, topography, architecture or science; a 104 | performance; a broadcast; a phonogram; a compilation of 105 | data to the extent it is protected as a copyrightable 106 | work; or a work performed by a variety or circus 107 | performer to the extent it is not otherwise considered a 108 | literary or artistic work.
  16. 109 |
  17. "You" means an individual or entity 110 | exercising rights under this License who has not 111 | previously violated the terms of this License with 112 | respect to the Work, or who has received express 113 | permission from the Licensor to exercise rights under 114 | this License despite a previous violation.
  18. 115 |
  19. "Publicly Perform" means to perform 116 | public recitations of the Work and to communicate to the 117 | public those public recitations, by any means or process, 118 | including by wire or wireless means or public digital 119 | performances; to make available to the public Works in 120 | such a way that members of the public may access these 121 | Works from a place and at a place individually chosen by 122 | them; to perform the Work to the public by any means or 123 | process and the communication to the public of the 124 | performances of the Work, including by public digital 125 | performance; to broadcast and rebroadcast the Work by any 126 | means including signs, sounds or images.
  20. 127 |
  21. "Reproduce" means to make copies of 128 | the Work by any means including without limitation by 129 | sound or visual recordings and the right of fixation and 130 | reproducing fixations of the Work, including storage of a 131 | protected performance or phonogram in digital form or 132 | other electronic medium.
  22. 133 |
134 |

2. Fair Dealing Rights. Nothing in this 135 | License is intended to reduce, limit, or restrict any uses 136 | free from copyright or rights arising from limitations or 137 | exceptions that are provided for in connection with the 138 | copyright protection under copyright law or other 139 | applicable laws.

140 |

3. License Grant. Subject to the terms 141 | and conditions of this License, Licensor hereby grants You 142 | a worldwide, royalty-free, non-exclusive, perpetual (for 143 | the duration of the applicable copyright) license to 144 | exercise the rights in the Work as stated below:

145 |
    146 |
  1. to Reproduce the Work, to incorporate the Work into 147 | one or more Collections, and to Reproduce the Work as 148 | incorporated in the Collections;
  2. 149 |
  3. to create and Reproduce Adaptations provided that any 150 | such Adaptation, including any translation in any medium, 151 | takes reasonable steps to clearly label, demarcate or 152 | otherwise identify that changes were made to the original 153 | Work. For example, a translation could be marked "The 154 | original work was translated from English to Spanish," or 155 | a modification could indicate "The original work has been 156 | modified.";
  4. 157 |
  5. to Distribute and Publicly Perform the Work including 158 | as incorporated in Collections; and,
  6. 159 |
  7. to Distribute and Publicly Perform Adaptations.
  8. 160 |
  9. 161 |

    For the avoidance of doubt:

    162 |
      163 |
    1. Non-waivable Compulsory License 164 | Schemes. In those jurisdictions in which the 165 | right to collect royalties through any statutory or 166 | compulsory licensing scheme cannot be waived, the 167 | Licensor reserves the exclusive right to collect such 168 | royalties for any exercise by You of the rights 169 | granted under this License;
    2. 170 |
    3. Waivable Compulsory License 171 | Schemes. In those jurisdictions in which the 172 | right to collect royalties through any statutory or 173 | compulsory licensing scheme can be waived, the 174 | Licensor waives the exclusive right to collect such 175 | royalties for any exercise by You of the rights 176 | granted under this License; and,
    4. 177 |
    5. Voluntary License Schemes. The 178 | Licensor waives the right to collect royalties, 179 | whether individually or, in the event that the 180 | Licensor is a member of a collecting society that 181 | administers voluntary licensing schemes, via that 182 | society, from any exercise by You of the rights 183 | granted under this License.
    6. 184 |
    185 |
  10. 186 |
187 |

The above rights may be exercised in all media and 188 | formats whether now known or hereafter devised. The above 189 | rights include the right to make such modifications as are 190 | technically necessary to exercise the rights in other media 191 | and formats. Subject to Section 8(f), all rights not 192 | expressly granted by Licensor are hereby reserved.

193 |

4. Restrictions. The license granted in 194 | Section 3 above is expressly made subject to and limited by 195 | the following restrictions:

196 |
    197 |
  1. You may Distribute or Publicly Perform the Work only 198 | under the terms of this License. You must include a copy 199 | of, or the Uniform Resource Identifier (URI) for, this 200 | License with every copy of the Work You Distribute or 201 | Publicly Perform. You may not offer or impose any terms 202 | on the Work that restrict the terms of this License or 203 | the ability of the recipient of the Work to exercise the 204 | rights granted to that recipient under the terms of the 205 | License. You may not sublicense the Work. You must keep 206 | intact all notices that refer to this License and to the 207 | disclaimer of warranties with every copy of the Work You 208 | Distribute or Publicly Perform. When You Distribute or 209 | Publicly Perform the Work, You may not impose any 210 | effective technological measures on the Work that 211 | restrict the ability of a recipient of the Work from You 212 | to exercise the rights granted to that recipient under 213 | the terms of the License. This Section 4(a) applies to 214 | the Work as incorporated in a Collection, but this does 215 | not require the Collection apart from the Work itself to 216 | be made subject to the terms of this License. If You 217 | create a Collection, upon notice from any Licensor You 218 | must, to the extent practicable, remove from the 219 | Collection any credit as required by Section 4(c), as 220 | requested. If You create an Adaptation, upon notice from 221 | any Licensor You must, to the extent practicable, remove 222 | from the Adaptation any credit as required by Section 223 | 4(c), as requested.
  2. 224 |
  3. You may Distribute or Publicly Perform an Adaptation 225 | only under the terms of: (i) this License; (ii) a later 226 | version of this License with the same License Elements as 227 | this License; (iii) a Creative Commons jurisdiction 228 | license (either this or a later license version) that 229 | contains the same License Elements as this License (e.g., 230 | Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons 231 | Compatible License. If you license the Adaptation under 232 | one of the licenses mentioned in (iv), you must comply 233 | with the terms of that license. If you license the 234 | Adaptation under the terms of any of the licenses 235 | mentioned in (i), (ii) or (iii) (the "Applicable 236 | License"), you must comply with the terms of the 237 | Applicable License generally and the following 238 | provisions: (I) You must include a copy of, or the URI 239 | for, the Applicable License with every copy of each 240 | Adaptation You Distribute or Publicly Perform; (II) You 241 | may not offer or impose any terms on the Adaptation that 242 | restrict the terms of the Applicable License or the 243 | ability of the recipient of the Adaptation to exercise 244 | the rights granted to that recipient under the terms of 245 | the Applicable License; (III) You must keep intact all 246 | notices that refer to the Applicable License and to the 247 | disclaimer of warranties with every copy of the Work as 248 | included in the Adaptation You Distribute or Publicly 249 | Perform; (IV) when You Distribute or Publicly Perform the 250 | Adaptation, You may not impose any effective 251 | technological measures on the Adaptation that restrict 252 | the ability of a recipient of the Adaptation from You to 253 | exercise the rights granted to that recipient under the 254 | terms of the Applicable License. This Section 4(b) 255 | applies to the Adaptation as incorporated in a 256 | Collection, but this does not require the Collection 257 | apart from the Adaptation itself to be made subject to 258 | the terms of the Applicable License.
  4. 259 |
  5. If You Distribute, or Publicly Perform the Work or 260 | any Adaptations or Collections, You must, unless a 261 | request has been made pursuant to Section 4(a), keep 262 | intact all copyright notices for the Work and provide, 263 | reasonable to the medium or means You are utilizing: (i) 264 | the name of the Original Author (or pseudonym, if 265 | applicable) if supplied, and/or if the Original Author 266 | and/or Licensor designate another party or parties (e.g., 267 | a sponsor institute, publishing entity, journal) for 268 | attribution ("Attribution Parties") in Licensor's 269 | copyright notice, terms of service or by other reasonable 270 | means, the name of such party or parties; (ii) the title 271 | of the Work if supplied; (iii) to the extent reasonably 272 | practicable, the URI, if any, that Licensor specifies to 273 | be associated with the Work, unless such URI does not 274 | refer to the copyright notice or licensing information 275 | for the Work; and (iv) , consistent with Ssection 3(b), 276 | in the case of an Adaptation, a credit identifying the 277 | use of the Work in the Adaptation (e.g., "French 278 | translation of the Work by Original Author," or 279 | "Screenplay based on original Work by Original Author"). 280 | The credit required by this Section 4(c) may be 281 | implemented in any reasonable manner; provided, however, 282 | that in the case of a Adaptation or Collection, at a 283 | minimum such credit will appear, if a credit for all 284 | contributing authors of the Adaptation or Collection 285 | appears, then as part of these credits and in a manner at 286 | least as prominent as the credits for the other 287 | contributing authors. For the avoidance of doubt, You may 288 | only use the credit required by this Section for the 289 | purpose of attribution in the manner set out above and, 290 | by exercising Your rights under this License, You may not 291 | implicitly or explicitly assert or imply any connection 292 | with, sponsorship or endorsement by the Original Author, 293 | Licensor and/or Attribution Parties, as appropriate, of 294 | You or Your use of the Work, without the separate, 295 | express prior written permission of the Original Author, 296 | Licensor and/or Attribution Parties.
  6. 297 |
  7. Except as otherwise agreed in writing by the Licensor 298 | or as may be otherwise permitted by applicable law, if 299 | You Reproduce, Distribute or Publicly Perform the Work 300 | either by itself or as part of any Adaptations or 301 | Collections, You must not distort, mutilate, modify or 302 | take other derogatory action in relation to the Work 303 | which would be prejudicial to the Original Author's honor 304 | or reputation. Licensor agrees that in those 305 | jurisdictions (e.g. Japan), in which any exercise of the 306 | right granted in Section 3(b) of this License (the right 307 | to make Adaptations) would be deemed to be a distortion, 308 | mutilation, modification or other derogatory action 309 | prejudicial to the Original Author's honor and 310 | reputation, the Licensor will waive or not assert, as 311 | appropriate, this Section, to the fullest extent 312 | permitted by the applicable national law, to enable You 313 | to reasonably exercise Your right under Section 3(b) of 314 | this License (right to make Adaptations) but not 315 | otherwise.
  8. 316 |
317 |

5. Representations, Warranties and 318 | Disclaimer

319 |

UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN 320 | WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO 321 | REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE 322 | WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, 323 | WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, 324 | FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE 325 | ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE 326 | PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. 327 | SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED 328 | WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.

329 |

6. Limitation on Liability. EXCEPT TO 330 | THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL 331 | LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY 332 | SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY 333 | DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, 334 | EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF 335 | SUCH DAMAGES.

336 |

7. Termination

337 |
    338 |
  1. This License and the rights granted hereunder will 339 | terminate automatically upon any breach by You of the 340 | terms of this License. Individuals or entities who have 341 | received Adaptations or Collections from You under this 342 | License, however, will not have their licenses terminated 343 | provided such individuals or entities remain in full 344 | compliance with those licenses. Sections 1, 2, 5, 6, 7, 345 | and 8 will survive any termination of this License.
  2. 346 |
  3. Subject to the above terms and conditions, the 347 | license granted here is perpetual (for the duration of 348 | the applicable copyright in the Work). Notwithstanding 349 | the above, Licensor reserves the right to release the 350 | Work under different license terms or to stop 351 | distributing the Work at any time; provided, however that 352 | any such election will not serve to withdraw this License 353 | (or any other license that has been, or is required to 354 | be, granted under the terms of this License), and this 355 | License will continue in full force and effect unless 356 | terminated as stated above.
  4. 357 |
358 |

8. Miscellaneous

359 |
    360 |
  1. Each time You Distribute or Publicly Perform the Work 361 | or a Collection, the Licensor offers to the recipient a 362 | license to the Work on the same terms and conditions as 363 | the license granted to You under this License.
  2. 364 |
  3. Each time You Distribute or Publicly Perform an 365 | Adaptation, Licensor offers to the recipient a license to 366 | the original Work on the same terms and conditions as the 367 | license granted to You under this License.
  4. 368 |
  5. If any provision of this License is invalid or 369 | unenforceable under applicable law, it shall not affect 370 | the validity or enforceability of the remainder of the 371 | terms of this License, and without further action by the 372 | parties to this agreement, such provision shall be 373 | reformed to the minimum extent necessary to make such 374 | provision valid and enforceable.
  6. 375 |
  7. No term or provision of this License shall be deemed 376 | waived and no breach consented to unless such waiver or 377 | consent shall be in writing and signed by the party to be 378 | charged with such waiver or consent.
  8. 379 |
  9. This License constitutes the entire agreement between 380 | the parties with respect to the Work licensed here. There 381 | are no understandings, agreements or representations with 382 | respect to the Work not specified here. Licensor shall 383 | not be bound by any additional provisions that may appear 384 | in any communication from You. This License may not be 385 | modified without the mutual written agreement of the 386 | Licensor and You.
  10. 387 |
  11. The rights granted under, and the subject matter 388 | referenced, in this License were drafted utilizing the 389 | terminology of the Berne Convention for the Protection of 390 | Literary and Artistic Works (as amended on September 28, 391 | 1979), the Rome Convention of 1961, the WIPO Copyright 392 | Treaty of 1996, the WIPO Performances and Phonograms 393 | Treaty of 1996 and the Universal Copyright Convention (as 394 | revised on July 24, 1971). These rights and subject 395 | matter take effect in the relevant jurisdiction in which 396 | the License terms are sought to be enforced according to 397 | the corresponding provisions of the implementation of 398 | those treaty provisions in the applicable national law. 399 | If the standard suite of rights granted under applicable 400 | copyright law includes additional rights not granted 401 | under this License, such additional rights are deemed to 402 | be included in the License; this License is not intended 403 | to restrict the license of any rights under applicable 404 | law.
  12. 405 |
406 | --------------------------------------------------------------------------------