1、永久性生效,重启后不会复原

开启: chkconfig iptables on

关闭: chkconfig iptables off

2、 即时生效,重启后复原

开启: service iptables start

关闭: service iptables stop

3、查看防火墙状态

service iptables status 查看iptables状态

=================

防火墙开放端口:10051、10050、80

open your firewall ports on client and serverside!!

10051 for trapper
10050 for client
80 for httpd

This can be done easy by adding these lines in iptables

vi /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 10051 -j ACCEPT

restart the firewall

service iptables restart

=======================

RHEL7启动关闭防火墙:

# systemctl status firewalld

# systemctl start/stop firewalld   --重启系统后失效

# systemctl enable/disable firewalld  --重启后也生效

linux防火墙开启-关闭的更多相关文章

  1. Linux防火墙开启关闭查询

    1.centos7防火墙 命令含义: –zone #作用域 –add-port=80/tcp #添加端口,格式为:端口/通讯协议 –permanent #永久生效,没有此参数重启后失效 服务与端口的启 ...

  2. Linux下开启关闭防火墙

    一.Linux下开启/关闭防火墙命令 1) 永久性生效,重启后不会复原 开启: chkconfig iptables on 关闭: chkconfig iptables off   2) 即时生效,重 ...

  3. CentOs7 使用iptables防火墙开启关闭端口

    CentOs7 使用iptables防火墙开启关闭端口   # 0x01介绍 iptables命令是Linux上常用的防火墙软件,是netfilter项目的一部分iptables文件设置路径:命令:v ...

  4. linux 防火墙开启80端口永久保存

    经常使用CentOS的朋友,可能会遇到和我一样的问题.开启了防火墙导致80端口无法访问,刚开始学习centos的朋友可以参考下.经常使用CentOS的朋友,可能会遇到和我一样的问题.最近在Linux ...

  5. 一 SSH 无密码登陆 & Linux防火墙 & SELinux关闭

    如果系统环境崩溃.   调用/usr/bin/vim /etc/profile   SHH无密码登陆 所有要做得节点上运行   修改 host name vi /etc/sysconfig/netwo ...

  6. Linux防火墙的关闭和开启

    1) 重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 2) 即时生效,重启后失效 开启: service iptables sta ...

  7. Linux防火墙的关闭和开启(转)

    1) 重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 2) 即时生效,重启后失效 开启: service iptables sta ...

  8. 【linux系列】linux防火墙的关闭开启

    即时生效 开启:service iptables start 关闭:service iptables stop 重启后生效 开启:chkconfig iptables on 关闭:chkconfig ...

  9. Linux下开启关闭SeLinux

    SELinux (Security-Enhanced Linux) in Fedora is an implementation of mandatory access control in the ...

随机推荐

  1. Windows下配置环境变量和需不需要重启问题

    http://blog.163.com/guomaolin_gavin/blog/static/19961830720121114929321/

  2. expr的简单应用

    expr命令 是一个手工命令行计数器,用于在UNIX/LINUX下求表达式变量的值,一般用于整数值,也可用于字符串. –格式为: expr expression_r(命令读入Expression 参数 ...

  3. 纪录一个table元素里面的tr th td

    <table border="1"> <tr> <th>name</th> <th>sex</th> < ...

  4. ruby on rails 中render的使用

    最近写ror,因为比较菜,很多东西不知道,只能看一点查一点了 render 先上点搜集的常用方式 render :action => "long_goal", :layout ...

  5. js兼容性大全(持续更新)

    javascript部分 1. document.form.item 问题 问题: 代码中存在 document.formName.item("itemName") 这样的语句,不 ...

  6. maven 整理

    1. 打包命令: mvn package -DskipTests 2. 发布命令: mvn deploy -DperformRelease=true

  7. wm_char

    用于接收键盘输入的消息 int CXuexi2View::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateS ...

  8. jquery mobile 按钮部件(包含图标的使用)

    参考网址:http://api.jquerymobile.com/1.3/button/ 注:按钮的三种写法 <a href="#" class="ui-btn u ...

  9. C# 中显示实现接口

    接口的实现分为显示实现和隐式实现 用显示实现接口的目的就是为了,当一个类中实现多个具有相同方法的接口时,能够区分开来 在调用的时候,必须用接口调用. class Program { static vo ...

  10. clone database and rename

    使用 management studio right click database -> Tasks -> Generate Scripts -> next until " ...