虚拟机新装了一个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 #开启服务

最新文章

  1. Maven配置详见
  2. 二叉树建立,遍历和二叉排序树的判断【c++】
  3. MySql的安装及配置详细指引!
  4. 二、 显示加载数据过程的JS
  5. Cellular Automata编写历程
  6. BroadcastReceiver和EventBus区别是什么
  7. 小波说雨燕 第三季 构建 swift UI 之 UI组件集-视图集(四)Alert View视图 学习笔记
  8. ojdbc5.jar
  9. BZOJ 3198 SDOI2013 spring
  10. ###学习《C++ Primer》- 4
  11. Oracle开始从Java运行时中移除JAR包
  12. JAVA中获取当前运行的类名,方法名,行数
  13. H5内联视频
  14. h5文字超出,两行显示,超出显示省略号
  15. go语言练习:幂、函授接收和返回参数、转义字符、变量和常量
  16. 洛谷 P1603 斯诺登的密码
  17. Centos7 ss搭建
  18. Java加密和C#解密=>DES方法
  19. 设置MyEclipse字体大小
  20. API的HTTP Status Code

热门文章

  1. velocity的 ${} 、$!{}、 !${}
  2. 主机与虚拟机连接,主机能ping通虚拟机虚拟机ping不通主机问题
  3. Django 实现下载功能时中文文件名问题
  4. JS-原生的ajax
  5. dwz中的(tree)树形菜单的默认收缩
  6. SprintBoot学习(二)
  7. AP2800无法放出SSID?
  8. 在Visual Studio 2017中,.NET(C#)通过Oracle.ManagedDataAccess来连接Oracle数据库
  9. IDEA 查看字节码
  10. C++11特性中基于范围的for循环