[root@localhost ~]# service iptables stop
Redirecting to /bin/systemctl stop iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.
[root@localhost ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.
なに?
あ、centos7では「iptables」から「firewalld」に変更されている。
[root@localhost ~]# systemctl is-enabled firewalld enabled
enabledになってます。
firewalldを無効化にします。
systemctl stop firewalld [root@localhost ~]# systemctl status firewalld ● firewalld.service - firewalld - dynamic firewall daemon Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled) Active: inactive (dead) since Sat 2018-10-27 12:18:33 JST; 9s ago Docs: man:firewalld(1) Process: 623 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS) Main PID: 623 (code=exited, status=0/SUCCESS) Oct 27 12:01:06 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon... Oct 27 12:01:09 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon. Oct 27 12:18:33 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon... Oct 27 12:18:33 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
activeがinactive(dead)で無効化されているのでOK
続いて自動起動
[root@localhost ~]# systemctl is-enabled firewalld enabled
firewalldの自動起動を無効化
[root@localhost ~]# systemctl disable firewalld Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service. [root@localhost ~]# systemctl is-enabled firewalld disabled
しゃああああああああああああああああああ