Closed ttys3 closed 3 years ago
could this be the reason ?
root in homenas in ~/nDPI/ndpi-netfilter on flow_info-3.2-centos8 [✘+?] took 12s
❯ make modules_install
make -C src modules_install
make[1]: Entering directory '/root/nDPI/ndpi-netfilter/src'
grep: /lib/modules/4.18.0-310.el8.x86_64/build/source/include/linux/skbuff.h: No such file or directory
make -C /lib/modules/4.18.0-310.el8.x86_64/build M=$PWD modules_install;
make[2]: Entering directory '/usr/src/kernels/4.18.0-310.el8.x86_64'
INSTALL /root/nDPI/ndpi-netfilter/src/xt_ndpi.ko
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
DEPMOD 4.18.0-310.el8.x86_64
make[2]: Leaving directory '/usr/src/kernels/4.18.0-310.el8.x86_64'
depmod -a;
make[1]: Leaving directory '/root/nDPI/ndpi-netfilter/src'
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: crypto/bio/bss_file.c:76 sign-file: certs/signing_key.pem: No such file or directory
I also found error under my ArchLinux:
Jun 17 03:01:44 wudeng kernel: posterrorxxx:IN= OUT=enp0s31f6 SRC=192.168.8.100 DST=xxx.237.xxx.6 LEN=48 TOS=0x00 PREC=0x20 TTL=64 ID=29274 PROTO=UDP SPT=42158 DPT=51413 LEN=28
Jun 17 03:01:44 wudeng kernel: posterrorxxx:IN= OUT=enp0s31f6 SRC=192.168.8.100 DST=xxx.237.xxx.6 LEN=240 TOS=0x00 PREC=0x20 TTL=64 ID=29275 PROTO=UDP SPT=42158 DPT=51413 LEN=220
actually, it is bittorrent protocol.
At main.c:160:
- SSL error:02001002:system library:fopen:No such file or directory: crypto/bio/bss_file.c:69
- SSL error:2006D080:BIO routines:BIO_new_file:no such file: crypto/bio/bss_file.c:76
sign-file: certs/signing_key.pem: No such file or directory
See https://wiki.gentoo.org/wiki/Signed_kernel_module_support
About "-m ndpi --error" Show the result of the command "grep . /sys/module/xt_ndpi/parameters/*"
grep . /sys/module/xt_ndpi/parameters/*
❯ grep . /sys/module/xt_ndpi/parameters/*
/sys/module/xt_ndpi/parameters/bt_gc_count:0
/sys/module/xt_ndpi/parameters/bt_hash_size:0
/sys/module/xt_ndpi/parameters/bt_hash_timeout:1200
/sys/module/xt_ndpi/parameters/bt_log_size:128
/sys/module/xt_ndpi/parameters/cached:684
/sys/module/xt_ndpi/parameters/c_last_ct_not:0
/sys/module/xt_ndpi/parameters/c_magic_not:343
/sys/module/xt_ndpi/parameters/c_skb_not:0
/sys/module/xt_ndpi/parameters/ct_confirm:11091
/sys/module/xt_ndpi/parameters/err_add_ndpi:0
/sys/module/xt_ndpi/parameters/err_alloc_flow:0
/sys/module/xt_ndpi/parameters/err_alloc_id:0
/sys/module/xt_ndpi/parameters/err_bad_tcp_udp:0
/sys/module/xt_ndpi/parameters/err_ip_frag_len:0
/sys/module/xt_ndpi/parameters/err_oversize:0
/sys/module/xt_ndpi/parameters/err_prot_err:0
/sys/module/xt_ndpi/parameters/err_prot_err1:0
/sys/module/xt_ndpi/parameters/err_skb_linear:0
/sys/module/xt_ndpi/parameters/flow_created:37
/sys/module/xt_ndpi/parameters/flow_deleted:6
/sys/module/xt_ndpi/parameters/flow_read_debug:0
/sys/module/xt_ndpi/parameters/id_num:33
/sys/module/xt_ndpi/parameters/ipv4:6578
/sys/module/xt_ndpi/parameters/ipv6:0
/sys/module/xt_ndpi/parameters/l4mismatch:0
/sys/module/xt_ndpi/parameters/l4mis_size:0
/sys/module/xt_ndpi/parameters/lib_trace:0
/sys/module/xt_ndpi/parameters/max_parsed_lines:0
/sys/module/xt_ndpi/parameters/max_unk_other:20
/sys/module/xt_ndpi/parameters/max_unk_tcp:20
/sys/module/xt_ndpi/parameters/max_unk_udp:20
/sys/module/xt_ndpi/parameters/mtu:48000
/sys/module/xt_ndpi/parameters/ndpi_enable_flow:0
/sys/module/xt_ndpi/parameters/ndpi_flow_limit:10000000
/sys/module/xt_ndpi/parameters/ndpi_match:6594
/sys/module/xt_ndpi/parameters/ndpi_size_flow_struct:2544
/sys/module/xt_ndpi/parameters/ndpi_size_hash_ip4p_node:32
/sys/module/xt_ndpi/parameters/ndpi_size_id_struct:256
/sys/module/xt_ndpi/parameters/ndpi_stun_cache:0
/sys/module/xt_ndpi/parameters/noncached:343
/sys/module/xt_ndpi/parameters/nonip:0
/sys/module/xt_ndpi/parameters/non_tcpudp:0
/sys/module/xt_ndpi/parameters/skb_lin:288
/sys/module/xt_ndpi/parameters/skb_seg:55
/sys/module/xt_ndpi/parameters/tls_buf_size:4
/sys/module/xt_ndpi/parameters/xt_debug:0
after hours:
❯ grep . /sys/module/xt_ndpi/parameters/*
/sys/module/xt_ndpi/parameters/bt_gc_count:0
/sys/module/xt_ndpi/parameters/bt_hash_size:0
/sys/module/xt_ndpi/parameters/bt_hash_timeout:1200
/sys/module/xt_ndpi/parameters/bt_log_size:128
/sys/module/xt_ndpi/parameters/cached:5475299
/sys/module/xt_ndpi/parameters/c_last_ct_not:0
/sys/module/xt_ndpi/parameters/c_magic_not:2782598
/sys/module/xt_ndpi/parameters/c_skb_not:0
/sys/module/xt_ndpi/parameters/ct_confirm:1931857
/sys/module/xt_ndpi/parameters/err_add_ndpi:0
/sys/module/xt_ndpi/parameters/err_alloc_flow:0
/sys/module/xt_ndpi/parameters/err_alloc_id:0
/sys/module/xt_ndpi/parameters/err_bad_tcp_udp:0
/sys/module/xt_ndpi/parameters/err_ip_frag_len:0
/sys/module/xt_ndpi/parameters/err_oversize:0
/sys/module/xt_ndpi/parameters/err_prot_err:0
/sys/module/xt_ndpi/parameters/err_prot_err1:0
/sys/module/xt_ndpi/parameters/err_skb_linear:0
/sys/module/xt_ndpi/parameters/flow_created:44522
/sys/module/xt_ndpi/parameters/flow_deleted:44413
/sys/module/xt_ndpi/parameters/flow_read_debug:0
/sys/module/xt_ndpi/parameters/id_num:88
/sys/module/xt_ndpi/parameters/ipv4:9223933
/sys/module/xt_ndpi/parameters/ipv6:0
/sys/module/xt_ndpi/parameters/l4mismatch:427
/sys/module/xt_ndpi/parameters/l4mis_size:37996
/sys/module/xt_ndpi/parameters/lib_trace:0
/sys/module/xt_ndpi/parameters/max_parsed_lines:0
/sys/module/xt_ndpi/parameters/max_unk_other:20
/sys/module/xt_ndpi/parameters/max_unk_tcp:20
/sys/module/xt_ndpi/parameters/max_unk_udp:20
/sys/module/xt_ndpi/parameters/mtu:48000
/sys/module/xt_ndpi/parameters/ndpi_enable_flow:0
/sys/module/xt_ndpi/parameters/ndpi_flow_limit:10000000
/sys/module/xt_ndpi/parameters/ndpi_match:9223979
/sys/module/xt_ndpi/parameters/ndpi_size_flow_struct:2544
/sys/module/xt_ndpi/parameters/ndpi_size_hash_ip4p_node:32
/sys/module/xt_ndpi/parameters/ndpi_size_id_struct:256
/sys/module/xt_ndpi/parameters/ndpi_stun_cache:0
/sys/module/xt_ndpi/parameters/noncached:2260192
/sys/module/xt_ndpi/parameters/nonip:0
/sys/module/xt_ndpi/parameters/non_tcpudp:912
/sys/module/xt_ndpi/parameters/skb_lin:2177856
/sys/module/xt_ndpi/parameters/skb_seg:82339
/sys/module/xt_ndpi/parameters/tls_buf_size:4
/sys/module/xt_ndpi/parameters/xt_debug:0
/sys/module/xt_ndpi/parameters/ct_confirm:1931857
This is the cause of the error problem.
If "conntrack -L" does not show connections, then you need to add a rule that checks the state of connections (for example, "iptables .... -m state INVALID"). In what chain this rule will be - it is absolutely unimportant. Starting with some versions of kernels, conntrack is enabled only if there are certain rules: checking the state of the connection and NAT.
If "conntrack -L" shows connections, then the problem is with the connlabel. The location where problems with conntrack are found can be found by the code "COUNTER (ndpip31)". This is your kernel-mutated problem. A significant change to the connlabel kernel code was in kernel 4.8.0 Find the lines with "net-> ct.label" and try to figure out which version your kernel belongs to.
I test conntrack -L
it does show connections. sot the problem is with the connlabel
I cannot reproduce your error.
root@localhost ~]# uname -r
4.18.0-305.7.1.el8_4.x86_64
iptables -t mangle -F
iptables -F
iptables -t mangle -A PREROUTING -m ndpi --all
iptables -t mangle -A PREROUTING -m ndpi --error
iptables -t mangle -A OUTPUT -m ndpi --all
iptables -t mangle -A OUTPUT -m ndpi --error
iptables -A INPUT -m ndpi --proto ssh
iptables -A OUTPUT -m ndpi --proto ssh
[root@localhost ~]# iptables -nvxL
Chain INPUT (policy ACCEPT 82234 packets, 147509598 bytes)
pkts bytes target prot opt in out source destination
298 22576 all -- * * 0.0.0.0/0 0.0.0.0/0 ndpi protocol ssh
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 44700 packets, 2365753 bytes)
pkts bytes target prot opt in out source destination
206 29430 all -- * * 0.0.0.0/0 0.0.0.0/0 ndpi protocol ssh
[root@localhost ~]# iptables -t mangle -nvxL
Chain PREROUTING (policy ACCEPT 82286 packets, 147513306 bytes)
pkts bytes target prot opt in out source destination
537 328797 all -- * * 0.0.0.0/0 0.0.0.0/0 ndpi all protocols
0 0 all -- * * 0.0.0.0/0 0.0.0.0/0 ndpi error
Chain INPUT (policy ACCEPT 82286 packets, 147513306 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 44729 packets, 2369257 bytes)
pkts bytes target prot opt in out source destination
416 43644 all -- * * 0.0.0.0/0 0.0.0.0/0 ndpi all protocols
0 0 all -- * * 0.0.0.0/0 0.0.0.0/0 ndpi error
Chain POSTROUTING (policy ACCEPT 44729 packets, 2369257 bytes)
pkts bytes target prot opt in out source destination
os: CentOS Stream kernel:
Linux 4.18.0-310.el8.x86_64 #1 SMP Tue Jun 8 00:24:50 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
my commit: https://github.com/ttys3/nDPI/commit/8909f366294acc9775b83d649230be2241e54c26
hope this could help others.
flow_info-3.2-centos8.patch
thanks for the tips:
Originally posted by @vel21ripn in https://github.com/vel21ripn/nDPI/issues/103#issuecomment-753522073
test it is ok:
test mangle
watch the log:
and I got something like:
PROTO=TCP SPT=22
, obviously it is ssh protocol, but it has error.I see that the TOS is
TOS=0x08
, it this error normal ?