通过禁用TSO解决无法识别大pcap包的问题

使用TSO(TCP Segmentation Offload) 的网卡,可使一个tcp包携带超过1460大小的数据,导致suricata和wireshark识别不正确。
如果想suricata和wireshark正确的识别大长度的pcap包,需要禁用TSO
在Linux内核中的实现分别是 LSO (Large Send Offload) LRO (Large Receive Offload)
禁用的方法:

ethtool -K ens33 tso off
ethtool -K ens33 gro off
ethtool -K ens33 gso off

并在网卡配置里添加如下:

    offload-tx  off
    offload-sg  off
    offload-tso off
    offload-gso off
    offload-gro off

以我的为例:

root@debian10:~# cat /etc/network/interfaces
......
auto lo
iface lo inet loopback

# The primary network interface
auto ens33
iface ens33 inet dhcp
    offload-tx  off
    offload-sg  off
    offload-tso off
    offload-gso off
    offload-gro off
root@debian10:~#

在windows里禁用,参考

参考:
https://meet-unix.org/2017-02-19-tcp-lso.html
https://forum.suricata.io/t/cant-detect-amq-message/1203/4

Leave a Reply

Your email address will not be published. Required fields are marked *