Unit iptables.service failed to load
来源:互联网 发布:手机屏幕镜像软件 编辑:程序博客网 时间:2024/06/05 15:14
第一次使用 CentOS 7,配置防火墙的时候, iptables 服务不能用了,有的时候命令能成功,有的时候又不行,特别是那些写入的操作和服务相关的。在执行 service iptables start/stop
和 service iptables save
之类的服务命令时会出现 Failed to restart iptables.service: Unit iptables.service failed to load: No such file or directory.
的错误日志。原因是 CentOS 7 升级防火墙为 一个叫 firewalld
的库了。
下面就说一下如何在 Cent7 中像以前一样使用 iptables :
- 首先关闭并卸载 firewalld
systemctl stop firewalldsystemctl mask firewalld
- 安装iptables-services
yum install iptables-services
- 设置开机启动:
systemctl enable iptables
- 启动服务
systemctl stop iptables systemctl start iptables systemctl restart iptables systemctl reload iptables
- 保存设置:
service iptables save
开放某个端口 在/etc/sysconfig/iptables里添加 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
至于新的 fairwalld
的用法最主要有两条:
- 开放端口
firewall-cmd --permanent --add-port=80/tcp
- 查询端口是否开放
firewall-cmd --permanent --query-port=80/tcp
阅读全文
0 0
- Unit iptables.service failed to load
- Failed to stop iptables.service: Unit iptables.service not loaded.
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
- Fix “Unit iptables.service failed to load: No such file or directory” Error In CentOS7
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
- CentOS7关闭/开启防火墙出现Unit iptables.service failed to load: No such file or directory
- 解决 RHEL 7/ CentOS 7/Fedora 出现Unit iptables.service failed to load
- 解决CentOS 7出现Failed to issue method call: Unit iptables.service failed to load: No such file or direc
- 解决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.
- Failed to restart network.service: Unit network.service failed to load: No such file or directory.
- 洛谷P3003 [USACO10DEC]苹果交货Apple Delivery
- 记2017—春招,令人难忘的面试经历
- longest Substring Without Repeating Characters
- OpenCV 根据对应的三维点估计刚体变换的旋转平移矩阵(RT矩阵)
- 浅析TCP协议中的各种定时器
- Unit iptables.service failed to load
- (带讲解)bzoj 4830 抛硬币 组合式推导+拓展lucas
- Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x000001DB1D7557
- 【MyBatis学习09】高级映射之一对多查询
- iOS编程学习六
- Python 数据科学手册 5.7 支持向量机
- Java 只运行一个实例
- Android 通讯录(1)-----自定义ItemDecoration实现分类标题
- python-skimage