解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
来源:互联网 发布:kg是什么意思网络 编辑:程序博客网 时间:2024/05/18 02:01
CentOS7中执行
并且安装iptables-services:
设置开机启动:
保存设置:
会报错Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.
在CentOS 7或RHEL 7或Fedora中防火墙由firewalld来管理,
如果要添加范围例外端口 如 1000-2000
语法命令如下:启用区域端口和协议组合
firewall-cmd [--zone=<zone>] --add-port=<port>[-<port>]/<protocol> [--timeout=<seconds>]
此举将启用端口和协议的组合。端口可以是一个单独的端口 <port> 或者是一个端口范围 <port>-<port> 。协议可以是 tcp 或 udp。
实际命令如下:
firewall-cmd --permanent --add-port=1000-2000/tcp
执行可以成功
用该命令查询firewall-cmd --permanent --query-port=1000/tcp
当然你可以还原传统的管理方式。
执行一下命令:
并且安装iptables-services:
设置开机启动:
保存设置:
OK,再试一下应该就好使了
开放某个端口 在/etc/sysconfig/iptables里添加
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
阅读全文
0 0
- CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
- Fix “Unit iptables.service failed to load: No such file or directory” Error In CentOS7
- 解决CentOS 7出现Failed to issue method call: Unit iptables.service failed to load: No such file or direc
- centos7 Unit https.service failed to load: No such file or directory.
- Failed to restart network.service: Unit network.service failed to load: No such file or directory.
- Failed to restart network.service: Unit network.service failed to load: No such file or directory.
- Failed to issue method call: Unit ssh.service failed to load: No such file or directory.
- Centos7与Fedora24安装mysql后无法启动,提示 Unit mysql.service failed to load:No such file or directory
- Centos7与Fedora24安装mysql后无法启动,提示 Unit mysql.service failed to load:No such file or directory
- Centos7与Fedora24安装mysql后无法启动,提示 Unit mysql.service failed to load:No such file or directory
- mysql不能启动:Unit mysql.service failed to load: No such file or directory的解决办法
- Failed to issue method call: Unit mysql.service failed to load: No such file or directory的解决办法
- 第四周学习笔记
- jsp动态拼装select标签的option选项
- 【OpenSource】【EventBus】EventBus 简介
- 服务器上的日志文件不打印e.printStackTrace();信息
- MyBatis源代码--数据源(dataSource)
- 解决CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory.
- 如何恢复Mac的OS X系统?
- python 中 sorted() 和 list.sort() 的用法
- 三层架构的优缺点
- AOP拦截常用请求内容
- Git
- 前端常用技术中文文档地址
- css设计页面-用户行为
- http,servlet,jsp-java web后台知识简单总结