Sign inSign up

anvarsoft/mikrotik_mihomo

By anvarsoft

•Updated 6 days ago

Image
0

1.3K

anvarsoft/mikrotik_mihomo repository overview

Support for tun and tproxy incoming interface modes (tested only on arm64/tproxy/tun). The last two alpha versions are supported for rollback capabilities.

Mikrotik setup - https://help.mikrotik.com/docs/spaces/ROS/pages/84901929/Container⁠
Mihomo configuration - https://wiki.metacubex.one/en/config/⁠

Minimal starting configuration using fake-ip.
In the mikrotik terminal, run commands to create the mihomo configuration folder and a route for proxied resources.

/container mounts add dst=/root/.config/mihomo name=mihomo src=/config/mihomo
/ip route add comment="fake-ip to container" disabled=no distance=1 dst-address=198.18.0.0/15 gateway=172.17.0.2 routing-table=main scope=30 suppress-hw-offload=no target-scope=10

In the client network settings, the IP address of the mihomo container (in the example, 172.17.0.2) must be specified as the DNS server.

/ip dhcp-server network set [find] dns-server=172.17.0.2

Container envs: Key=TPROXY Value=true/false (defaults to "true") TProxy inbound (TCP+UDP) | arm64, RouterOS ≥ 7.21 (NFTables) | "false" | Redirect (TCP) + TUN (UDP) | arm and arm64, any RouterOS 7 |

Configuration mihomo (config.yaml):

mixed-port: 10810  #  Can be used to connect through a browser extension.
tproxy-port: 12345
redir-port: 12346 
allow-lan: true
 
log-level: warning
profile:
  store-selected: true
  store-fake-ip: true
ipv6: false
unified-delay: true

dns:
  enable: true
  listen: 0.0.0.0:53
  ipv6: false
  enhanced-mode: fake-ip
  respect-rules: false
  default-nameserver:
    - tls://1.1.1.1    
  proxy-server-nameserver:
    - tls://1.1.1.1
  nameserver:
    - https://dns.adguard-dns.com/dns-query
  fake-ip-range: 198.18.0.1/15
  fake-ip-filter-mode: whitelist
  fake-ip-filter:
    - "RULE-SET:quick-list" 
          
tun:
  enable: true  # specify "false" when selecting the envs: "TPROXY=true"
  stack: system
  device: Meta              
  auto-route: false         
  auto-redirect: false
  dns-hijack:
    - any:53 
    
proxies:
- name: vps1 
  --your data--  

proxy-groups:
  - name: Proxy    
    type: select
    proxies:
      - vps1      

rules:
  - RULE-SET,quick-list,Proxy  
  - MATCH,DIRECT

rule-providers:
  quick-list:
    type: inline
    behavior: domain
    payload:
      - "+.whoer.net"

Proxied resources are added to the quick-list:

payload:
  - "+.whoer.net"
  - "+.example.com"

and so on...

Tag summary

Content type

Image

Digest

sha256:2ca28f711…

Size

27.5 MB

Last updated

19 days ago

docker pull anvarsoft/mikrotik_mihomo