Iptables.service Listed As: Not-found Inactive Dead
Hello fellow CentOS users,
on a freshly installed 7.2 machine and after reading
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/chap-Managing_Services_with_systemd.html
I try to enable iptables with following commands:
# cat /etc/CentOS-release CentOS Linux release 7.2.1511 (Core)
# rpm -qa | grep iptables iptables-1.4.21-16.el7.x86_64
# sudo systemctl list-units –type service –all | grep iptables
● iptables.service not-found inactive dead iptables.service
# sudo systemctl enable iptables.service Failed to execute operation: No such file or directory
What missing file is meant here please?
Thank you Alex
3 thoughts on - Iptables.service Listed As: Not-found Inactive Dead
By default, CentOS 7 uses firewalld.
Eero
2016-05-31 15:57 GMT+03:00 Alexander Farber:
CentOS mailing list CentOS@CentOS.org https://lists.CentOS.org/mailman/listinfo/CentOS
you need iptables-services rpm (and disable/remove firewalld)
—
Marcelo
“¿No será acaso que esta vida moderna está teniendo más de moderna que de vida?” (Mafalda)
Thank you, I have put my firewall rules into /etc/sysconfig/iptables:
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [294:35064]
-A INPUT -m state –state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -m icmp –icmp-type any -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp -m multiport –dports
25,80,443,8080 -j ACCEPT
-A INPUT -p tcp -m state –state NEW -m tcp –dport 22 –tcp-flags FIN,SYN,RST,ACK SYN -m limit –limit 2/min –limit-burst 1 -j ACCEPT
COMMIT
Then issued the commands (there was no firewalld installed):
# yum install iptables-services
# systemctl enable iptables
# systemctl start iptables
And it seems to work well now
Regards Alex
CentOS mailing list CentOS@CentOS.org https://lists.CentOS.org/mailman/listinfo/CentOS