如果系统已安装则调过安装步骤

查找安装包

yum list | grep iptables

安装iptables

yum install iptables-services

重启防火墙使配置文件生效

systemctl restart iptables.service

设置iptables防火墙为开机启动项

systemctl enable iptables.service

查看激活状态

systemctl status iptables.service

查看本机IPTABLES的设置情况

iptables -nL

开放端口,编辑配置

vim /etc/sysconfig/iptables

添加

-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

重启即可

启动指令:service iptables start
重启指令:service iptables restart
关闭指令:service iptables stop

https://blog.csdn.net/u011019141/article/details/78872468?utm_source=copy

Linux iptables开放特定端口的更多相关文章

  1. Linux 防火墙开放特定端口 (iptables)

    iptables是linux下的防火墙,同时也是服务名称.   service  iptables  status        查看防火墙状态 service  iptables  start   ...

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

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

  3. Linux 防火墙iptables开放特定端口

    1.查看状态:iptables -L -n2.直接编辑:vi /etc/sysconfig/iptables3.端口开放:-A INPUT -m state --state NEW -m tcp -p ...

  4. Linux 防火墙开放特定端口 (iptables)

    1.查看状态:iptables -L -n2.直接编辑:vi /etc/sysconfig/iptables3.端口开放:-A INPUT -m state --state NEW -m tcp -p ...

  5. linux 防火墙开放特定端口与指定ip谨防

    vi etc/iptable/sysconfig/iptables linux 开放固定端口 -A INPUT -m state --state NEW -m tcp -p tcp --dport 1 ...

  6. linux iptables开放/关闭端口命令

    在CentOS/RHEL 7以前版本上开启端口 #开放端口:8080/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT#将更改进行保存/etc/ ...

  7. LINUX关闭防火墙、开放特定端口等常用操作

    1. 重启后永久性生效: 开启:chkconfig iptables on 关闭:chkconfig iptables off 2. 即时生效,重启后失效: 开启:service iptables s ...

  8. CentOS 防火墙开放特定端口

    iptables是linux下的防火墙,同时也是服务名称.   service  iptables  status        查看防火墙状态 service  iptables  start   ...

  9. Win10如何设置防火墙开放特定端口 windows10防火墙设置对特定端口开放的方法

    Win10防火墙虽然能够很好地保护我们的系统,但同时也会因限制了某些端口,而给我们的操作带了一些不便.对于既想使用某些端口,又不愿关闭防火墙的用户而言,在Win10系统中设置防火墙开放特定端口就非常必 ...

随机推荐

  1. PAT甲级——A1086 Tree Traversals Again

    An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example ...

  2. Java - 关于覆盖和重写的总结

    公众号偶然看到的一个帖子,构造方法,类方法,final方法,哪些能覆盖,哪些能重载,初学时也是被这些术语搞的很迷糊 现在有时间了对这些做一个总结.全是自己的语言,可能不是很全面,表达意思应该够清楚 一 ...

  3. SpringMVC学习总结

    SpringMVC部分重点组建介绍 前端处理器(DispatcherServlet):接受请求,响应结果,是SpringMVC的核心 处理映射器(HandlerMapping):根据URL去查找处理器 ...

  4. tcpdump 抓包

    简介 用简单的话来定义tcpdump,就是:dump the traffic on a network,根据使用者的定义对网络上的数据包进行截获的包分析工具. tcpdump可以将网络中传送的数据包的 ...

  5. Ubuntu 14.04 Ruby 2.3.3 安装

    在Ubuntu 14.04通过下载Ruby源码包进行安装. 第一步,更新apt-get sudo apt-get update 通过apt-get安装ruby依赖 sudo apt-get insta ...

  6. CGLayer和CALayer区别

    CGLayer是一种很好的缓存常绘内容的方法.注意,不要与CALayer混淆.CALayer是Core Animation中更加强大.复杂的图层对象,而CGLayer是Core Graphics中优化 ...

  7. Extjs 疑难杂症 (LoadMark 遮罩、Panel Update无效、chrome浏览器date控件全屏)

    一.在extjs gridPanel中使用LoadMark无效,三步搞定. 原代码: grid = new Ext.grid.GridPanel({ store: store, title:'资料列表 ...

  8. 【Redis缓存机制】1.Redis介绍和使用场景

    (1)持久化数据库的缺点平常我们使用的关系型数据库有Mysql.Oracle以及SqlServer等,在开发的过程中,数据通常都是通过Web提供的数据库驱动来链接数据库进行增删改查. 那么,我们日常使 ...

  9. Ajax.NET-Professional

    https://github.com/michaelschwarz/Ajax.NET-Professional Ajax.NET Professional Ajax.NET Professional ...

  10. [转载] OpenCV2.4.3 CheatSheet学习(二)

    二.矩阵操作(拷贝.洗牌.局部访问): src.copyTo(dst) 把src矩阵中的数据拷贝到dst. src.convertTo(dst, type,scale, shift) 缩放并转换到另外 ...