Replies: 5 comments 2 replies
-
I’m not sure why you have added the rule -A XRAY -d 192.168.0.0/16 -p tcp -m tcp ! --dport 53 -j RETURN in your XRAY chain. This rule seems to exclude all TCP packets that are not for port 53 from being redirected to xray. This means that any TCP traffic that is not DNS will bypass xray and go directly to the destination. Is this what you intended? If not, you may want to remove this rule or change it to match only specific ports or addresses that you want to exclude. |
Beta Was this translation helpful? Give feedback.
-
One way is to modify the hosts file on your Windows computer and add a line like this: 192.168.0.x www.msftconnecttest.com where 192.168.0.x is the IP address of your Linux gateway. This will make your Windows computer send the request to your Linux gateway instead of the real website. Then, on your Linux gateway, you need to create a file named connecttest.txt in the /var/www/html directory and write Microsoft Connect Test in it. This will make your Linux gateway return the expected value to your Windows computer and make it think that the connection is successful. Another way is to modify the config.json file on your Linux gateway and add a rule in the routing section to bypass the proxy for www.msftconnecttest.com. For example, you can add something like this: { “type”: “field”, “domain”: [“www.msftconnecttest.com”], “outboundTag”: “direct” }. This will make your Linux gateway send the request to the real website without using xray and get the expected value back. A third way is to disable the active probing feature on your Windows computer by setting the registry value of EnableActiveProbing to 0. You can follow this guide to do that: https://www.thewindowsclub.com/disable-active-probing-in-windows-10. This will make your Windows computer stop checking www.msftconnecttest.com/connecttest.txt and show the correct connection status. |
Beta Was this translation helpful? Give feedback.
-
神奇的事情发生了,什么都没做,我在电脑前发现Listary不工作(怀疑是因为windows判断未联网的原因),卸载了listary,从task manager里kill掉Liistary进程,然后重装listary。这时,神奇的事情发生了,wifi连接的图标突然正常了。我重启windows,仍然是正常联网的图标,listary也开始工作了。而且把 |
Beta Was this translation helpful? Give feedback.
-
今天早上开机后,又恢复到小地球状态了。昨晚显示连通的时候,我试了用windows通过透明代理访问www.msftconnecttest.com/connecttest.txt,仍然返回空回复,但是windows显示网络是联通的。而且我重启了几次,都是联通状态。看来windows的判断联通机制还有别的要素,现在看起来跟运营商有关系。但是如果不开透明代理,是能够显示联通的。无法解释啊! |
Beta Was this translation helpful? Give feedback.
-
找到原因了,是我的config.json写得有问题。 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
最近回国,又需要使用梯子了。两年前弄过透明代理,效果挺好,这次把以前的配置文件找出来,本以为很简单,没想到折腾了3天才弄好。遇到几个以前没遇到过的问题,不知道是不是因为linux从ubuntu 21.04升级到22.04造成的不一样。
sudo ip route add default via 192.168.0.1
,2年前弄的时候好像没遇到这个问题。sudo iptables -t nat -I POSTROUTING -j MASQUERADE
,否则wifi连接的电脑无法上网。找到这个问题花了好长时间,2年前弄的时候绝对没有遇到过。网上查到这是主路由默认的net.bridge.bridge-nf-call-iptables = 1
与旁路由模式不兼容造成的,但问题是我没有更换主路由啊。而且同一型号的另一主路由不加这条命令wifi也能上网。这个问题我没有搞懂,不知有没有大神来解惑。现在遇到没有解决的问题是,当主路由的DHCP指向Linux网关时,局域网内的windows电脑的wifi连接全部显示为小地球,但实际上不管墙内墙外都是能访问的,Linux、Mac电脑,android、ios设备都没有这个问题。
查了windows判断连网成功的机制,是访问www.msftconnecttest.com/connecttest.txt,如果返回的值与注册表里的ActiveWebProbeContent的值一致,则认为联网成功。不开透明代理的情况下,我的windows电脑访问这个文件,返回的是Microsoft Connect Test,但是Linux电脑返回的是空。所以透明代理以后,windows访问从linux网关发出,返回值也就是空,所以导致windows认为联接不成功。不知道有没有办法解决?
我的config.json和iptalbes-rules设置如下:
Beta Was this translation helpful? Give feedback.
All reactions