• 查看iptables端口配置
    iptables -L -n --line-number
  • iptables端口配置(不开通3389无法远程连接,不开通icmp无法ping)
    iptables -A INPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 443 -j ACCEPT
iptables -A INPUT -p tcp --dport 3306 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 3306 -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 80 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -j ACCEPT
  • iptables删除端口配置
    iptables -D INPUT 1
  • iptables关闭所有配置
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
  • 重启iptables
    service iptables save && service iptables restart
  • 关闭防火墙
    chkconfig iptables off && service iptables stop

iptables防火墙操作-查看、配置、重启、关闭的更多相关文章

  1. C# 防火墙操作之开启与关闭

    通过代码操作防火墙的方式有两种:一是代码操作修改注册表启用或关闭防火墙:二是直接操作防火墙对象来启用或关闭防火墙.不论哪一种方式,都需要使用管理员权限,所以操作前需要判断程序是否具有管理员权限. 1. ...

  2. 再谈 iptables 防火墙的 指令配置

    手机上使用localhost为什么不能访问? 电脑上使用localhost 访问主页的原理是 电脑上有网站资源和服务器相关程序apache等的支持, 同时在 电脑的hosts文件中 有 127.0.0 ...

  3. C# 防火墙操作之启用与关闭

    通过代码操作防火墙的方式有两种:一是代码操作修改注册表启用或关闭防火墙:二是直接操作防火墙对象来启用或关闭防火墙.不论哪一种方式,都需要使用管理员权限,所以操作前需要判断程序是否具有管理员权限. 1. ...

  4. CentOS 7.0关闭默认firewall防火墙启用iptables防火墙

    操作系统环境:CentOS Linux release 7.0.1406(Core) 64位CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭f ...

  5. Centos7 防火墙关闭和启用iptables防火墙

    操作系统环境:CentOS Linux release 7.0.1406(Core) 64位CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭f ...

  6. CentOS7关闭默认防火墙启用iptables防火墙

    CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭firewall: systemctl stop firewalld.service #停止f ...

  7. Linux(13):期中架构(5)--- 前端部分:keepalived高可用 & HTTPS & iptables防火墙

    keepalived 高可用集群 1. keepalived服务概念说明 # 1.1 keepalived软件的作用? Keepalived软件起初是专为LVS负载均衡软件设计的, 用来管理并监控LV ...

  8. 如何将centos7自带的firewall防火墙更换为iptables防火墙

    用惯了centos6的iptables防火墙,对firewall太无感了,那么如何改回原来熟悉的iptables防火墙呢? 1.关闭firewall防火墙 [root@centos7 html]# s ...

  9. CentOS系统iptables防火墙的启动、停止以及开启关闭端口的操作

    CentOS 配置防火墙操作实例(启.停.开.闭端口):注:防火墙的基本操作命令:查询防火墙状态:[root@localhost ~]# service   iptables status停止防火墙: ...

随机推荐

  1. [.NET] 一步步打造一个简单的 MVC 电商网站 - BooksStore(一) (转)

    http://www.cnblogs.com/liqingwen/p/6640861.html 一步步打造一个简单的 MVC 电商网站 - BooksStore(一) 本系列的 GitHub地址:ht ...

  2. delphi treeview的子节点图标?

    代码实现不同的子节点图标效果. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, ...

  3. ParallelForTransform作业

    ParallelForTransform作业是另一种ParallelFor作业 ; 专为在变形上操作而设计. 注意:ParallelForTransform作业是Unity中用于实现IJobParal ...

  4. LeetCode.1184-公交车站之间的距离(Distance Between Bus Stops)

    这是小川的第次更新,第篇原创 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第265题(顺位题号是1184).公交车有n个从0到n-1的车站,形成一个圆圈.我们知道所有相邻车站对之间的 ...

  5. shell-变量,字符串,数组,注释,参数传递

    Linux的Shell有很多种,常见的有Bourne Shell Bourne Again Shell C Shell K Shell Shell for Root 等,其中Bourne Again ...

  6. Linux配置文件的修改

    在很多时候,我们需要对Linux的配置文件进行修改.此时就涉及到了不同Linux发行版的修改配置问题.下面就以主流的几个操作系统(Unix:Solaris,Linux:Ubuntu,Redhat)作为 ...

  7. 部署kubernetes-prometheus和用kubespray部署kubernetes后修改kubelet的

    1.kubespray的配置文件 /opt/kubespray/inventory/mycluster/group_vars/all/all.yml# kube_read_only_port: 102 ...

  8. flask的cookies操作

    from flask import Flask,request,Response app = Flask(__name__) @app.route('/') def hello_world(): re ...

  9. [官网]mono的官方安装方法

    mono 官方的安装方法 https://www.mono-project.com/download/stable/#download-lin-centos Download Release chan ...

  10. spark-scala-java实现wordcount

    引入:spark-scala-java实现wordcount 1.spark-scala实现wordcount package com.cw.scala.spark import org.apache ...