This is an extended version of the anvarsoft/mikrotik_mihomo image.
Web UI for mihomo config management
config.yaml.quick-list rule provider) without editing the config manually.mihomo -t + network mode compatibility) before applying; mihomo restarts with the new config.Without the WEBUI_PASS variable, the image works exactly like the base mikrotik_mihomo image.
The configuration directory on the router must be mounted as a whole (not as an individual file) to /root/.config/mihomo.
If config.yaml does not exist in the mounted directory, a configuration is created automatically. The type depends on MIHOMO_SUB_URL.
The MIHOMO_SUB_URL variable is not set or is missing, the starter configuration is created:
MATCH,DIRECT): client network connectivity works immediately, without a proxy;tproxy-port: 7894 or redir-port: 7892 with TUN;secret is taken from MIHOMO_SECRET or generated randomly.While the starter configuration is active, the web interface displays a banner with the API address and secret. Upload your own configuration using the "Upload file" button, or edit the starter configuration and click "Apply".
If config.yaml is deleted after the container has already been running, the file is restored from the last applied version.
MIHOMO_SUB_URL is set — a working configuration is created from a subscription-based template:
The zashboard dashboard is downloaded automatically and is available at http://:9090/ui/.
| Variable | Default | Description |
|---|---|---|
TPROXY | true | true — TProxy (TCP+UDP, requires RouterOS 7.21+ with nftables); false — Redirect (TCP) + TUN (UDP) |
WEBUI_PASS | -- | Web interface password; enables the web interface and managed mode |
WEBUI_USER | admin | Web interface username (letters, digits, _ . -) |
WEBUI_PORT | 9191 | Web interface port; must not conflict with mihomo ports |
MIHOMO_SECRET | random | mihomo API secret for the initial configuration |
LOG_BUFFER_KB | 256 | In-memory log buffer size, KB |
Mikrotik settings for point routing (for example, the mihomo container address is 172.17.0.2).
/ip dhcp-server network
set [find] dns-server=172.17.0.2
/routing table
add disabled=no fib name=to_vps
/ip route
add comment="mihomo fake-ip" disabled=no distance=1 \
dst-address=198.18.0.0/15 gateway=172.17.0.2 \
routing-table=main scope=30 target-scope=10
add comment="cf & tg & fb in mihomo" disabled=no distance=1 \
dst-address=0.0.0.0/0 gateway=172.17.0.2@main \
routing-table=to_vps scope=30 target-scope=10
/ip firewall mangle
add action=mark-connection chain=prerouting \
comment="cloudflare to_vps" connection-state=new \
dst-address-list=cloudflare in-interface-list=LAN \
new-connection-mark=to_vps
add action=mark-connection chain=prerouting \
comment="telegram to_vps" connection-state=new \
dst-address-list=telegram in-interface-list=LAN \
new-connection-mark=to_vps
add action=mark-connection chain=prerouting \
comment="meta_ips to_vps" connection-state=new \
dst-address-list=meta_ips in-interface-list=LAN \
new-connection-mark=to_vps
add action=mark-routing chain=prerouting \
comment="cf & tg & fb to_vps" connection-mark=to_vps \
in-interface-list=LAN new-routing-mark=to_vps
/ip firewall filter
add action=accept chain=forward comment="mihomo fake-ip" \
dst-address=198.18.0.0/15
ip firewall filter in the fasttrack rule add the connection-mark=no-mark parameter
It is also necessary to create lists in the ip firewall address-list with the names: cloudflare, telegram, meta_ips, including the IP addresses of the corresponding resources.
!!! Lists must be created before executing the commands above.
Terminal command template, change the list name and list of IP addresses.
{
:local listName "list_name" # cloudflare, telegram, meta_ips
:local addrs {
"192.168.1.10";
"192.168.1.20";
"10.0.0.0/24"
}
:foreach a in=$addrs do={/ip firewall address-list add list=$listName address=$a}
}
Content type
Image
Digest
sha256:6cba0a869…
Size
27.7 MB
Last updated
2 days ago
docker pull anvarsoft/mikrotik_mihomo-webui