This project is aimed to update sources of the initial AmneziaWG and make them as close to three upstream projects (luci-proto-wireguard, amneziawg-tools, amneziawg-linux-kernel-module) as possible.
Why? Because it looks like the original repository is abandoned: more than half a year has passed since the last commit and no bugs were fixed while two upstream projects receive updates on a regular basis (at least from the community).
The main differences and objectives:
luci-proto-amneziawghas been aligned in accordance with luci-proto-wireguard:- AmneziaWG settings tab now have placeholders (default values, if chosen, will mimic classic Wireguard protocol).
- Fixed bug with QR code generation. Please note that the generated QR code will contain AmneziaWG specific information (remove it manually to make it compatible with classic Wireguard).
- Added checkboxes to enable/disable peers.
- Took
luci-proto-wireguardas the codebase.
amneziawg-toolshas been aligned in accordance with the upstream repo amneziawg-tools:- The package is now compiled based on the upstream repo. Master branch has been chosen as a reference.
- Fixed bug with non-existent
proto_amneziawg_check_installedmethod. - Changed temp folders and files to match the protocol name.
- Refactored scripts a bit to make them look more
amneziish.
kmod-amneziawgis now compiled totally based on the upstream amneziawg-linux-kernel-module repo. Master branch has been chosen as a reference.
Everything seems to work fine. No major problems have been detected or reported so far.
Kudos to another fork and its Author (@defanator) for the build pipelines: https://github.com/defanator/amneziawg-openwrt Please refer to the original manual as well.
Side note: the build process is not hard at all, but requires some attention and basic knowledge.
General steps:
- Get parameters for your router:
- OpenWRT version:
SNAPSHOTor release (e.x.23.05.5). Can be found on theStatus -> Overviewpage (Firmware Versionparameter value). - Package manager you are using:
apk(the newer one) oropkg(the legacy one). If you are running a stable version of OpenWRT then it's more likely you useopkg.apkis used only in themain/masterbranch so far. To make sure run the following commands:apk -handopkg -h. The one that's won't fail (command not foundmessage is shown) shows the package manager that you use. - CPU/package architecture: run
apk info kerneloropkg info kernel(depending on your package manager) in console and check theArchitecturevalue (e.x.aarch64_cortex-a53) or consult OpenWRT router database. - Target: can be found on the
Status -> Overviewpage. The first part (before the slash) of theTarget Platformvalue. - Subtarget: can be found on the
Status -> Overviewpage. You guessed it! The second part (after the slash) of theTarget Platformvalue. - Vermagic: run
apk info kerneloropkg info kernel(depending on your package manager) in console check hash after the kernel version of theVersionvalue. E.x. if the value equals to6.6.52~f58afd3748410d3b1baa06a466d6682-r1then vermagic equals tof58afd3748410d3b1baa06a466d6682. You can also choose:auto: the script will get vermagic value from the OpenWrt site.any: the script will not check the variable.
- OpenWRT version:
- Make a fork of this repo.
- Optional: update/change commit hashes (
PKG_SOURCE_VERSIONvariable) of the upstream repos inamneziawg-tools/Makefileandkmod-amneziawg/Makefilefile. Remember thatamneziawg-toolsfeatures should matchamneziawg-linux-kernel-modulefeatures, i.e. choose two corresponding commits in both repos. - Go to Actions (enable them is needed).
- Choose
Build OpenWrt toolchain cache, put your router parameters (from step 1) in theRun workflowmenu and run the job. - It will take ~2-2.5 hours to build the cache. So get some cookies, tea, your favorite book and wait.
- After the cache has been created, choose
Build AmneziaWG from cachejob, put the same parameters in theRun workflowmenu and run it. - It will take ~10-15 minutes to build the binaries. After the process is finished you can download them in the job's artifacts section (bottom of the page).
- Unpack the archive, and install:
- Via WebInterface (LuCi):
- Go to
System -> Softwaremenu. - Press
Upload Package... - Select kmod-amneziawg .ipk file.
- Confirm installation.
- Repeat those steps for amneziawg-tools .ipk file and then luci-proto-amneziawg .ipk file.
- Go to
- Via console:
- Transfer files into the router.
- Run
apk install {path to the kmod-amneziawg .ipk}oropkg install {path to the kmod-amneziawg .ipk}depending on your package manager. - Run
apk install {path to the amneziawg-tools .ipk}oropkg install {path to the amneziawg-tools .ipk}depending on your package manager. - Run
apk install {path to the luci-proto-amneziawg .ipk}oropkg install {path to the luci-proto-amneziawg .ipk}depending on your package manager.
- Reboot router or run
/etc/init.d/network restartcommand in the console. - Congratulations - you now have AmneziaWG installed on your router. Go to
Network -> Interfacespage, pressAdd new interface..and selectAmneziaWGas protocol.
*Sometimes is is required to clean the browser's cache to see the new protocol available in the OpenWRT.