[GH-ISSUE #5710] [Feature]: Network segmentation support for separating service traffic and management access #3974

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

Originally created by @Officer-rabbit on GitHub (Jul 1, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5710

In some deployment environments, the network used for client service traffic should be separated from the network used for panel management. Currently, 3x-ui does not provide a clear panel-level way to separate the management network from the service/business network.

For security and operational reasons, I would like the 3x-ui admin panel, API access, and management functions to be reachable only through a dedicated management interface or management network, while proxy service traffic uses separate service interfaces or service networks.

Describe the solution you'd like

I would like 3x-ui to support a network segmentation model similar to VLAN separation, where management traffic and service traffic can be separated.

Expected behavior:

  • The administrator can define a management interface or management bind address.
  • The 3x-ui web panel and API can listen only on the management network.
  • Proxy inbounds can listen on separate service/business interfaces.
  • The management network and service network can be configured independently.
  • Optional firewall or access control hints could be generated by the panel.
  • The panel should make it clear which interface is used for management and which interfaces are used for client traffic.

Possible configuration example:

{
  "networkSegmentation": {
    "enabled": true,
    "management": {
      "bindAddress": "10.0.0.2",
      "interface": "eth0",
      "allowCIDR": ["10.0.0.0/24"]
    },
    "service": {
      "interfaces": ["eth1", "eth2"],
      "bindMode": "selected-interfaces"
    }
  }
}

This would allow administrators to keep the control plane and data plane separated.

Alternatives you've considered

I considered using only external Linux firewall rules, VLAN configuration, reverse proxy rules, or manual bind-address settings. These methods can work, but they are not easy to manage from the 3x-ui panel and can be error-prone.

A panel-level configuration would make deployments safer and easier to maintain, especially when the server has multiple NICs, VLANs, PPPoE links, or separate private/public networks.

Concrete use case

A typical deployment has two different networks:

  • Management network: used only by the administrator to access the 3x-ui panel and API.
  • Service/business network: used by clients for proxy traffic and subscriptions.

For example:

  • eth0 / 10.0.0.2: management network, only accessible from the administrator’s private network.
  • eth1 / public IP: service network, used for client inbound traffic.
  • ppp0 to ppp15: optional WAN or outbound interfaces used for service traffic.

The goal is to prevent the admin panel from being exposed on the public service network, while still allowing proxy traffic to work normally.

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 @Officer-rabbit on GitHub (Jul 1, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5710 ### Is your feature request related to a problem? In some deployment environments, the network used for client service traffic should be separated from the network used for panel management. Currently, 3x-ui does not provide a clear panel-level way to separate the management network from the service/business network. For security and operational reasons, I would like the 3x-ui admin panel, API access, and management functions to be reachable only through a dedicated management interface or management network, while proxy service traffic uses separate service interfaces or service networks. ### Describe the solution you'd like I would like 3x-ui to support a network segmentation model similar to VLAN separation, where management traffic and service traffic can be separated. Expected behavior: - The administrator can define a management interface or management bind address. - The 3x-ui web panel and API can listen only on the management network. - Proxy inbounds can listen on separate service/business interfaces. - The management network and service network can be configured independently. - Optional firewall or access control hints could be generated by the panel. - The panel should make it clear which interface is used for management and which interfaces are used for client traffic. Possible configuration example: ```json { "networkSegmentation": { "enabled": true, "management": { "bindAddress": "10.0.0.2", "interface": "eth0", "allowCIDR": ["10.0.0.0/24"] }, "service": { "interfaces": ["eth1", "eth2"], "bindMode": "selected-interfaces" } } } ``` This would allow administrators to keep the control plane and data plane separated. ### Alternatives you've considered I considered using only external Linux firewall rules, VLAN configuration, reverse proxy rules, or manual bind-address settings. These methods can work, but they are not easy to manage from the 3x-ui panel and can be error-prone. A panel-level configuration would make deployments safer and easier to maintain, especially when the server has multiple NICs, VLANs, PPPoE links, or separate private/public networks. ### Concrete use case A typical deployment has two different networks: - Management network: used only by the administrator to access the 3x-ui panel and API. - Service/business network: used by clients for proxy traffic and subscriptions. For example: - `eth0` / `10.0.0.2`: management network, only accessible from the administrator’s private network. - `eth1` / public IP: service network, used for client inbound traffic. - `ppp0` to `ppp15`: optional WAN or outbound interfaces used for service traffic. The goal is to prevent the admin panel from being exposed on the public service network, while still allowing proxy traffic to work normally. ### 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.
bsakaguchi 2026-10-31 20:36:16 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jul 1, 2026):

Most of this is already possible with existing settings; a few pieces (CIDR allowlisting, an explicit "management vs service" UI label) are not implemented.

Already supported today

  • Panel/API bind address — Settings → Panel Settings → Listen IP Address (backend key webListen). The Gin HTTP(S) server binds only to this IP:port (internal/web/web.go, GetListen()/net.ListenConfig.Listen). Set it to your management interface's address, e.g. 10.0.0.2, and the panel + REST API (including /panel/api/...) are only reachable there.
  • Subscription server bind address — Settings has a separate Sub listen IP (subListen, internal/web/service/setting.go), independent of webListen, validated so it can't reuse the same ip:port as the panel (internal/web/entity/entity.go).
  • Per-inbound bind address — each inbound has its own listen field (internal/database/model/model.go, the Address field in the inbound edit form, frontend/src/pages/inbounds/form/InboundFormModal.tsx). You can bind different inbounds to eth1's address, eth2's address, etc., completely independently of the panel's listen IP.

So the concrete deployment you describe — panel/API on eth0/10.0.0.2, proxy inbounds on eth1/public IP — can be built today purely from panel settings, with no VLAN/firewall trickery: set webListen (and subListen if you use subscriptions) to the management IP, and set each inbound's listen to the service-network IP you want it to bind.

Not implemented

  • There is no CIDR-based access-control allowlist for the panel (the allowCIDR idea in your example). The only related setting, trustedProxyCIDRs, is unrelated — it only tells the panel which reverse-proxy IPs to trust for X-Forwarded-For headers, it does not restrict who can connect. The only built-in request-level gate is DomainValidatorMiddleware (internal/web/middleware/domainValidator.go), which checks the HTTP Host header against webDomain, not the source network.
  • There is no UI concept of named "management" vs "service" interfaces/NICs, no interface-name picker (only raw listen IP/socket strings), and no generated firewall/nftables hints.
  • Binding by interface name (eth0, ppp0-ppp15) isn't supported directly — Go's net.Listen/xray-core bind by IP or Unix socket, not by NIC name, so you'd bind to that interface's IP address instead.

If real IP/CIDR-based access control at the panel level (not just documentation of "set webListen to your management IP") is what you're after, that would need new code — an allowlist middleware checking c.ClientIP()/RemoteAddr against configured CIDRs, applied ahead of the panel/API routes in internal/web/web.go. That's a reasonable, scoped enhancement; the multi-field networkSegmentation JSON block in the issue is broader than what's likely to be adopted, since bind-address separation for panel/sub/inbounds already exists.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4852604073 --> @github-actions[bot] commented on GitHub (Jul 1, 2026): Most of this is already possible with existing settings; a few pieces (CIDR allowlisting, an explicit "management vs service" UI label) are not implemented. **Already supported today** - **Panel/API bind address** — Settings → Panel Settings → *Listen IP Address* (backend key `webListen`). The Gin HTTP(S) server binds only to this IP:port (`internal/web/web.go`, `GetListen()`/`net.ListenConfig.Listen`). Set it to your management interface's address, e.g. `10.0.0.2`, and the panel + REST API (including `/panel/api/...`) are only reachable there. - **Subscription server bind address** — Settings has a separate *Sub* listen IP (`subListen`, `internal/web/service/setting.go`), independent of `webListen`, validated so it can't reuse the same `ip:port` as the panel (`internal/web/entity/entity.go`). - **Per-inbound bind address** — each inbound has its own `listen` field (`internal/database/model/model.go`, the *Address* field in the inbound edit form, `frontend/src/pages/inbounds/form/InboundFormModal.tsx`). You can bind different inbounds to `eth1`'s address, `eth2`'s address, etc., completely independently of the panel's listen IP. So the concrete deployment you describe — panel/API on `eth0`/`10.0.0.2`, proxy inbounds on `eth1`/public IP — can be built today purely from panel settings, with no VLAN/firewall trickery: set `webListen` (and `subListen` if you use subscriptions) to the management IP, and set each inbound's `listen` to the service-network IP you want it to bind. **Not implemented** - There is no CIDR-based access-control allowlist for the panel (the `allowCIDR` idea in your example). The only related setting, `trustedProxyCIDRs`, is unrelated — it only tells the panel which reverse-proxy IPs to trust for `X-Forwarded-For` headers, it does not restrict who can connect. The only built-in request-level gate is `DomainValidatorMiddleware` (`internal/web/middleware/domainValidator.go`), which checks the HTTP `Host` header against `webDomain`, not the source network. - There is no UI concept of named "management" vs "service" interfaces/NICs, no interface-name picker (only raw listen IP/socket strings), and no generated firewall/nftables hints. - Binding by interface name (`eth0`, `ppp0`-`ppp15`) isn't supported directly — Go's `net.Listen`/xray-core bind by IP or Unix socket, not by NIC name, so you'd bind to that interface's IP address instead. If real IP/CIDR-based access control at the panel level (not just documentation of "set `webListen` to your management IP") is what you're after, that would need new code — an allowlist middleware checking `c.ClientIP()`/`RemoteAddr` against configured CIDRs, applied ahead of the panel/API routes in `internal/web/web.go`. That's a reasonable, scoped enhancement; the multi-field `networkSegmentation` JSON block in the issue is broader than what's likely to be adopted, since bind-address separation for panel/sub/inbounds already exists. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@Officer-rabbit commented on GitHub (Jul 1, 2026):

Thank you for the clarification. I would like to further explain the “maintenance/OOB network” part of the use case.

In my scenario, the Windows Remote Desktop access is not just a normal LAN-side RDP connection. I would like it to be reachable through a separate access path created and managed by 3x-ui.

For example:

  • Normal user proxy traffic uses the service/user traffic network.
  • 3x-ui panel/API uses the management network.
  • Windows Remote Desktop maintenance access uses a separate maintenance path.
  • This maintenance path could be bound to a specific PPPoE line, a dedicated WAN line, a dedicated WireGuard inbound, or a separate subscription node created only for maintenance.
  • Only clients connected through that dedicated WireGuard/subscription path should be able to reach the Windows Remote Desktop service.

The important point is that these three paths should be isolated from each other:

  1. Management plane: 3x-ui panel/API.
  2. User service plane: normal proxy users and subscription traffic.
  3. Maintenance/OOB plane: Windows Remote Desktop or emergency access.

A concrete failure scenario:

If the 3x-ui management network and the normal user traffic network both fail, the administrator should still be able to connect through the dedicated maintenance/OOB path to reach Windows Remote Desktop and troubleshoot the environment.

Likewise, if the user service network has routing problems, packet loss, PPPoE failure, or firewall issues, those failures should not affect the Windows Remote Desktop maintenance path. If the maintenance path fails, it should not affect the user proxy traffic or panel management path.

So the request is not only about binding the panel and inbounds to different IP addresses. It is about making it easier to define independent access planes with separate routing, binding, access control, and failure domains.

A practical implementation could be smaller in scope:

  • Allow administrators to mark an inbound or subscription as “maintenance/OOB only”.
  • Allow that maintenance inbound to bind to a specific listen IP or dedicated PPPoE/WAN/WireGuard path.
  • Allow destination restrictions for that maintenance inbound, for example only allowing access to a specific Windows RDP IP and port such as 10.10.30.5:3389.
  • Add CIDR/user/client restrictions so only selected admin clients can use that maintenance path.
  • Display the network role of each inbound: management, user service, or maintenance/OOB.
  • Provide firewall/nftables guidance to prevent traffic leakage between these roles.
  • Optionally support health/status indicators per role, so administrators can see whether the management path, user path, and maintenance path are independently reachable.

This would be useful in PVE or multi-NIC environments where the 3x-ui VM, Windows VM, PPPoE links, WireGuard access, management network, and user service traffic are intentionally separated.

The goal is not necessarily for 3x-ui to create VLANs directly. The goal is for 3x-ui to provide clearer support for operating separate network roles and failure domains, especially for emergency access paths such as Windows Remote Desktop through a dedicated WireGuard or subscription-based maintenance node.

<!-- gh-comment-id:4852948385 --> @Officer-rabbit commented on GitHub (Jul 1, 2026): Thank you for the clarification. I would like to further explain the “maintenance/OOB network” part of the use case. In my scenario, the Windows Remote Desktop access is not just a normal LAN-side RDP connection. I would like it to be reachable through a separate access path created and managed by 3x-ui. For example: - Normal user proxy traffic uses the service/user traffic network. - 3x-ui panel/API uses the management network. - Windows Remote Desktop maintenance access uses a separate maintenance path. - This maintenance path could be bound to a specific PPPoE line, a dedicated WAN line, a dedicated WireGuard inbound, or a separate subscription node created only for maintenance. - Only clients connected through that dedicated WireGuard/subscription path should be able to reach the Windows Remote Desktop service. The important point is that these three paths should be isolated from each other: 1. Management plane: 3x-ui panel/API. 2. User service plane: normal proxy users and subscription traffic. 3. Maintenance/OOB plane: Windows Remote Desktop or emergency access. A concrete failure scenario: If the 3x-ui management network and the normal user traffic network both fail, the administrator should still be able to connect through the dedicated maintenance/OOB path to reach Windows Remote Desktop and troubleshoot the environment. Likewise, if the user service network has routing problems, packet loss, PPPoE failure, or firewall issues, those failures should not affect the Windows Remote Desktop maintenance path. If the maintenance path fails, it should not affect the user proxy traffic or panel management path. So the request is not only about binding the panel and inbounds to different IP addresses. It is about making it easier to define independent access planes with separate routing, binding, access control, and failure domains. A practical implementation could be smaller in scope: - Allow administrators to mark an inbound or subscription as “maintenance/OOB only”. - Allow that maintenance inbound to bind to a specific listen IP or dedicated PPPoE/WAN/WireGuard path. - Allow destination restrictions for that maintenance inbound, for example only allowing access to a specific Windows RDP IP and port such as `10.10.30.5:3389`. - Add CIDR/user/client restrictions so only selected admin clients can use that maintenance path. - Display the network role of each inbound: management, user service, or maintenance/OOB. - Provide firewall/nftables guidance to prevent traffic leakage between these roles. - Optionally support health/status indicators per role, so administrators can see whether the management path, user path, and maintenance path are independently reachable. This would be useful in PVE or multi-NIC environments where the 3x-ui VM, Windows VM, PPPoE links, WireGuard access, management network, and user service traffic are intentionally separated. The goal is not necessarily for 3x-ui to create VLANs directly. The goal is for 3x-ui to provide clearer support for operating separate network roles and failure domains, especially for emergency access paths such as Windows Remote Desktop through a dedicated WireGuard or subscription-based maintenance node.
Author
Owner

@MHSanaei commented on GitHub (Jul 3, 2026):

The deployment you describe is achievable with existing panel features today:

  • Set Settings → Listen IP (webListen, plus subListen for the subscription server) to your management interface's IP so the panel/API are only reachable there.
  • Bind each service inbound to its own IP via the inbound's Address field.
  • Create a dedicated maintenance inbound (e.g. WireGuard) on its own IP, and pin its egress to a specific WAN via the outbound's sockopt interface.
  • Add Xray routing rules matching that inbound's tag plus destination IP/port (e.g. allow only 10.10.30.5:3389, blackhole the rest) and source CIDRs.

That gives you the three isolated planes — management, user service, and maintenance/OOB — with independent bindings and failure behavior. The remaining items (interface-name pickers, generated firewall/nftables rules, VLAN/role orchestration) are OS-level network management outside what a proxy panel should own, so a dedicated "network segmentation" subsystem is not planned.

If one specific small gap matters to you (e.g. a CIDR allowlist for panel access), please open a focused issue for just that. Closing as achievable with current features.

<!-- gh-comment-id:4873804019 --> @MHSanaei commented on GitHub (Jul 3, 2026): The deployment you describe is achievable with existing panel features today: - Set **Settings → Listen IP** (`webListen`, plus `subListen` for the subscription server) to your management interface's IP so the panel/API are only reachable there. - Bind each service inbound to its own IP via the inbound's **Address** field. - Create a dedicated maintenance inbound (e.g. WireGuard) on its own IP, and pin its egress to a specific WAN via the outbound's sockopt **interface**. - Add Xray routing rules matching that inbound's tag plus destination IP/port (e.g. allow only `10.10.30.5:3389`, blackhole the rest) and source CIDRs. That gives you the three isolated planes — management, user service, and maintenance/OOB — with independent bindings and failure behavior. The remaining items (interface-name pickers, generated firewall/nftables rules, VLAN/role orchestration) are OS-level network management outside what a proxy panel should own, so a dedicated "network segmentation" subsystem is not planned. If one specific small gap matters to you (e.g. a CIDR allowlist for panel access), please open a focused issue for just that. Closing as achievable with current features.
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#3974
No description provided.