Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #194529

Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files

From Maria Sophia <mariasophia@comprehension.com>
Newsgroups alt.comp.os.windows-10, alt.comp.os.windows-11, alt.comp.microsoft.windows
Subject Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files
Date 2026-07-17 14:17 -0400
Organization BWH Usenet Archive (https://usenet.blueworldhosting.com)
Message-ID <113drkd$1cer$1@nnrp.usenet.blueworldhosting.com> (permalink)
References <113bpm4$1s4r$1@nnrp.usenet.blueworldhosting.com>

Cross-posted to 3 groups.

Show all headers | View raw


Maria Sophia wrote:
> PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files

Drat. I ran a comprehensive set of tests with this nettest.bat script, and
it turned out that I needed to *remove* the openvpn directive I had added.

So that others can benefit, here's the script that added the directive to,
oh, maybe a few thousand free openvpn config files I've gathered over time.

  @echo off
  :: add_pull-filter-ignore.bat
  setlocal enabledelayedexpansion
  
  :: This will use current working directory where the script is run
  set "config_dir=%~dp0"
  :: This will use whatever directory you specify to run the script in
  REM set config_dir="C:\tmp\vpn\0\test"
  
  echo Updating .ovpn files in: %config_dir
  echo.
  
  for %%F in (%config_dir%\*.ovpn) do (
      echo Appending to: %%~nxF
      call :append_lines "%%F"
  )
  
  echo.
  echo Done. All .ovpn files updated.
  pause
  exit /b
  
  :: Subroutine for appending settings
  :append_lines
  >>%1 echo.
  >>%1 echo pull-filter ignore "redirect-gateway" ; Do not let server set gateway
  exit /b
  
  
And here's the script that removed that added directive, when I found out
not only was it not needed, but it was causing VPN to not correctly work.

  :: remove_pull-filter-ignore.bat
  :: Remove the pull-filter line so VPN can set redirect-gateway again.
  :: This fixes the problem where the killswitch accidentally blocked the VPN
  :: from becoming the default route. See notes below for future reference.
  @echo off
  setlocal
  
  
  set "dir=C:\tmp\vpn\0\config"
  
  echo Removing pull-filter ignore "redirect-gateway" from all .ovpn
files...
  echo.
  
  for %%f in ("%dir%\*.ovpn") do (
      powershell -Command ^
          "(Get-Content '%%f') | Where-Object { $_ -notmatch 'pull-filter
ignore \"redirect-gateway\"' } | Set-Content '%%f'"
      echo Cleaned: %%~nxf
  )
  
  echo.
  echo Done. All configs updated.
  pause
  endlocal
  
  
-- 
I avoid complex solutions when a leaner one already solves known issues.

Back to alt.comp.os.windows-10 | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-16 19:32 -0400
  Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2026-07-17 07:35 +0800
    Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-17 01:05 -0400
    Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files "Carlos E. R." <robin_listas@es.invalid> - 2026-07-17 14:43 +0200
      Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-17 10:35 -0400
  Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-16 19:47 -0400
    Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-16 19:53 -0400
      Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-16 19:57 -0400
        Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-16 20:01 -0400
        Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Andy Burns <usenet@andyburns.uk> - 2026-07-17 08:23 +0100
          Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-17 10:36 -0400
  Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Killer Punch <invalid@invalid.invalid> - 2026-07-17 01:16 +0100
    Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-17 01:34 -0400
  Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-17 14:17 -0400
    Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-17 14:23 -0400
  Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-18 13:08 -0400
    Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-18 17:10 -0400
      Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files croy <croy@spam.invalid.net> - 2026-07-19 06:39 -0700
        Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Paul <nospam@needed.invalid> - 2026-07-19 10:42 -0400
          Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-19 22:29 -0400
            Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Hank Rogers <Hank@nospam.invalid> - 2026-07-19 21:41 -0500
              Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-24 10:59 -0700
            Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Paul <nospam@needed.invalid> - 2026-07-19 22:49 -0400
              Re: PSA: Simple Wi-Fi gateway killswitch that works with OpenVPN config files Maria Sophia <mariasophia@comprehension.com> - 2026-07-20 00:28 -0400

csiph-web