mikrotik ros 配置paopaodns&&mihomo

推广广告

图片[1]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观前言

ros 路由器现在也支持了docker容器,所以我们可以用mihomo配置tun模式,搭配DNS进行分流做到一些网络需求。

本文章借鉴了此论坛的部分内容以及docker容器www.right.com.cn

此文章只是记录我的使用记录,大家可以借鉴。

教程

本文章使用的机器型号是RB5009,使用winbox进行配置,此教程并没有使用命令去配置。

首先我们先去确认自己的ROS系统内有没有docker,如果没有可以去官方组件包去下载,地址为:MikroTik Routers and Wireless – Software

按照你的机器架构选择对应的Extra packages包下载然后使用winbox拖入到winbox的files重启路由器即可安装容器。

图片[2]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观在开始前,我们要先去创建两个虚拟网卡VETH。

图片[3]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观重复操作创建两个VETH,教程中创建了两个为mihomo和paopaodns。

图片[4]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观配置文件夹appdata

图片[5]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观

在拉镜像之前,我们需要对paopaodns和mihomo增加一些变量。

图片[6]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观反复多次操作,依次增加变量

CUSTOM_FORWARD
CNAUTO
CNFALL
AUTO_FORWARD
network
UPDATE
EXPIRED_FLUSH
CN_TRACKER
IPV6
USE_MARK_DATA
USE_HOSTS
TZ

这里注意第一个变量CUSTOM_FORWARD这个变量的IP要写mihomo的IP,其他变量值照抄就行。

图片[7]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观dns的变量,是给paopaodns的,然后在添加一个mihomi的变量给mihomo的容器。

图片[8]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观创建一个文件路径挂在,给paopaodns的配置文件持久化。

图片[9]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观没啥特殊的,直接照抄即可。

配置容器:

paopaodns

图片[10]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观照抄就行

mihomi

图片[11]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观容器启动后,paopaodns是不需要在陪配置了,但是mihomo我们需要把配置文件导入进去,ros有ftp功能,随便找个ftp工具传输文件,这里我使用的winscp,教程中的容器的配置文件在/root/.config/mihomo,宿主机的路径是/docker/moho/root/.config/mihomo大家别弄错路径。

图片[12]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观这里我提供一个基础文件,并不会包含其他节点个规则,只是一个基础的全局tun。

mixed-port: 7890
port: 3333
allow-lan: true
log-level: info
mode: global
external-controller: 0.0.0.0:9090
# secret: '123456'
ipv6: false


profile:
  store-fake-ip: true
  store-selected: true
  
dns:
  enable: true
  listen: 0.0.0.0:53
  ipv6: false
  enhanced-mode: fake-ip
  fake-ip-range: 7.0.0.0/8
  fake-ip-filter:
    - '*.taobao.com'
    - '*.jd.com'

tun:
  enable: true
  stack: system 
  auto-route: true
  auto-detect-interface: true
  dns-hijack:
    - any:53
    - tcp://any:53
    
proxies:
proxy-groups:
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Rocket.png
  name: 手动切换
  proxies:
  - 自动选择
  - 故障转移
  type: select
  use:
  - All
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Auto.png
  interval: 300
  name: 自动选择
  proxies:
  type: url-test
  url: "http://www.gstatic.com/generate_204"
  use:
  - All
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Bypass.png
  interval: 300
  name: 故障转移
  proxies:
  - 自动选择
  type: fallback
  url: 'http://www.gstatic.com/generate_204'
  use:
  - All
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Global.png
  name: 国外网站
  proxies:
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  - 韩国节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/China_Map.png
  name: ChatGPT
  proxies:
  - DIRECT
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/China_Map.png
  name: 国内网站
  proxies:
  - DIRECT
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/YouTube.png
  name: YouTube
  proxies:
  - 手动切换
  - 自动选择
  - 故障转移
  - 狮城节点
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  - 韩国节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Netflix.png
  name: NETFLIX
  proxies:
  - 狮城节点
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  - 韩国节点
  type: select
