In the effort to lock down a new Centos box I am building I am installing iptables. I would like to be able to put this in a script so I can do this to other boxes but I am getting some odd errors and the roll back requires a reboot? Installing with
yum install iptables
which works fine, but before reboot:
[root@ip-10-0-0-132 ~]# systemctl start iptables
Failed to issue method call: Unit iptables.service failed to load: No such file or directory.
[root@ip-10-0-0-132 ~]# systemctl enable iptables
Failed to issue method call: Access denied
[root@ip-10-0-0-132 ~]#
and after
[root@ip-10-0-0-132 ~]# systemctl enable iptables
ln -s '/usr/lib/systemd/system/iptables.service' '/etc/systemd/system/basic.target.wants/iptables.service'
[root@ip-10-0-0-132 ~]# systemctl start iptables
[root@ip-10-0-0-132 ~]#
I am new to systemd and if this is completely trivial please point me to a man page/guide/wiki so I can research this. I just haven't found anything obvious as yet.
iptables
instead offirewalld
?firewalld
for RHEL7 and going with iptables just because we also have a lot of RHEL5 and RHEL6. Once we start deploying RHEL 8 we'll probably re-visit using firewalld in production. Until then it's an idiosyncrasy we can just disable to make RHEL7 look as much like RHEL6 as possible.