MetaCubeX / ClashX.Meta

GNU Affero General Public License v3.0
2.99k stars 392 forks source link

[BUG] mac上Tun模式做透明网关,"局域网连接"功能无效 #84

Open smilingpoplar opened 4 months ago

smilingpoplar commented 4 months ago

问题描述 / Describe the bug

以前用ClashX Pro,开启TUN和局域网连接就能把mac作为透明网关,ClashX.Meta无法达成。 用sysctl net.inet.ip.forwarding查看,输出net.inet.ip.forwarding: 0,说明ip转发功能未打开。 还需手动运行sudo sysctl -w net.inet.ip.forwarding=1

手动打开ip转发在mac重启后也失效,要在重启后也生效还需使用LaunchDaemon。 看下ClashX Pro,grep -r 'net.inet.ip.forwarding=1' /Applications/ClashX\ Pro.app,输出

grep: /Applications/ClashX Pro.app/Contents/Library/LaunchServices/com.west2online.ClashXPro.ProxyConfigHelper: binary file matches

grep -r 'net.inet.ip.forwarding=1' /Applications/ClashX\ Meta.app,输出为空。

复现步骤 / To Reproduce

在mac的ClashX.Meta打开TUN和局域网连接,将手机wifi的路由地址和DNS地址设为电脑ip,无法上网。

操作系统 / OS

MacOS 14.5

eunrui commented 4 months ago

遇到了同样的问题allow-lan没用

tamia6 commented 2 months ago

[TCP] dial DIRECT (match RuleSet/icloud) 127.0.0.1:52034(AddressBookSourceSync) --> p224-contacts.icloud.com:443 error: dns resolve failed: lookup p224-contacts.icloud.com on 192.168.2.1:53: no such host