我想处理用户空间中的 ip 片段,并且我使用 iptables NF_QUEUE 将数据包定向到用户空间。
问题是 IPv4 数据包总是被重新组装并作为一个数据包而不是单个片段进行传递。对于 IPv6,片段按其应有的方式传递。
我认为 conntracker 可能会导致它并在raw
iptables 表中禁用它,但事实证明数据包在到达原始表时已经重新组装:
# iptables -t raw -nvL
Chain PREROUTING (policy ACCEPT 58 packets, 62981 bytes)
pkts bytes target prot opt in out source destination
1 30028 CT all -- * * 0.0.0.0/0 10.0.0.0/24 NOTRACK
Run Code Online (Sandbox Code Playgroud)
这是通过 IPv4 发送 30000 字节 UDP 数据包时的情况。IPv6对应的:
# ip6tables -t raw -nvL
Chain PREROUTING (policy ACCEPT 46 packets, 62304 bytes)
pkts bytes target prot opt in out source destination
21 31016 CT …
Run Code Online (Sandbox Code Playgroud)