Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

网络连接 #3

Closed
BobDLA opened this issue Mar 13, 2023 · 5 comments
Closed

网络连接 #3

BobDLA opened this issue Mar 13, 2023 · 5 comments

Comments

@BobDLA
Copy link

BobDLA commented Mar 13, 2023

我使用chislash时有些网络访问的不熟悉的问题,向您请教下:
测试步骤如下:
在一台ubuntu16.04上,测试 命令行wget及 chrome浏览器可正常打开www.baidu.com,

chislash 启动:
docker run --name chislash
--network="host"
--privileged
--rm -it
-e SUBSCR_URLS=xxxx
-v $HOME/.config/chislash:/etc/clash
-v /dev:/dev
-v /lib/modules:/lib/modules
-e REMOTE_CONV_RULE=""
chisbread/chislash:latest

  1. docker 运行后 宿主机的wget www.baidu.com正常访问。

  2. 运行chrome
    但是,chrome打不开www.baidu.com, 不知道为什么会这样... 是否需要特殊设置呢?

  3. 启动另一个docker container
    docker run -it --rm --name chislash_test --entrypoint=/bin/bash --privileged -v /dev:/dev -v /lib/modules:/lib/modules --net=host chisbread/chislash -c "wget www.baidu.com"
    Resolving www.baidu.com (www.baidu.com)... 39.156.66.18, 39.156.66.14
    Connecting to www.baidu.com (www.baidu.com)|39.156.66.18|:80...
    也得不到网页数据.

  4. docker stop chislash
    chislash_test, chrome网络都正常。

  5. 在另一台机器上出现过 docker 如果启动的时候不是--net=host , container就无法访问网络。

不太理解是哪部分出问题了,是路由规则还是哪出了问题?

@ChisBread
Copy link
Owner

chislash会通过修改路由表实现透明代理(stop时自动恢复)和DNS劫持
我猜测是路由表的问题,具体原因可能得等我找时间复现一下
在这之前如果使用时有异常,可以使用非透明代理模式

修改路由表之后考虑废弃了,下次更新会带来更稳定的透明代理体验

@BobDLA
Copy link
Author

BobDLA commented Mar 13, 2023

chislash会通过修改路由表实现透明代理(stop时自动恢复)和DNS劫持 我猜测是路由表的问题,具体原因可能得等我找时间复现一下 在这之前如果使用时有异常,可以使用非透明代理模式

修改路由表之后考虑废弃了,下次更新会带来更稳定的透明代理体验

感谢回复,刚我又仔细看了看日志和proxy设置.
发现
[chislash log] 04:23:11 ERR [Inbound] start failed error=operation not permitted addr=:7892 type=TProxy
应该是TPROXY出问题了
本机的lsmod | grep TPROXY
xt_TPROXY 20480 0
nf_defrag_ipv6 20480 2 nf_conntrack_ipv6,xt_TPROXY
nf_defrag_ipv4 16384 2 nf_conntrack_ipv4,xt_TPROXY
x_tables 40960 12 xt_conntrack,iptable_filter,nft_compat,xt_tcpudp,ipt_MASQUERADE,xt_addrtype,xt_nat,xt_owner,xt_TPROXY,ip_tables,xt_REDIRECT,xt_mark

同时本机的env里有http_proxy=7890
所以,估计是宿主机wget走的普通代理, docker环境下没有这个代理,所以没生效。

我这环境有点不太对劲,我先再剥离下问题的,再找您帮忙看看。多谢。

@monkeybape
Copy link

感谢大佬的整合,用下来感觉很不错,也遇到一些小问题:
1.默认生成的config.yaml中redir-host现在被官方废弃了,建议换成TUN或者Fake-ip。
2.第一次启动的时候,前端需要开一遍fq才能运行起来,不然抓取cache一直失败。

@ChisBread
Copy link
Owner

感谢大佬的整合,用下来感觉很不错,也遇到一些小问题: 1.默认生成的config.yaml中redir-host现在被官方废弃了,建议换成TUN或者Fake-ip。 2.第一次启动的时候,前端需要开一遍fq才能运行起来,不然抓取cache一直失败。

嗯嗯,等我有时间了会大改一次,重新实现一些功能

@BobDLA
Copy link
Author

BobDLA commented May 26, 2023

最近一直稳定运行,挺好。

@BobDLA BobDLA closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants