0

Today I have upgraded my Ubuntu 18.04.04 VPS server to Ubuntu 20.04. Now CSF not starting and shows the following error and not start the CSF service.

*Error* The path to iptables is either not set or incorrect for IPTABLES [/sbin/ip6tables] in /etc/csf/csf.conf at /usr/local/csf/lib/ConfigServer/URLGet.pm line 26.
Compilation failed in require at /usr/sbin/csf line 21.
BEGIN failed--compilation aborted at /usr/sbin/csf line 21.

When I test iptables it shows the following result.

root@server:~# sudo iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets, 0 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 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination    
root@server:~# ip6tables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

How do I fix this CSF iptable issue?

Chathu
  • 87
  • 1
  • 11

1 Answers1

2

You need to check where is your iptables and ip6tables.

Run this on terminal:

whereis iptables

and

whereis ip6tables

Mine is:

whereis iptables

iptables: /usr/sbin/iptables /usr/share/iptables /usr/share/man/man8/iptables.8.gz

and

whereis ip6tables

ip6tables: /usr/sbin/ip6tables /usr/share/man/man8/ip6tables.8.gz

And update the file /etc/csf/csf.conf:

Binary locations

IPTABLES = "/usr/sbin/iptables"

IPTABLES_SAVE = "/usr/sbin/iptables-save"

IPTABLES_RESTORE = "/usr/sbin/iptables-restore"

IP6TABLES = "/usr/sbin/ip6tables"

IP6TABLES_SAVE = "/usr/sbin/ip6tables-save"

IP6TABLES_RESTORE = "/usr/sbin/ip6tables-restore"

And make sure it works for you.

  • @Fflávio-pinho Thanks a lot. This solution worked. – Chathu Aug 09 '20 at 10:14
  • For me not work.Path is correct in /etc/csf/csf.conf and double check whit whereis and ls. Error: ```*Error* The path to iptables is either not set or incorrect for IPTABLES [/usr/sbin/ip6tables] in /etc/csf/csf.conf at /usr/local/csf/lib/ConfigServer/URLGet.pm line 26. Compilation failed in require at /usr/sbin/csf line 21. BEGIN failed--compilation aborted at /usr/sbin/csf line 21.``` – abkrim Apr 02 '21 at 06:22
  • What is the output when you execute: whereis iptables whereis ip6tables And show your binary locations in /etc/csf/csf.conf – Flávio Pinho Apr 20 '21 at 10:21