-
Notifications
You must be signed in to change notification settings - Fork 433
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
执行 nft list ruleset 报警告 #282
Comments
提示很明显了,安装缺失的 iptables 内核模块。Google 下有解决方案的。 |
另外,在使用 iptables-nft 后端时,不要执行任何 nft 指令(正如给出的警告所说)。 像往常一样,使用 iptables、ip6tables 即可,内核中将自动使用 nftables 作为后端。 |
另外,执行 ss-tproxy restart 时是否存在任何报错? |
检查了一下已加载内核模块,所有报错相关的模块都以加载:
我尝试重启下系统 |
部分运行起来了,目前仅本机的 ipv4 能走透明代理,本机 ipv6、局域网内其他主机 ipv6 暂时没有走代码。并且局域网内的 ipv4 无法工作了。 |
先排除 nft 规则的影响,在 ss-tproxy start 之前,nft list ruleset 最好是空的。 |
但是部署到路由器上的的话,没法保证 ss-tproxy start 前,nft list ruleset 为空呀,只能看看啥原因了 |
pre_start 里面执行 |
额,那网关的规则都搞没了呀,虽然能保证 nft 为空,但可能路由器的功能会异常吧 |
看起来 看起来这个报错是因为这个:https://forum.kaspersky.com/topic/nft-utility-errors-xt-target-tproxy-not-found-caused-by-wtpntp-task-kes-for-linux-37528/ |
ipv4 内网访问搞定了,需要放行 fwmark 等于 0x2333 的包。从 log 看到,0x2333 的包被默认丢掉了。 |
加了这几行 log,然后测试 ipv6(内网),命令
log 中,没有任何 matched 的 log,很奇怪。请问可能是什么原因呢? 规则:
|
nft list ruleset 看看全部规则? 建议使用 raw 表的 -j TRACE 看日志,比手动加 LOG 更方便一些。
确实很奇怪,中间也没有其他规则干扰,难道是 ipv6 的 connmark 模块有问题? |
有点像 ipv6 的 connmark set 0x2333 没有生效 |
TRACE 需要如何加规则?我用命令 |
你测试的 本机代理 还是 局域网代理 ? 我看 ipv4 已经搞定了(本机、局域网) 先以 tcp 2001:4860:4860::8888 为测试用例,避免 log 过多。 ip6tables -t raw -I OUTPUT -p tcp -d 2001:4860:4860::8888 -j TRACE
ip6tables -t raw -I OUTPUT -p tcp -s 2001:4860:4860::8888 -j TRACE
ip6tables -t raw -I PREROUTING -p tcp -s 2001:4860:4860::8888 -j TRACE
ip6tables -t raw -I PREROUTING -p tcp -d 2001:4860:4860::8888 -j TRACE 然后本机执行 |
测试的 ipv6 局域网代理,本地 ipv6 代理也不工作。均走的直连。 |
好像是哈,切换下 group 身份, |
打印的 log 如下,没有观察到 TRACE 的 log,难道是 VyOS 有问题?
规则列表如下:
|
你这个内核怕是有点问题,第一次见这种情况。 会不会是 ipv6 的 conntrack 内核模块未加载? |
nft 规则列表如下,移除了隐私相关以及 ipv4 规则。
|
有可能,还需要排除 VyOS 本身的问题。 |
|
执行结果
|
看规则是没有问题的,ss-tproxy 中的 iptables 和 ip6tables 代码是复用的(同一个函数)。 根据上面一系列反馈,核心问题还是 ip6 的 connmark set 未生效(不知道是这个模块问题还是内核配置少了什么)。 |
IPv6 代理失效(connmark set 没有工作)有没有可能是流量被硬件 offload 了? |
重装了一下 VyOS,重新做了所有配置,新增了 IPv6 的防火墙规则,目前本地及内网设备的 IPv6 和 IPv4 代理均已正常工作。 还需要确认之前 IPv6 代理不能工作的原因,以避免以后 IPv6 代理失效。 |
执行
nft
看到如下报错。但执行iptables
和ip6tables
没有报错,是正常的吗?命令如下:
sudo nft list ruleset 1>/dev/null sudo iptables -nvL -t nat sudo iptables -nvL -t mangle sudo ip6tables -nvL -t nat sudo ip6tables -nvL -t mangle
环境:
OS: VyOS 1.5-rolling-202409080006
容器:Alpine Linux 3.20.3
ss-tproxy 版本:ss-tproxy v4.8.3 (2024-07-24)
The text was updated successfully, but these errors were encountered: