Alexander Farber
2016-May-31  12:57 UTC
[CentOS] 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
Eero Volotinen
2016-May-31  13:21 UTC
[CentOS] 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 <alexander.farber at gmail.com>:> 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 > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos >
Marcelo Roccasalva
2016-May-31  13:29 UTC
[CentOS] iptables.service listed as: not-found inactive dead
On Tue, May 31, 2016 at 9:57 AM, Alexander Farber < alexander.farber at gmail.com> wrote:> 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 >?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)
Alexander Farber
2016-May-31  15:55 UTC
[CentOS] iptables.service listed as: not-found inactive dead
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
On Tue, May 31, 2016 at 3:29 PM, Marcelo Roccasalva <
marcelo-centos at irrigacion.gov.ar> wrote:
> On Tue, May 31, 2016 at 9:57 AM, Alexander Farber <
> alexander.farber at gmail.com> wrote:
>
> >
>
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
> >
>
> ?you need iptables-services rpm (and disable/remove firewalld)?
>