clash for windows tun模式用法 配置

说明:

1.启动TUN模式的充要条件:i.安装并开启服务模式(地球图标变绿色);ii.wintun.dll导入配置文件目录(64位系统就导入64位的dll),重启并打开TUN模式开关(绿了);iii.混合模式YAM配置正确(详细配置如下)且开关打开;iv.TAP网络适配器如果安装过,则必须卸载掉(TUN, TAP二者不能共存),卸载后会看到网络连接那只有Clash的电脑图标,TAP模式的虚拟网络cwf-tapxxx图标消失

Clash配置TUN模式和TAP模式

 

 

 Clash配置TUN模式和TAP模式

 

 

 其他说明:

现在存在一个Clash的网卡是在活动状态,如果你之前安装了TUN模式,需要先卸载TUN模式后,才能安装TAP模式。卸载TUN,在常规中点击服务模式,然后点击卸载就可以了,卸载后,服务模式后面的地球图标变成灰色,就表示卸载成功了。

TAP模式安装成功后需要启动TAP模式。启动TAP模式和之前启动TUN模式一样,都需要重新编辑YAML。

 

TAP模式 Mixin 混合配置 YAML:
mixin:
dns:
enable: true
enhanced-mode: redir-host
listen: :53
nameserver:
- https://doh.dns.sb/dns-query
- https://dns.adguard.com/dns-query
- https://cdn-doh.ssnm.xyz/dns-query
- 119.29.29.29 #腾讯
- 223.5.5.5 #阿里


TUN 模式 YAML配置(如下配置1,2亲测都有效!)
配置1:
mixin: # object
dns:
enable: true
ipv6: false
enhanced-mode: redir-host #fake-ip
fake-ip-range: 198.18.0.1/16
fake-ip-filter:
- '*.lan'
- 'localhost.ptlogin2.qq.com'
- 'dns.msftncsi.com'
- 'www.msftncsi.com'
- 'www.msftconnecttest.com'
nameserver:
- 8.8.8.8
- 119.29.29.29
- 114.114.114.114
- 223.5.5.5
tun:
enable: true
stack: gvisor
dns-hijack:
- 198.18.0.2:53
auto-route: true
auto-detect-interface: true

 

配置2:
mixin:
hosts:
'mtalk.google.com': 108.177.125.188
'services.googleapis.cn': 74.125.203.94
'raw.githubusercontent.com': 151.101.76.133
dns:
enable: true
default-nameserver:
- 223.5.5.5
- 1.0.0.1
ipv6: false
enhanced-mode: redir-host #fake-ip
nameserver:
- https://dns.rubyfish.cn/dns-query
- https://223.5.5.5/dns-query
- https://dns.pub/dns-query
fallback:
- https://1.0.0.1/dns-query
- https://public.dns.iij.jp/dns-query
- https://dns.twnic.tw/dns-query
fallback-filter:
geoip: true
ipcidr:
- 240.0.0.0/4
- 0.0.0.0/32
- 127.0.0.1/32
domain:
- +.google.com
- +.facebook.com
- +.twitter.com
- +.youtube.com
- +.xn--ngstr-lra8j.com
- +.google.cn
- +.googleapis.cn
- +.gvt1.com
tun:
enable: true
stack: gvisor
dns-hijack:
- 198.18.0.2:53
auto-route: true
auto-detect-interface: true # 自动检测出口网卡


参考:
Clash for Windows教程:配置TUN/TAP虚拟网卡,订阅持续更新
https://uzbox.com/tech/clash-atp.html

clash TUN模式
https://www.cnblogs.com/tomyyyyy/p/15513066.html

相关文章: