[root@zabbix-server html]# iptables --version
iptables v1.4.21 [root@zabbix-server html]# iptables -I INPUT -p tcp --dport -j ACCEPT
[root@zabbix-server html]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT)
target prot opt source destination

[root@zabbix-server html]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ 确定 ]

 

测试访问

删除刚刚添加的80端口

[root@zabbix-server html]# iptables -D INPUT  -p tcp --dport  -j ACCEPT
[root@zabbix-server html]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT)
target prot opt source destination [root@zabbix-server html]# service iptables save
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ 确定 ]

测试访问

iptables 开放80端口以及删除80端口的规则的更多相关文章

  1. [转载]CENTOS 6.0 iptables 开放端口80 3306 22端口

    原文地址:6.0 iptables 开放端口80 3306 22端口">CENTOS 6.0 iptables 开放端口80 3306 22端口作者:云淡风轻 #/sbin/iptab ...

  2. Iptables 防火墙开放常见的22,53,80端口

    用iptables防火墙 iptables -F # 允许包从22端口进入 iptables -A INPUT -p tcp --dport 22 -j ACCEPT # 允许从22端口进入的包返回 ...

  3. (转载)CentOS: 开放80、22、3306端口操作

    (转载)http://blog.sina.com.cn/s/blog_3eba8f1c0100tsox.html #/sbin/iptables -I INPUT -p tcp --dport 80 ...

  4. 【转】CentOS: 开放80、22、3306端口操作

    #/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT#/sbin/iptables -I INPUT -p tcp --dport 22 -j AC ...

  5. CentOS7防火墙开启与关闭以及开放6379,3306,80等端口

    CentOS7用firewall防火墙替代了原来的iptables,所以我们应该使用firewall的一些命令.如下:1.关闭防火墙 systemctl stop firewalld.service ...

  6. centos7防火墙iptables开放常用端口

    清除所有规则: iptables -F 开放常用tcp端口: iptables -I INPUT -p tcp -m multiport --dports 20,21,22,3690,80,443,4 ...

  7. linux将80端口映射到指定端口命令

    1.添加一个端口映射 将80端口映射到8088端口命令如下: iptables -t nat -I PREROUTING -p tcp --dport 80-j REDIRECT --to-port ...

  8. Linux中使用iptables开放特定端口

    禁止其他主机对该特定主机进行访问和远程连接控制,所以只开放特定端口 只控制INPUT链就可达到控制其他主机对该主机的访问. 1.首先关闭INPUT链 iptables -P INPUT DROP 使用 ...

  9. docker上部署nginx容器80端口自动转443端口

    拉去nginx镜像 # docker pull nginx 运行nginx容器config用于拷贝nginx配置文件 # docker run --name nginxconfig -d docker ...

随机推荐

  1. $.post系统登录校验

    AJAX方式:$.post系统登录校验 https://blog.csdn.net/woshisangsang/article/details/66560238?utm_source=blogxgwz ...

  2. mysql之DTS的那些事

    最近才考虑数据库迁移,想起了之前做DTS踩过的那些坑. 基于数据库迁移,比如从源A库迁移到源B库,包括但不限于数据库上云. 数据库迁移方案有两种场景: (1).停机迁移方案 这种方案是允许停服的场景, ...

  3. Linux 创建静态库.a

    gcc -c 只编译不连接 -o *.o(生成.o文件) ar crv  name.a   *.o *.o  (ar 命令把 .o文件打包成  name.a 静态库) 测试 name.a -L 紧跟链 ...

  4. 设计函数f(f(n))== -n

    来源:厦门SEO 我上次面试时遇到的一个问题: 设计一个函数f ,使得: f(f(n)) == -n 其中n是一个32位有符号整数 ; 您不能使用复数算法. 如果您不能为整个数字范围设计这样的函数,请 ...

  5. std::string和ctime之间的转换

    int year, month, day, hour, minute, second; string strTime: sscanf(strTime.c_str(), "%d-%d-%d % ...

  6. Django模型迁移提示版本不匹配解决办法

    Django迁移模型时提示django.core.exceptions.ImproperlyConfigured:mysqlclient 1.3.7 or newer is required; you ...

  7. 方格取数(多线程dp,深搜)

    https://www.luogu.org/problem/P1004 题目描述 设有N×N的方格图(N≤9),我们将其中的某些方格中填入正整数,而其他的方格中则放入数字0.如下图所示(见样例): 某 ...

  8. poj-3661 Running(DP)

    http://poj.org/problem?id=3661 Description The cows are trying to become better athletes, so Bessie ...

  9. 迅为IMX6Q开发板提供原理图_底板PCB_驱动程序源码_芯片和LCD数据手册_开发板环境_使用手册

      迅为IMX6开发板: Android4.4/6.0系统  Linux + Qt5.7系统  Ubuntu12.04系统 部分案例:HMI:3D打印机:医疗设备:工控机:触控一体机:车载终端 核心板 ...

  10. Distribution

    Random Variable \(\underline{cdf:}\)cumulative distribution function \(F(x)=P(X \leq x)\) \(\underli ...