[GH-ISSUE #7] feature request: multiple simultaneous tunnels #1

Open
opened 2026-10-13 21:10:45 +00:00 by bsakaguchi · 7 comments
Owner

Originally created by @timurlatipov on GitHub (Aug 22, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-windows-client/issues/7

Original Windows WireGuard application allows running several tunnels simultaneously as long as the AllowedIPs of those tunnels do not overlap. AmneziaWG doesn't seem to be able to do so. Are there any plans to re-introduce this feature?

It is one of the features we love Wireguard for. Say I have to configs, one for work vpn, the other is personal

  1. Work config tunnels a single /8 subnet via its own server:
    AllowedIPs = 10.0.0.0/8

  2. And personal config would tunnel all of the rest through another vpn server:
    AllowedIPs = 0.0.0.0/5, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/2, 128.0.0.0/1

Such two tunnels will work simultaneously in original client, but AnmeziaWG cannot do this
If it is possible. please add this functionality to AnmeziaWG

Originally created by @timurlatipov on GitHub (Aug 22, 2024). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-windows-client/issues/7 Original Windows WireGuard application allows running several tunnels simultaneously as long as the AllowedIPs of those tunnels do not overlap. AmneziaWG doesn't seem to be able to do so. Are there any plans to re-introduce this feature? It is one of the features we love Wireguard for. Say I have to configs, one for work vpn, the other is personal 1) Work config tunnels a single /8 subnet via its own server: `AllowedIPs = 10.0.0.0/8` 2) And personal config would tunnel all of the rest through another vpn server: `AllowedIPs = 0.0.0.0/5, 8.0.0.0/7, 11.0.0.0/8, 12.0.0.0/6, 16.0.0.0/4, 32.0.0.0/3, 64.0.0.0/2, 128.0.0.0/1` Such two tunnels will work simultaneously in original client, but AnmeziaWG cannot do this If it is possible. please add this functionality to AnmeziaWG
Author
Owner

@grandsilence commented on GitHub (Aug 26, 2024):

I tried both options for the MultipleSimultaneousTunnels key and had no positive effect:

reg add HKLM\Software\AmneziaWG /v MultipleSimultaneousTunnels /t REG_DWORD /d 1 /f
reg add HKLM\Software\Wireguard /v MultipleSimultaneousTunnels /t REG_DWORD /d 1 /f
<!-- gh-comment-id:2309832444 --> @grandsilence commented on GitHub (Aug 26, 2024): I tried both options for the `MultipleSimultaneousTunnels` key and had no positive effect: ```cmd reg add HKLM\Software\AmneziaWG /v MultipleSimultaneousTunnels /t REG_DWORD /d 1 /f reg add HKLM\Software\Wireguard /v MultipleSimultaneousTunnels /t REG_DWORD /d 1 /f ```
Author
Owner

@Verity-Freedom commented on GitHub (Oct 8, 2024):

Amnezia VPN already has split tunnels for AmneziaWG so it makes the AmneziaWG outdated, please update the application.

<!-- gh-comment-id:2400322564 --> @Verity-Freedom commented on GitHub (Oct 8, 2024): Amnezia VPN already has split tunnels for AmneziaWG so it makes the AmneziaWG outdated, please update the application.
Author
Owner

@timurlatipov commented on GitHub (Oct 8, 2024):

Amnezia VPN already has split tunnels for AmneziaWG so it makes the AmneziaWG outdated, please update the application

Amnezia VPN doesn't allow running two tunnels simultaneously, does it?

<!-- gh-comment-id:2400404176 --> @timurlatipov commented on GitHub (Oct 8, 2024): > Amnezia VPN already has split tunnels for AmneziaWG so it makes the AmneziaWG outdated, please update the application Amnezia VPN doesn't allow running two tunnels simultaneously, does it?
Author
Owner

@Verity-Freedom commented on GitHub (Oct 8, 2024):

Amnezia VPN already has split tunnels for AmneziaWG so it makes the AmneziaWG outdated, please update the application

Amnezia VPN doesn't allow running two tunnels simultaneously, does it?

Idk I need splitting tunnels.

<!-- gh-comment-id:2400560595 --> @Verity-Freedom commented on GitHub (Oct 8, 2024): > > Amnezia VPN already has split tunnels for AmneziaWG so it makes the AmneziaWG outdated, please update the application > > Amnezia VPN doesn't allow running two tunnels simultaneously, does it? Idk I need splitting tunnels.
Author
Owner

@Trogvars commented on GitHub (Nov 22, 2024):

Need this feature too! Please add.

<!-- gh-comment-id:2493891948 --> @Trogvars commented on GitHub (Nov 22, 2024): Need this feature too! Please add.
Author
Owner

@Trogvars commented on GitHub (Nov 29, 2024):

Check commit on issue.
Just uncomment tunnel intersection check in ipc_server.go and everything start to work as expected!

<!-- gh-comment-id:2507819207 --> @Trogvars commented on GitHub (Nov 29, 2024): Check commit on issue. Just uncomment tunnel intersection check in ipc_server.go and everything start to work as expected!
Author
Owner

@breBHo commented on GitHub (Dec 13, 2024):

Check commit on issue. Just uncomment tunnel intersection check in ipc_server.go and everything start to work as expected!

Thank you very much for your help. I had been searching for a way to connect to multiple Amnezia VPNs or other unblockable protocols simultaneously for quite some time, but everywhere I tried, I encountered failure.

And then your advice to uncomment the tunnel intersection check in ipc_server.go helped me, though I ran into issues during the build process, which I managed to resolve.

Please don't be too critical of my guide; I haven't written many of them and it's been a long time since I last did.

So, for those who might also need to use multiple Amnezia VPN tunnels, here's what to do:

  1. Download the archive with the AmneziaWG source files and extract it somewhere.
  2. Navigate to: "amneziawg-windows-client-1.0.0" – manager – ipc_server.go.
  3. Find this section of the code and uncomment it:
c2, err := conf.LoadFromName(t)
       if err != nil || !c.IntersectsWith(c2) {
           // If we can't get the config, assume it doesn't intersect.
           continue
       }
       tt = append(tt, t)
       if len(t) > 0 && (state == TunnelStarting || state == TunnelUnknown) {
           inTransition = t
           break
       }
  1. After that, run the build.bat file as an administrator.
  2. Then run the quickinstall.bat file as an administrator and wait.
  3. In the end, you’ll find a folder (amd64/x86/arm64) in the root directory, containing the resulting .exe file.
  4. For a simpler installation, you can just download version 1.0.0 (already compiled) and replace the .exe file with the new one.

However, I encountered an issue where only the x86 version was being created. I had to tinker with the MakeFile to remove x86 support. Here's what I did:

  • Delete and modify these sections in the MakeFile:

    x86/amneziawg.exe: export GOARCH := 386
    x86/amneziawg.exe: x86/wintun.dll resources_386.syso $(SOURCE_FILES)
        go build $(GOFLAGS) -o $@
    
    x86/wintun.dll:
        cp .deps/wintun/bin/x86/wintun.dll $@
    
    1. Change:
    all: amd64/amneziawg.exe x86/amneziawg.exe
    

    To:

    all: amd64/amneziawg.exe
    
    1. In the clean section, remove references to x86 to make it look like this:
    clean:
        rm -rf *.syso ui/icon/*.ico amd64/ arm64/ .deps
    
  • After that, I needed to edit build.bat:

    • Steps to edit build.bat:

      1. Remove the x86 build call:
        In the :build section, find this line:

        call :build_plat x86 i686 386 || goto :error
        

        And delete it completely, leaving only:

        call :build_plat amd64 x86_64 amd64 || goto :error
        call :build_plat arm64 aarch64 arm64 || goto :error
        
      2. Remove x86 signature builds:
        In the :sign section, find the line referencing x86\amneziawg.exe and delete it:

        signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d WireGuard x86\amneziawg.exe x86\awg.exe amd64\amneziawg.exe amd64\awg.exe arm64\amneziawg.exe arm64\awg.exe || goto :error
        

        Replace it with:

        signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d WireGuard amd64\amneziawg.exe amd64\awg.exe arm64\amneziawg.exe arm64\awg.exe || goto :error
        
      3. Remove x86 dependencies and resources:
        In the :build_plat section, replace:

        copy /Y ".deps\wintun\bin\%~1\wintun.dll" "%~1\wintun.dll" > NUL || exit /b 1
        

        With:

        if not "%~3"=="386" (
            copy /Y ".deps\wintun\bin\%~1\wintun.dll" "%~1\wintun.dll" > NUL || exit /b 1
        )
        
<!-- gh-comment-id:2540517956 --> @breBHo commented on GitHub (Dec 13, 2024): > Check commit on issue. Just uncomment tunnel intersection check in ipc_server.go and everything start to work as expected! Thank you very much for your help. I had been searching for a way to connect to multiple Amnezia VPNs or other unblockable protocols simultaneously for quite some time, but everywhere I tried, I encountered failure. And then your advice to uncomment the tunnel intersection check in `ipc_server.go` helped me, though I ran into issues during the build process, which I managed to resolve. Please don't be too critical of my guide; I haven't written many of them and it's been a long time since I last did. So, for those who might also need to use multiple Amnezia VPN tunnels, here's what to do: 1. Download the archive with the AmneziaWG source files and extract it somewhere. 2. Navigate to: `"amneziawg-windows-client-1.0.0" – manager – ipc_server.go`. 3. Find this section of the code and uncomment it: ``` c2, err := conf.LoadFromName(t) if err != nil || !c.IntersectsWith(c2) { // If we can't get the config, assume it doesn't intersect. continue } tt = append(tt, t) if len(t) > 0 && (state == TunnelStarting || state == TunnelUnknown) { inTransition = t break } ``` 4. After that, run the `build.bat` file as an administrator. 5. Then run the `quickinstall.bat` file as an administrator and wait. 6. In the end, you’ll find a folder (`amd64/x86/arm64`) in the root directory, containing the resulting `.exe` file. 7. For a simpler installation, you can just download version 1.0.0 (already compiled) and replace the `.exe` file with the new one. However, I encountered an issue where only the x86 version was being created. I had to tinker with the `MakeFile` to remove x86 support. Here's what I did: - **Delete and modify these sections in the MakeFile:** 1. ```makefile x86/amneziawg.exe: export GOARCH := 386 x86/amneziawg.exe: x86/wintun.dll resources_386.syso $(SOURCE_FILES) go build $(GOFLAGS) -o $@ ``` 2. ```makefile x86/wintun.dll: cp .deps/wintun/bin/x86/wintun.dll $@ ``` 3. Change: ```makefile all: amd64/amneziawg.exe x86/amneziawg.exe ``` To: ```makefile all: amd64/amneziawg.exe ``` 4. In the `clean` section, remove references to x86 to make it look like this: ```makefile clean: rm -rf *.syso ui/icon/*.ico amd64/ arm64/ .deps ``` - **After that, I needed to edit `build.bat`:** - **Steps to edit `build.bat`:** 1. **Remove the x86 build call:** In the `:build` section, find this line: ```batch call :build_plat x86 i686 386 || goto :error ``` And delete it completely, leaving only: ```batch call :build_plat amd64 x86_64 amd64 || goto :error call :build_plat arm64 aarch64 arm64 || goto :error ``` 2. **Remove x86 signature builds:** In the `:sign` section, find the line referencing `x86\amneziawg.exe` and delete it: ```batch signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d WireGuard x86\amneziawg.exe x86\awg.exe amd64\amneziawg.exe amd64\awg.exe arm64\amneziawg.exe arm64\awg.exe || goto :error ``` Replace it with: ```batch signtool sign /sha1 "%SigningCertificate%" /fd sha256 /tr "%TimestampServer%" /td sha256 /d WireGuard amd64\amneziawg.exe amd64\awg.exe arm64\amneziawg.exe arm64\awg.exe || goto :error ``` 3. **Remove x86 dependencies and resources:** In the `:build_plat` section, replace: ```batch copy /Y ".deps\wintun\bin\%~1\wintun.dll" "%~1\wintun.dll" > NUL || exit /b 1 ``` With: ```batch if not "%~3"=="386" ( copy /Y ".deps\wintun\bin\%~1\wintun.dll" "%~1\wintun.dll" > NUL || exit /b 1 ) ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-windows-client#1
No description provided.