流殃的博客

| Comments

tap模式

我这里首先放个clash截图
image-1651395037856
使用的tap模式,也就是通过一个网卡来代理所有流量了

需要注意的是记得开启alow lan

image-1651395073861

只需要在设置的网络中配置一下使用tap网卡就可以了
image-1651395155573
可以看到我用vagrant启动的virtual虚拟机已经可以走代理了
image-1651395207965

之前我好像是看网上说 tun模式是比tap模式要好的,回头我试试

在我可以成功使用tap模式之后,然后突然想要再次连接的时候,不知道为什么失效了,所以就又尝试了tun模式

tun模式

和上面一样,先上截图
image-1651552344737

配置文件

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
     macOS-auto-route: true
     macOS-auto-detect-interface: true # 自动检测出口网卡

成功验证

  1. 连接时候有tun标志
  2. 可以ping通国外地址
    image-1651552429400

image-1651552476946

Comments

评论