[Solved] Centos7 linux ailed to stop iptables.service: Unit iptables.service not loaded.

Because use the virtual machine under win to install Linux

But in win, you can ping Linux

But when using the browser method Linux service under win, you can’t access it

The suspicion is that it’s a firewall problem. Turn off firewall

root@bogon bin]# chkconfig iptables off
error reading information on service iptables: No such file or directory
[root@bogon bin]# service iptables stop
Redirecting to /bin/systemctl stop iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.

No, it’s wrong.

[root@bogon bin]# 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@bogon bin]# systemctl disable firewalld
[root@bogon bin]# service iptables stop
Redirecting to /bin/systemctl stop iptables.service
Failed to stop iptables.service: Unit iptables.service not loaded.

The systemctl disable firewalld is now responding. But as I tested it, it still doesn’t work.

 

Solution:

Centos has used firewalld by default since 7, which is based on iptables. Although there is the core of iptables, the service of iptables is not installed. So you just need to stop the firewalld service:

[root@bogon bin]# systemctl stop firewalld.service && systemctl disable firewalld.service

Preparing

Similar Posts: