防火墙问题 Linux系统 /etc/sysconfig/路径下无iptables文件
虛擬機新裝了一個CentOs7,然后做防火墻配置的時候找不到iptables文件,解決方法如下:
因為默認使用的是firewall作為防火墻,把他停掉裝個iptable
systemctl stop firewalld?
systemctl mask firewalld
yum install -y iptables?
yum install iptables-services
然后就有iptables文件,就可以作配置
開啟服務?
systemctl start iptables.service
systemctl restart iptables.service // 重啟防火墻使配置生效?
systemctl enable iptables.service // 設置防火墻開機啟動
增加開放端口
在iptables中加入以下內容(8080就是端口號):
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT
其他命令:?
檢查是否安裝了iptables?
service iptables status?
安裝iptables?
yum install -y iptables?
升級iptables?
yum update iptables?
安裝iptables-services?
yum install iptables-services
systemctl disable iptables #禁止iptables服務?
systemctl stop iptables #暫停服務?
systemctl enable iptables #解除禁止iptables?
systemctl start iptables #開啟服務
?
轉載于:https://www.cnblogs.com/zwq-/p/11225245.html
總結
以上是生活随笔為你收集整理的防火墙问题 Linux系统 /etc/sysconfig/路径下无iptables文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: poj 1067 取石子游戏(博弈+威佐
- 下一篇: SQL Server中删除重复数据的2个