I have installed Suricata, then I configured suricata.yaml and adjusted the af-packet with my network interface to enp0s3 in the directory /etc/suricata/suricata.yaml. However, when I reset Suricata and check the status of the service, the following command appears:
suricata.service
- Suricata Intrusion Detection Service
Loaded: loaded (/usr/lib/systemd/system/suricata.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2023-04-25 13:43:42 EDT; 963ms ago
Docs: man:suricata(1)
Process: 2898 ExecStart=/sbin/suricata -c /etc/suricata/suricata.yaml --pidfile /var/run/suricata.pid $OPTIONS (code=exited, status=1/FAILURE)
Process: 2897 ExecStartPre=/bin/rm -f /var/run/suricata.pid (code=exited, status=0/SUCCESS)
Main PID: 2898 (code=exited, status=1/FAILURE)
Apr 25 13:43:42 localhost.localdomain suricata[2898]: 25/4/2023 – 13:43:42 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get MTU via ioctl for ‘eth0’: No such device (19)
Apr 25 13:43:42 localhost.localdomain suricata[2898]: 25/4/2023 – 13:43:42 - - [ERRCODE: SC_ERR_SYSCALL(50)] - Failure when trying to get MTU via ioctl for ‘eth0’: No such device (19)
Apr 25 13:43:42 localhost.localdomain suricata[2898]: 25/4/2023 – 13:43:42 - - [ERRCODE: SC_ERR_AFP_CREATE(190)] - Unable to find type for iface “eth0”: No such device
Apr 25 13:43:42 localhost.localdomain suricata[2898]: 25/4/2023 – 13:43:42 - - all 1 packet processing threads, 4 management threads initialized, engine started.
Apr 25 13:43:42 localhost.localdomain suricata[2898]: 25/4/2023 – 13:43:42 - - [ERRCODE: SC_ERR_AFP_CREATE(190)] - Unable to find iface eth0: No such device
Apr 25 13:43:42 localhost.localdomain suricata[2898]: 25/4/2023 – 13:43:42 - - [ERRCODE: SC_ERR_AFP_CREATE(190)] - Couldn’t init AF_PACKET socket, fatal error
Apr 25 13:43:42 localhost.localdomain suricata[2898]: 25/4/2023 – 13:43:42 - - [ERRCODE: SC_ERR_FATAL(171)] - thread W#01-eth0 failed
Apr 25 13:43:42 localhost.localdomain systemd[1]: suricata.service: main process exited, code=exited, status=1/FAILURE
Apr 25 13:43:42 localhost.localdomain systemd[1]: Unit suricata.service entered failed state.
Apr 25 13:43:42 localhost.localdomain systemd[1]: suricata.service failed
The Suricata system keeps detecting that I am using eth0, even though I have changed the configuration in suricata.yaml to enp0s3. What should I do?