[GH-ISSUE #40] awg-quick crashes when i1–i5 parameters are empty (AmneziaWG v2 protocol) #18

Open
opened 2026-10-13 21:02:25 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @MrWaip on GitHub (Mar 1, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-tools/issues/40

Hi, I'm getting an error when trying to bring up an AmneziaWG v2 interface on Linux using a config exported from Amnezia self-hosted.

The config has Jc, Jmin, Jmax, S1, S2, H1–H4 set, but I1–I5 come out empty from the export:

[Interface]
PrivateKey = <key>
Address =
DNS = 1.1.1.1
Jc = 4
Jmin = 40
Jmax = 70
S1 = 0
S2 = 0
H1 = 1
H2 = 2
H3 = 3
H4 = 4
I1 = <b 0x084481800001000300000000077469636b...
I2 = 
I3 =
I4 =
I5 =

[Peer]
PublicKey = <key>
AllowedIPs = 0.0.0.0/0
Endpoint = <host>:<port>

Running awg-quick up awg0 fails. After some digging I found the issue in awg-quick — empty I1–I5 values are silently dropped and never passed to awg setconf:

I1|I2|I3|I4|I5) [[ -n $value ]] && WG_CONFIG+="$line"$'\n'; continue ;;

So awg setconf gets a config without those fields and chokes on it. No warning is printed, which makes it hard to debug.

This seems to affect anyone exporting configs from Amnezia self-hosted since that's where the empty I1–I5 come from.

Originally created by @MrWaip on GitHub (Mar 1, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-tools/issues/40 Hi, I'm getting an error when trying to bring up an [AmneziaWG v2 interface on Linux](https://github.com/amnezia-vpn/amneziawg-tools/blob/master/src/wg-quick/linux.bash) using a config exported from Amnezia self-hosted. The config has `Jc`, `Jmin`, `Jmax`, `S1`, `S2`, `H1`–`H4` set, but `I1`–`I5` come out empty from the export: ```ini [Interface] PrivateKey = <key> Address = DNS = 1.1.1.1 Jc = 4 Jmin = 40 Jmax = 70 S1 = 0 S2 = 0 H1 = 1 H2 = 2 H3 = 3 H4 = 4 I1 = <b 0x084481800001000300000000077469636b... I2 = I3 = I4 = I5 = [Peer] PublicKey = <key> AllowedIPs = 0.0.0.0/0 Endpoint = <host>:<port> ``` Running `awg-quick up awg0` fails. After some digging I found the issue in `awg-quick` — empty `I1`–`I5` values are silently dropped and never passed to `awg setconf`: ```bash I1|I2|I3|I4|I5) [[ -n $value ]] && WG_CONFIG+="$line"$'\n'; continue ;; ``` So `awg setconf` gets a config without those fields and chokes on it. No warning is printed, which makes it hard to debug. This seems to affect anyone exporting configs from Amnezia self-hosted since that's where the empty `I1`–`I5` come from.
Author
Owner

@MrWaip commented on GitHub (Mar 1, 2026):

Also, a separate question: would you consider adding SteamOS support to awg-quick?

SteamOS doesn't have resolvconf, but it does have resolvectl (systemd-resolved). The only change needed in set_dns/unset_dns is replacing resolvconf calls with resolvectl:

set_dns() {
    [[ ${#DNS[@]} -gt 0 ]] || return 0
    cmd resolvectl dns "$INTERFACE" "${DNS[@]}"
    [[ ${#DNS_SEARCH[@]} -eq 0 ]] || cmd resolvectl domain "$INTERFACE" "${DNS_SEARCH[@]}"
    HAVE_SET_DNS=1
}

unset_dns() {
    [[ ${#DNS[@]} -gt 0 ]] || return 0
    cmd resolvectl revert "$INTERFACE"
}

We're doing exactly this in a fork for a Steam Deck VPN plugin: https://github.com/MrWaip/vpn-deck/blob/main/bin/awg-quick#L148

<!-- gh-comment-id:3979847696 --> @MrWaip commented on GitHub (Mar 1, 2026): Also, a separate question: would you consider adding SteamOS support to `awg-quick`? SteamOS doesn't have `resolvconf`, but it does have `resolvectl` (systemd-resolved). The only change needed in `set_dns`/`unset_dns` is replacing `resolvconf` calls with `resolvectl`: ```bash set_dns() { [[ ${#DNS[@]} -gt 0 ]] || return 0 cmd resolvectl dns "$INTERFACE" "${DNS[@]}" [[ ${#DNS_SEARCH[@]} -eq 0 ]] || cmd resolvectl domain "$INTERFACE" "${DNS_SEARCH[@]}" HAVE_SET_DNS=1 } unset_dns() { [[ ${#DNS[@]} -gt 0 ]] || return 0 cmd resolvectl revert "$INTERFACE" } ``` We're doing exactly this in a fork for a Steam Deck VPN plugin: https://github.com/MrWaip/vpn-deck/blob/main/bin/awg-quick#L148
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-tools#18
No description provided.