防火墙重启:出错please try to use systemctl.
2018-11-05 19:56
134 查看
版权声明:所有原创,转载请在开头注明出处 https://blog.csdn.net/SELECT_BIN/article/details/83755594
查看防火墙状态:
[root@centos6 ~]# service iptables status
iptables:未运行防火墙。
重启防火墙(iptables)命令
#service iptable restart失效
[code]#service iptable restart Redirecting to /bin/systemctl restart iptable.service Failed to issue method call: Unit iptable.service failed to load: No such file or directory.
据说从某个版本的Linux系统(CenterOS/RedHat)后就将service命令改了,如下
[code]#systemctl restart iptables.service #iptables -L
重启防火墙成功~~~
[code]# service iptables save The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
#关闭防火墙
systemctl stop firewalld
#注销防火墙服务
systemctl mask firewalld
#然后安装iptables-services
yum install iptables-services
#设置开机启动防火墙
systemctl enable iptables
#可以使用下面命令管理iptables
systemctl [stop|start|restart] iptables
#保存规则
service iptables save
or
/usr/libexec/iptables/iptables.init save
相关文章推荐
- how to use systemctl on linux(debian)
- Welcome to emergency mode. Use "systemctl default" or ^D to activate default mode.
- [systemd]How To Use Systemctl to Manage Systemd Services and Units
- EWB使用时出错-unable to write EWB program directory please change the permissions of this directory
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use
- Failed to export using the options you specified. Please check your options and try again
- 执行 systemctl start firewalld 命令后出现Failed to start firewalld.service: Unit is masked
- magento -- 客户无法使用contact us 发邮件 - Unable to submit your request. Please, try again later
- 关于虚拟机安装 linux centOS Unable to boot – please use a kernel appropriate for your CPU
- You have configured this virtual machine to use a 64-bit guest operating system. However, 64-bit op
- Failed to download samples index, please check your connection and try again
- error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the c
- asp.net配置报错 “An error was encountered. Please return to the previous page and try again. ”
- An error was encountered. Please return to the previous page and try again.
- How to use the System Restore API to save and to restore system data in Visual C++
- Nios II编译出错:make: *** No rule to make target `e:/nios ', needed by `/cygdrive/e/nios/Debug/system_de
- Unable to find the report in the manifest resources. Please build the project, and try again.
- magento:客户无法使用contact us 留言发邮件,提示: Unable to submit your request. Please, try again later
- Android Studio 安装出错 Failed to install Intel HAXM. For details, please check the installation log
- 【Linux】重启网卡错误:Job for network.service failed. See 'systemctl ……