Skip to content

this-username-has-been-taken/amneziawg-openwrt

 
 

Repository files navigation

YAAWG: Yet another AmneziaWG variation for OpenWrt

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:

  1. luci-proto-amneziawg has 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-wireguard as the codebase.
  2. amneziawg-tools has 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_installed method.
    • Changed temp folders and files to match the protocol name.
    • Refactored scripts a bit to make them look more amneziish.
  3. kmod-amneziawg is now compiled totally based on the upstream amneziawg-linux-kernel-module repo. Master branch has been chosen as a reference.

Results

Everything seems to work fine. No major problems have been detected or reported so far.

How to build and use

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:

  1. Get parameters for your router:
    • OpenWRT version: SNAPSHOT or release (e.x. 23.05.5). Can be found on the Status -> Overview page (Firmware Version parameter value).
    • CPU/package architecture: run opkg info kernel in console and check the Architecture value (e.x. aarch64_cortex-a53) or consult OpenWRT router database.
    • Target: can be found on the Status -> Overview page. The first part (before the slash) of the Target Platform value.
    • Subtarget: can be found on the Status -> Overview page. You guessed it! The second part (after the slash) of the Target Platform value.
    • Vermagic: run opkg info kernel in console check hash after the kernel version of the Version value. E.x. if the value equals to 6.6.52~f58afd3748410d3b1baa06a466d6682-r1 then vermagic equals to f58afd3748410d3b1baa06a466d6682. You can also choose:
      • auto: the script will get vermagic value from the OpenWrt site.
      • any: the script will not check the variable.
  2. Make a fork of this repo.
  3. Optional: update/change commit hashes (PKG_SOURCE_VERSION variable) of the upstream repos in amneziawg-tools/Makefile and kmod-amneziawg/Makefile file. Remember that amneziawg-tools features should match amneziawg-linux-kernel-module features, i.e. choose two corresponding commits in both repos.
  4. Go to Actions (enable them is needed).
  5. Choose Build OpenWrt toolchain cache, put your router parameters (from step 1) in the Run workflow menu and run the job.
  6. It will take ~2-2.5 hours to build the cache. So get some cookies, tea, your favorite book and wait.
  7. After the cache has been created, choose Build AmneziaWG from cache job, put the same parameters in the Run workflow menu and run it.
  8. 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).
  9. Unpack the archive, and install:
  • Via WebInterface (LuCi):
    • Go to System -> Software menu.
    • 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.
  • Via console:
    • Transfer files into the router.
    • Run opkg install {path to the kmod-amneziawg .ipk}
    • Run opkg install {path to the amneziawg-tools .ipk}
    • Run opkg install {path to the luci-proto-amneziawg .ipk}
  1. Reboot router or run /etc/init.d/network restart command in the console.
  2. Congratulations - you now have AmneziaWG installed on your router. Go to Network -> Interfaces page, press Add new interface.. and select AmneziaWG as protocol.

*Sometimes is is required to clean the browser's cache to see the new protocol available in the OpenWRT.

About

AmneziaWG for OpenWrt

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 63.5%
  • Makefile 20.1%
  • Shell 16.4%