Skip to content

Multi control

RomanovCaesar edited this page Sep 11, 2026 · 2 revisions

English | 简体中文

Overview

Multi-control connects m-ui panels as equal peers. There is no master, slave, or central coordinator. Each panel keeps its own identity and peer list, exchanges signed descriptors, and attempts direct connections to known members.

The network is useful for two features:

  • Sync Inbound: actively copy selected inbounds and clients to trusted peers.
  • Cross-panel subscriptions: pull and cache remote inbounds, then expose one aggregated subscription address.

Important

P2P membership is not NAT traversal. Every peer must be reachable over the advertised panel address and port, or through a reverse proxy that forwards the fixed peer paths.

Configure the local node

Open Panel Settings → Multi-control. Set:

  • Node Name: a human-readable name, up to 128 characters.
  • Local Node Address: the address other peers can reach, such as https://panel-a.example.com:2053. It must contain only scheme, host, and panel port; do not include the hidden panel URI path.

If TLS is enabled, use a hostname covered by the certificate. m-ui does not disable certificate verification for peers.

Each installation creates data/multi-control.json with an Ed25519 private identity. Do not copy that file when cloning a panel to another server; doing so creates duplicate identities.

Create a pairing token

In the local Multi-control section, enable or generate a pairing token. m-ui generates 16 characters by default. A manually entered token may contain 16–32 lowercase letters and digits and must contain both a letter and a digit.

The token is used for the initial pairing handshake only. After pairing, the panels authenticate membership with signed node identities and use the trusted relationship for sync operations.

Treat the token like a bootstrap secret. Rotate it after onboarding the required peers, and never publish it in a screenshot or issue.

Add a peer

On another m-ui panel:

  1. Open Panel Settings → Multi-control.
  2. Click Add Connection.
  3. Enter the target panel host/IP, panel port, protocol (auto, https, or http), and pairing token.
  4. Confirm the connection.

auto tries HTTPS first and HTTP second. The target must have its pairing token enabled and its local node address configured. Once the first peer is connected, signed peer descriptors can introduce other members.

Peer states

The peer list shows endpoint, node name, online state, last-seen time, and the last connection error. Offline members are retained and retried with backoff. A peer's advertised endpoint can be updated from that peer's own settings.

Disconnect is local: it removes the member from this panel and blocks automatic rediscovery. It does not globally remove the node from other panels. Use Allow rediscovery when you want a still-connected common member to introduce it again.

The network is limited to 128 saved members per panel. Heartbeats normally run every 15 seconds, and direct sync uses up to four concurrent peer requests.

Peer paths and reverse proxies

The peer protocol is not under the hidden panel URI path. A reverse proxy must forward these fixed paths to the panel listener:

/_m-ui/peer/v1
/_m-ui/peer/inbound/v1

The dedicated subscription port does not expose either endpoint. Forward the paths to the panel port, preserve the Host header, and use a certificate trusted by the peer.

Sync Inbound

Open Inbounds → General Actions → Sync Inbound.

  1. The left side lists connected peers other than the current panel. They are selected by default.
  2. The matrix lists local Username × Inbound relationships.
  3. Green cells are selected; white cells are deselected; gray cells have no actual Client and cannot be selected.
  4. Select whole peers, rows, columns, or individual cells.
  5. Click Sync, review the confirmation dialog, and confirm.
  6. Follow the per-peer progress and result window.

The transfer includes selected inbound configuration and clients. Existing copies created from the same source identity are updated; unrelated target clients, traffic counters, and online state are preserved. Name and port conflicts are reported rather than overwritten.

The operation is encrypted with a temporary X25519 session and AES-GCM payload, and authenticated by the trusted Ed25519 peer identities. Certificate/private-key references are converted to PEM content before transfer.

After a successful sync, restart Mihomo on the target panel. The result success means the target saved the inbound and regenerated YAML; it does not mean the target core has already reloaded it.

Cross-panel subscriptions

Configure Panel Settings → Subscription → Cross Panel Subscription Path first. It must look like /isub plus 16 lowercase letters/digits.

Then open Inbounds → General Actions → Export All Subscriptions (Cross Panel).

  1. Click Pull all inbound information.
  2. m-ui contacts every connected peer and reports progress.
  3. Remote inbound and Username-token data is cached under data/cross-panel-subscriptions.json.
  4. The local inbounds are always read live; remote data is retained when a temporary pull fails.
  5. Copy or download the generated bare URLs. Add /clash to a URL for Mihomo YAML.

Remote nodes are sorted by inbound name. The cache is per source identity, so a panel going offline does not immediately erase its last successful data. Use Clear remote cache to remove all non-local cached sources.

The aggregated address has the form:

https://panel.example.com:port/<cross-panel-path>/<username-token>
https://panel.example.com:port/<cross-panel-path>/<username-token>/clash

The cross-panel page exposes only the Username's matching nodes. A remote node's share links use the remote peer host/port, while the page itself is served by the panel where aggregation was requested.

Network requirements

  • Allow panel-to-panel TCP access in cloud security groups and firewalls.
  • Use stable DNS names when peer addresses change.
  • Keep system clocks synchronized.
  • Configure TLS certificates that match the peer hostnames.
  • Ensure reverse proxies pass both peer paths without adding the hidden panel path.
  • Upgrade all participating panels before using new synchronization features.

Backup and migration

Normal panel backups do not include multi-control.json. This prevents restoring a backup onto another machine from creating duplicate peer identities. To migrate the same physical server, move that file securely and preserve its permissions; when creating a new node, let m-ui generate a new identity.

Clone this wiki locally