- icon: https://raw.githubusercontent.com/Orz-3/mini/master/Color/DisneyPlus.png
  name: Disney+
  proxies:
  - 手动切换
  - 自动选择
  - 狮城节点
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  - 韩国节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Apple.png
  name: 苹果服务
  proxies:
  - DIRECT
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Spotify.png
  name: Spotify
  proxies:
  - 手动切换
  - 韩国节点
  - 香港节点
  - 日本节点
  - 台湾节点
  - 美国节点
  - 狮城节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/HBO_1.png
  name: HBO
  proxies:
  - 手动切换
  - 狮城节点
  - 香港节点
  - 韩国节点
  - 美国节点
  - 台湾节点
  - 日本节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Prime_Video_1.png
  name: AmazonPrimeVideo
  proxies:
  - 手动切换
  - 狮城节点
  - 美国节点
  - 台湾节点
  - 日本节点
  - 香港节点
  - 韩国节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Telegram_X.png
  name: Telegram
  proxies:
  - 手动切换
  - 狮城节点
  - 韩国节点
  - 香港节点
  - 日本节点
  - 台湾节点
  - 美国节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Microsoft.png
  name: 微软服务
  proxies:
  - DIRECT
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Netease_Music.png
  name: 网易音乐
  proxies:
  - DIRECT
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/bilibili_3.png
  name: 哔哩哔哩
  proxies:
  - DIRECT
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Game.png
  name: 游戏平台
  proxies:
  - DIRECT
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Advertising.png
  name: AdBlock
  proxies:
  - REJECT
  type: select
- icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Final.png
  name: 漏网之鱼
  proxies:
  - DIRECT
  - 手动切换
  - 自动选择
  - 故障转移
  - 香港节点
  - 日本节点
  - 美国节点
  - 台湾节点
  type: select
- filter: "(?=.*(港|\U0001F1ED\U0001F1F0|HK|(?i)Hong))^((?!(台|日|韩|新|美)).)*$"
  icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Hong_Kong.png
  name: 香港节点
  type: select
  use:
  - All
- filter: "(?=.*(日|\U0001F1EF\U0001F1F5|JP|(?i)Japan))^((?!(港|台|韩|新|美)).)*$"
  icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Japan.png
  name: 日本节点
  type: select
  use:
  - All
- filter: "(?=.*(台|\U0001F1E8\U0001F1F3|\U0001F1F9\U0001F1FC|TW|(?i)Taiwan))^((?!(港|日|韩|新|美)).)*$"
  icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Taiwan.png
  name: 台湾节点
  type: select
  use:
  - All
- filter: "(?=.*(美|\U0001F1FA\U0001F1F8|US|(?i)States|American))^((?!(港|台|日|韩|新)).)*$"
  icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/United_States.png
  name: 美国节点
  type: select
  use:
  - All
- filter: 新加坡
  icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/SG.png
  name: 狮城节点
  proxies: []
  type: select
  use:
  - All
- filter: 韩国
  icon: https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/Color/Korea.png
  name: 韩国节点
  proxies: []
  type: select
  use:
  - All
proxy-providers:
  All:
    health-check:
      enable: true
      interval: 600
      url: http://www.gstatic.com/generate_204
    interval: 86400
    path: ./all.yaml
    type: http
    url: ""
