Iptables防火墙配置

来源:互联网 发布:最小的windows 编辑:程序博客网 时间:2024/06/10 01:12

Linux 配置防火墙操作实例(启、停、开、闭端口)

  1. iptables的存储位置 /etc/sysconfig/iptables
  2. 查询iptable的详细信息: [root@localhost ~]# iptables -L -n -v
  3. 查询防火墙状态: [root@localhost ~]# service iptables status
  4. 停止防火墙: [root@localhost ~]# service iptables stop
  5. 启动防火墙: [root@localhost ~]# service iptables start
  6. 重启防火墙: [root@localhost ~]# service iptables restart
  7. 永久关闭防火墙: [root@localhost ~]# chkconfig iptables off
  8. 永久关闭后启用: [root@localhost ~]# chkconfig iptables on

配置实例

1,查看iptable状态
这里写图片描述
3,通过vim 编辑/etc/sysconfig/iptables文件,复制一行
4,保持iptables文件,并执行[root@localhost ~]# service iptables restart <回车>
5,查看iptable状态,是否端口开放成功;

1 0
原创粉丝点击