从 nftables 0.9.7 开始,我知道我可以像这样使用 inet 和 ingress hooks:
import matplotlib.pyplot as plt
import numpy as np
# generate some random test data
all_data = [np.random.normal(0, std, 100) for std in range(6, 10)]
# plot violin plot
plt.violinplot(all_data,
showmeans=False,
showmedians=True)
plt.title('violin plot')
这与(或我认为如此)相同:
nft create chain inet mark-rules ttt { type filter hook ingress device "eth0" priority 0\; policy accept\;}
和规则是一样的:
nft create chain netdev dev ttt { type filter hook ingress device "eth0" priority 0\; policy accept\;}
和 inet 中的输出类似(使用 netdev 可以):
nft add rule inet mark-rules ttt fwd to ifb0
ps。 Linux 5.10.27 nftables v0.9.8 (E.D.S.)
我还有一个关于优先级的问题: 期望相同的链,但具有: 0 表示 netdev,1 表示带有数据包元标记的 inet 钩子。 据我了解,他们必须按顺序行事,但事实并非如此。