Linux clash 将已有 ip 的网络接口的 inbound 流量, outbound 到指定的 socks5,可行吗?

20次阅读

共计 595 个字符,预计需要花费 2 分钟才能阅读完成。

比如,
socks5 代理是 192.168.89.22:8080 (clash outbound 目标)
ens33:192.168.33.100/24
ens192:192.168.178.254/24 (clash inbound)

机器的 route:
route add -host 192.168.89.22 netmask 255.255.255.255 gw 192.168.33.1

机器上有个 ens33 的网络接口,config.yaml 的配置,想让它的 inbound 流量 (ens192) 都往一个 socks5 代理走,实现“中转代理”功能
以前没做过 tun 模式,看了一些科普和例子,草草做了个配置:

tun:
  enable: true
  stack: System
  device: mytun
  auto-route: true
  auto-detect-interface: true
  dns-hijack:
    - any:53
    - tcp://any:53

proxies:
  - name: myproxy
    type: socks5
    server: 192.168.89.22
    port: 8080

rules:
  - IP-CIDR,0.0.0.0/0,myproxy

貌似是 clash 要启动 tun 模式,然后把 ens192 接口的流量,通过 iptables, 或者写静态路由转发去 mytun 接口上?
clash 不可以“直接接管”一个网络接口的,不知道理解的对不对,又好像折腾错,走错路了?

正文完
 0