侧边栏壁纸
博主头像
ZDREAM - Thassarian 的个人博客

对抗变化的方法唯有拥抱变化。

  • 累计撰写 35 篇文章
  • 累计创建 3 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

Linux中的科学上网与代理管理

Thassarian
2024-05-04 / 0 评论 / 0 点赞 / 29 阅读 / 0 字

Mihomo+MetaCubaXB实现Linux上科学上网

前端使用MetaCubeXD

后端使用mihomo

文件位置 -d 配置文件位置

/usr/bin/mihomo -d /etc/mihomo

更新配置文件:

/etc/mihomo/config.yaml

mixed-port: 7890

allow-lan: true

bind-address: '*'

mode: rule

log-level: info

external-controller: '0.0.0.0:9092'  #允许远程管理

secret: 'xxxxxxxxxxx'

dns:

    enable: true

    ipv6: false

    default-nameserver: [223.5.5.5, 119.29.29.29]

    enhanced-mode: fake-ip

    fake-ip-range: 198.18.0.1/16

    use-hosts: true

    nameserver: ['https://doh.pub/dns-query', 'https://dns.alidns.com/dns-query']

    fallback: ['https://doh.dns.sb/dns-query', 'https://dns.cloudflare.com/dns-query', 'https://dns.twnic.tw/dns->

    fallback-filter: { geoip: true, ipcidr: [240.0.0.0/4, 0.0.0.0/32] }

proxies:

查看状态

systemctl status mihomo.service

1776174689923.jpg

重启

systemctl restart mihomo.service

全局代理配置

/etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

http_proxy="[http://127.0.0.1:7890](https://www.google.com/url?sa=E&q=http%3A%2F%2F127.0.0.1%3A7890)"

https_proxy="[http://127.0.0.1:7890](https://www.google.com/url?sa=E&q=http%3A%2F%2F127.0.0.1%3A7890)"

no_proxy="localhost,127.0.0.1,::1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,.local"

1776174764372.png

0

评论区