mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5011] [Feature]: Customizable WireGuard Interface IP in 3x-ui #3528
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#3528
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ashkan32 on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5011
Hello,
I would like to request a feature for 3x-ui that allows users to change the default WireGuard interface IP address (currently 10.0.0.1).
At the moment, WireGuard configurations in 3x-ui appear to use a fixed interface IP (10.0.0.1). This limitation makes it difficult to run multiple WireGuard instances or multiple WireGuard-based connections on the same server, because each instance may require a different subnet and interface IP.
Enables multiple WireGuard connections on the same server
Prevents IP subnet conflicts
Provides more flexibility for advanced network setups and routing scenarios
This feature would be very useful for users who deploy multiple VPN tunnels, routing setups, or multi-tenant environments.
Thank you for your work on this project.
Describe the solution you'd like
Allow users to customize the WireGuard interface IP and subnet when creating or editing a WireGuard inbound.
Example: instead of being limited to 10.0.0.1/24, users could choose values like:
10.0.1.1/24
10.10.0.1/24
172.16.0.1/24
The setting should be configurable through the 3x-ui panel interface.
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?
Before submitting
@github-actions[bot] commented on GitHub (Jun 6, 2026):
Thanks for the detailed request, @ashkan32.
What the code currently does
Looking at
frontend/src/schemas/protocols/inbound/wireguard.tsandfrontend/src/lib/xray/inbound-defaults.ts, the WireGuard inbound settings schema (WireguardInboundSettingsSchema) exposes:mtu,secretKey,peers[], andnoKernelTun. There is no server-side interface address field. The schema carries no concept of a server IP like10.0.0.1.The
10.0.0.2/32you see comes fromcreateDefaultWireguardInboundSettings()— it's a hardcoded default for the first peer'sallowedIPs. The implicit assumption is that the server side of the tunnel is10.0.0.1, but that value is never actually stored or sent to Xray-core through the panel.When you add additional peers, the form now auto-increments from the highest peer IP already present (the
nextWgPeerAllowedIP()fix shipped in v3.2.5).Partial workaround available today
The
allowedIPsfield for every peer is already a free-text, editable list in the inbound form. You can break the10.0.0.xdefault for a second WireGuard inbound by manually changing the first peer's address when creating it:10.0.0.2/32(auto-assigned default)10.10.0.2/32; all subsequent peers on that inbound will auto-increment within the10.10.0.xsubnetThis avoids routing conflicts between inbounds even today. The limitation is that it's entirely manual — the panel has no concept of a per-inbound "base subnet" that seeds new peers automatically.
What's genuinely missing
10.0.0.2/32.WireguardInboundSettingsSchemaand form UI do not expose it.Both of these are valid additions and the second would require confirming exactly which JSON key Xray-core accepts for the server-side interface address.
@ashkan32 commented on GitHub (Jun 6, 2026):
I tested the suggested partial workaround by manually changing the peer IP to 10.10.0.2/32 on the second inbound.
As expected, the handshake succeeds, but traffic does not pass. This happens because Xray-core still defaults its internal interface address to 10.0.0.1 when no custom address is specified by the panel. The client tries to route through 10.10.0.1, causing a subnet mismatch and dropping packets.
This confirms that the second missing part ("A server-side interface address field") is absolutely mandatory for this feature to work. I will look into adding the server-side interface address field to the WireguardInboundSettingsSchema.
@MHSanaei commented on GitHub (Jun 12, 2026):
This is already configurable. The WireGuard client''s [Interface] Address in generated configs comes from the peer''s Allowed IPs field, which is fully editable in the inbound form — the 10.0.0.x/32 value is only an auto-increment suggestion when you click "Add peer". Set any subnet you like (e.g. 10.7.0.2/32) and the share link / .conf follows. There is no server-side interface IP to configure: xray-core''s WireGuard inbound is a userspace netstack with no real kernel interface, which also means multiple WireGuard inbounds don''t conflict with each other.