curl https://d2.duckgogo.net/mihomo/mihomo-linux-amd64-v1.18.6.gz -o mihomo.gz
or
curl https://d2.duckgogo.net/mihomo/mihomo-linux-amd64-compatible-v1.18.6.gz -o mihomo.gz
curl https://d2.duckgogo.net/mihomo/mihomo-linux-arm64-v1.18.6.gz -o mihomo.gz
gzip -d mihomo.gz
chmod +x mihomo
中文引号“替换为英文引号
curl “
./mihomo -f config.yaml
使用以下命令将 Clash 二进制文件复制到 /usr/local/bin/
文件夹, 配置文件复制到 /etc/mihomo/
文件夹:
sudo cp mihomo /usr/local/bin/
sudo mkdir /etc/mihomo/
sudo cp config.yaml /etc/mihomo/
创建 systemd 配置文件 /etc/systemd/system/mihomo.service:
[Unit]
Description=mihomo Daemon, Another Clash Kernel.
After=network.target NetworkManager.service systemd-networkd.service iwd.service
[Service]
Type=simple
LimitNPROC=500
LimitNOFILE=1000000
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_TIME CAP_SYS_PTRACE CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SYS_TIME CAP_SYS_PTRACE CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE
Restart=always
ExecStartPre=/usr/bin/sleep 1s
ExecStart=/usr/local/bin/mihomo -d /etc/mihomo
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable mihomo
systemctl start mihomo
journalctl -u mihomo -o cat -f
启动成功的日志,可通过http://局域网ip:7890
或者socks5://局域网ip:7890
进行连接
time="2024-06-08T06:48:03.696007163Z" level=info msg="Initial configuration complete, total time: 8319ms"
time="2024-06-08T06:48:03.696814157Z" level=info msg="RESTful API listening at: [::]:9093"
time="2024-06-08T06:48:03.70328271Z" level=info msg="Sniffer is closed"
time="2024-06-08T06:48:03.703315451Z" level=info msg="Use tcp concurrent"
time="2024-06-08T06:48:03.703358798Z" level=info msg="NTP service start, sync system time is false"
time="2024-06-08T06:48:03.796040559Z" level=info msg="System clock is behind NTP time by 1.756498ms"
time="2024-06-08T06:48:03.796466775Z" level=info msg="Mixed(http+socks) proxy listening at: [::]:7890"
time="2024-06-08T06:48:03.80036619Z" level=info msg="Start initial Compatible provider Fallback-备用线路"
time="2024-06-08T06:48:03.800470254Z" level=info msg="Start initial Compatible provider Auto-自动择优"
time="2024-06-08T06:48:03.800589918Z" level=info msg="Start initial Compatible provider 在此组切换线路-SwitchNode"
time="2024-06-08T06:48:03.800944496Z" level=info msg="Start initial Compatible provider default"
bash <(curl -fsSL https://sing-box.app/deb-install.sh)
bash <(curl -fsSL https://sing-box.app/arch-install.sh)
中文引号“替换为英文引号
curl “
sing-box run -c config.json
todo