CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory
来源:互联网 发布:js onscroll 编辑:程序博客网 时间:2024/05/17 09:20
原文地址:http://blog.csdn.net/c233728461/article/details/52679558
CentOS7中执行
会报错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
- 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.
- 解决CentOS 7出现Failed to issue method call: Unit iptables.service failed to load: No such file or direc
- 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的解决办法
- Android学习资料收集
- 史上最详细:在VMware虚拟机里搭建DB2 purescale测试
- 伪造链接地址的二种方法
- 走入javascript(七) 函数 不定参 参数和return
- Python基础-操作文件和目录
- CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory
- 威威猫系列故事——打地鼠
- eclipse菜单栏windows/preferences下找不到server选项
- 与时间做朋友
- opencv——边缘检测
- web开发相关概念+web服务器
- java实用加密算法AES和RSA
- 算法作业HW19 130. Surrounded Regions
- Java一维数组实验编程