#6557·3x-ui

[Feature Request / UI Bug] AWG generator generates single 32-bit values instead of range-based (low-high) values for H1-H4, breaking compatibility with AWG 2.0 clients (e.g. Keenetic OS)

Author: antonproitCreated Sep 15, 2026Updated Sep 16, 2026
Labelsenhancement

Is your feature request related to a problem?

Description

In version v3.8.0, the internal AmneziaWG generator in Inbounds and Outbounds generates single 32-bit integer values (e.g., 503690276) for parameters H1, H2, H3, and H4.

While this works for modern AWG 3.1 deployments with HeaderProtectionKey enabled, it causes compatibility issues when attempting to deploy or export configs for AmneziaWG 2.0 or 1.0 clients—specifically routers like Keenetic OS (v5.x).

Keenetic OS relies on the range-based syntax (low-high, e.g., 100000000-900000000) in the H1-H4 fields to parse and activate the AWG 2.0 driver. When presented with single integer values and no HeaderProtectionKey, Keenetic falls back to AWG 1.0 logic or fails to enforce AWG 2.0 obfuscation properly.

Currently, users have to manually edit all H1-H4 fields, toggle options, clear keys, and modify parameters to switch between protocol standards.

Describe the solution you'd like

Proposed Solution / Feature Request

  1. Preset / Version Selector Buttons (1.0 / 2.0 / 3.1): Add dedicated buttons or a drop-down selector in the UI to choose the target AmneziaWG Version Preset. Clicking a preset should automatically update and re-calculate all obfuscation fields:

    • AWG 1.0 Preset: Generates single 32-bit integer values for H1-H4, clears HeaderProtectionKey, disables RandomTrailers, DisableCookies, and extra padding options.
    • AWG 2.0 Preset: Generates range-based values (low-high, e.g., 100000000-900000000) for H1-H4, clears HeaderProtectionKey, disables RandomTrailers and DisableCookies.
    • AWG 3.1 Preset: Generates single 32-bit values for H1-H4, populates HeaderProtectionKey, enables RandomTrailers, DisableCookies, and advanced padding options.
  2. Smart "Re-generate" Button: Ensure the "Re-generate" button respects the currently selected AWG version preset so users don't have to manually adjust formatting every time new parameters are generated.


Environment

  • 3x-ui Version: v3.8.0
  • Xray Core: v26.9.9
  • Client / Remote Device: Keenetic OS (v5.x), legacy AWG 1.0/2.0 clients

Alternatives you've considered

No response

Concrete use case

No response

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

No response

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.