[GH-ISSUE #5011] [Feature]: Customizable WireGuard Interface IP in 3x-ui #3528

Closed
opened 2026-10-31 20:33:05 +07:00 by bsakaguchi · 3 comments
Owner

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?

  • 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.
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? - [ ] I'd like to implement this feature myself and open a PR. - [ ] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
Author
Owner

@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.ts and frontend/src/lib/xray/inbound-defaults.ts, the WireGuard inbound settings schema (WireguardInboundSettingsSchema) exposes: mtu, secretKey, peers[], and noKernelTun. There is no server-side interface address field. The schema carries no concept of a server IP like 10.0.0.1.

The 10.0.0.2/32 you see comes from createDefaultWireguardInboundSettings() — it's a hardcoded default for the first peer's allowedIPs. The implicit assumption is that the server side of the tunnel is 10.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 allowedIPs field for every peer is already a free-text, editable list in the inbound form. You can break the 10.0.0.x default for a second WireGuard inbound by manually changing the first peer's address when creating it:

  • Inbound 1 → leave at 10.0.0.2/32 (auto-assigned default)
  • Inbound 2 → change the first peer to 10.10.0.2/32; all subsequent peers on that inbound will auto-increment within the 10.10.0.x subnet

This 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

  1. A configurable default starting IP / subnet at the inbound level, so new peers auto-number within a user-chosen range instead of always defaulting to 10.0.0.2/32.
  2. A server-side interface address field — if Xray-core's WireGuard inbound accepts an explicit interface IP in its JSON settings (as noted in a prior related request, #4146), the panel's WireguardInboundSettingsSchema and 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.

<!-- gh-comment-id:4638546709 --> @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.ts` and `frontend/src/lib/xray/inbound-defaults.ts`, the WireGuard inbound settings schema (`WireguardInboundSettingsSchema`) exposes: `mtu`, `secretKey`, `peers[]`, and `noKernelTun`. There is **no** server-side interface address field. The schema carries no concept of a server IP like `10.0.0.1`. The `10.0.0.2/32` you see comes from `createDefaultWireguardInboundSettings()` — it's a hardcoded default for the first peer's `allowedIPs`. The implicit assumption is that the server side of the tunnel is `10.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 `allowedIPs` field for every peer is already a free-text, editable list in the inbound form. You can break the `10.0.0.x` default for a second WireGuard inbound by manually changing the first peer's address when creating it: - Inbound 1 → leave at `10.0.0.2/32` (auto-assigned default) - Inbound 2 → change the first peer to `10.10.0.2/32`; all subsequent peers on that inbound will auto-increment within the `10.10.0.x` subnet This 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 1. **A configurable default starting IP / subnet** at the inbound level, so new peers auto-number within a user-chosen range instead of always defaulting to `10.0.0.2/32`. 2. **A server-side interface address field** — if Xray-core's WireGuard inbound accepts an explicit interface IP in its JSON settings (as noted in a prior related request, #4146), the panel's `WireguardInboundSettingsSchema` and 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.
Author
Owner

@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.

<!-- gh-comment-id:4640020722 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:4688394914 --> @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.
Sign in to join this conversation.
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
MHSanaei/3x-ui#3528
No description provided.