rule-providers:
  Adblock-Domain:
    behavior: domain
    interval: 86400
    path: ./ruleset/AdDomain.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/AdvertisingLite/AdvertisingLite_Domain.yaml"
  AmazonPrimeVideo:
    behavior: classical
    interval: 86400
    path: ./ruleset/AmazonPrimeVideo.yaml
    type: http
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/AmazonPrimeVideo/AmazonPrimeVideo.yaml
  Apple:
    behavior: classical
    interval: 86400
    path: ./ruleset/Apple.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Apple/Apple.yaml"
  BiliBili:
    behavior: classical
    interval: 86400
    path: ./ruleset/BiliBili.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/BiliBili/BiliBili.yaml"
  China:
    behavior: classical
    interval: 86400
    path: ./ruleset/China.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/China/China.yaml"
  Disney:
    behavior: classical
    interval: 86400
    path: ./ruleset/Disney.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Disney/Disney.yaml"
  Game:
    behavior: classical
    interval: 86400
    path: ./ruleset/Game.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Game/Game.yaml"
  Global:
    behavior: domain
    interval: 86400
    path: ./ruleset/Global-Domain.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/Loyalsoldier/clash-rules/release/proxy.txt"
  HBO:
    behavior: classical
    interval: 86400
    path: ./ruleset/HBO.yaml
    type: http
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/HBO/HBO.yaml
  Lan:
    behavior: classical
    interval: 86400
    path: ./ruleset/lan.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Lan/Lan.yaml"
  Microsoft:
    behavior: classical
    interval: 86400
    path: ./ruleset/Microsoft.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Microsoft/Microsoft.yaml"
  NetEaseMusic:
    behavior: classical
    interval: 86400
    path: ./ruleset/NetEaseMusic.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/NetEaseMusic/NetEaseMusic.yaml"
  Netflix:
    behavior: classical
    interval: 86400
    path: ./ruleset/Netflix.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Netflix/Netflix.yaml"
  PackageName:
    behavior: classical
    interval: 86400
    path: ./ruleset/PackageName.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/Infatuation-Fei/rule/main/Clash/Rule/Android_Package_Name_Proxy.yaml"
  Spotify:
    behavior: classical
    interval: 86400
    path: ./ruleset/Spotify.yaml
    type: http
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Spotify/Spotify.yaml
  Telegram:
    behavior: classical
    interval: 86400
    path: ./ruleset/Telegram.yaml
    type: http
    url: https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/Telegram/Telegram.yaml
  YouTube:
    behavior: classical
    interval: 86400
    path: ./ruleset/YouTube.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/YouTube/YouTube.yaml"
  ChatGPT:
    behavior: classical
    interval: 86400
    path: ./ruleset/ChatGPT.yaml
    type: http
    url: "https://mirror.ghproxy.com/https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Clash/OpenAI/OpenAI.yaml"
rules:
- RULE-SET,AmazonPrimeVideo,AmazonPrimeVideo
- RULE-SET,HBO,HBO
- DOMAIN,www.asuswrt-merlin.net,手动切换
- RULE-SET,Telegram,Telegram
- RULE-SET,Spotify,Spotify
- RULE-SET,Adblock-Domain,AdBlock
- RULE-SET,YouTube,YouTube
- RULE-SET,Netflix,NETFLIX
- RULE-SET,ChatGPT,ChatGPT
- RULE-SET,Disney,Disney+
- RULE-SET,Apple,苹果服务
- RULE-SET,Microsoft,微软服务
- RULE-SET,NetEaseMusic,网易音乐
- RULE-SET,BiliBili,哔哩哔哩
- RULE-SET,Game,游戏平台
- RULE-SET,PackageName,国外网站
- RULE-SET,Global,国外网站
- RULE-SET,China,国内网站
- RULE-SET,Lan,DIRECT
- GEOIP,CN,国内网站
- MATCH,漏网之鱼
subscribe-url:

这只是个基础配置,需要增加你节点信息才可以使用,使用方法可以去看本站的UNRAID LXC 安装Clash.Meta-RSG-人生观的教程里面有配置文件使用方法,这里我就不多写了。

增加一个路由

图片[13]-mikrotik ros 配置paopaodns&&mihomo-RSG-人生观到此就可以测试是否可以使用了。

结尾

教程其实不复杂,如果你理解了他的逻辑,其实很简单如果使用有什么问题可以在下面留言或者去我参考的网站去查看。

推广广告
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    请登录后查看评论内容