两者的区别:

iptables用于设置防火墙(firewall), 即管理内外通信。

iptables是Linux下功能强大的应用层防火墙工具
iptables 能做到“控制内部机器上网与不上网,访问哪些网站的控制”
 但日志只能记录关于访问ip数据的相关信息
SELinux主要用于对文件(file), 文件夹 (directory), 过程(process)的限制
SELinux是美国国家安全局发布的一个强制访问控制系统

临时关闭防火墙                systemctl stop firewalld

永久防火墙开机自启动      systemctl disable firewalld

临时打开防火墙                systemctl start firewalld

防火墙开机启动                systemctl enable firewalld

查看防火墙状态                systemctl status firewalld

临时关闭SELinux              setenforce 0

临时打开SELinux              setenforce 1

开机关闭SELinux

编辑/etc/selinux/config文件,将SELINUX的值设置为disabled,如下图。下次开机SELinux就不会启动了。

查看SELinux状态

执行getenforce命令

Iptabels防火墙和SElinux的更多相关文章

  1. Linux关闭防火墙、SELinux

    使用root权限: Linux关闭防火墙: 1. chkconfig –list|grep iptables 2. chkconfig iptables off 永久关闭防火墙 3. chkconfi ...

  2. SpringCloud的应用发布(四)vmvare+linux,防火墙和selinux

    一.vmvare网络配置为nat模式 二.vmvare的网络设置为桥接bridge模式 1.linux 网卡的ip获取方式dhcp 三.关闭linux的防火墙和selinux 1.临时关闭防火墙 sy ...

  3. CentOS7 关闭防火墙和selinux

    本文将简单介绍在CentOS7上如何临时和永久关闭防火墙和selinux. 关闭防火墙 # 查看防火墙状态 [root@localhost ~]# systemctl status firewalld ...

  4. Linux_防火墙与SElinux

    一.防火墙与SElinux 1.防火墙和selinux 防火墙 iptables          默认允许所以 firewalld         默认拒绝所有 ebtables 不认识,不管 se ...

  5. Centos 7 安装 设置 IP地址,DNS,主机名,防火墙,端口,SELinux (实测+笔记)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 安装步骤: 1.虚拟系统安装 1.1 使 ...

  6. CentOS 关闭防火墙和selinux

    1)关闭防火墙(每个节点) [Bash shell] 1 2 service iptables stop chkconfig iptables off 2)关闭selinux(重启生效) [Bash ...

  7. Centos7关闭防火墙与selinux

    CentOS 7.0默认使用的是firewall作为防火墙 直接关闭防火墙 systemctl stop firewalld.service #停止firewall systemctl disable ...

  8. 永久关闭防火墙和selinux

    临时关闭selinux: setenforce 0    //设置SELinux 成为permissive模式 彻底禁用selinux: 使用root用户,vim /etc/sysconfig/sel ...

  9. linux关闭防火墙及selinux

    RHEL6.5 查看linux防护墙状态: service iptables status 关闭linux防火墙: 1)永久关闭,重启后生效 开启: chkconfig iptables on 关闭: ...

随机推荐

  1. django+uwsgi+nginx数据表过大引起"out of memory for query result"

    昨天负责的一个项目突然爆“out of memory for query result”. 背景 项目的数据表是保存超过10m的文本数据,通过json方式保存进postgres中,上传一个13m的大文 ...

  2. java的数组和arraylist

    1.数组 1.0   一开始就错了 int a[8];   //没有像C在内存中开辟了8个区域 改: int a[] = {1,2,3} ; System.out.println(a.length); ...

  3. url和资源的再理解

    元数据管理系统中, 确实是所有的静态资源都放在WebContent 不在dgs这个主项目中,通过url访问了 下面的这个项目在dgs中

  4. Python网络_TCP/IP简介

    本章将介绍tcp网络编程,更多内容请参考:Python学习指南 Socket是网络编程的一个抽象概念,通常我们用一个Socket表示"打开了一个网络连接",而打开一个Socket需 ...

  5. 模拟实现memcpy 与 memmove

    模拟实现memcpy 与 memmove 1.str系列的函数只能处理字符串——>必须带有'\0'2.memcpy内存处理函数:不涉及'\0',需要包含头文件 string.h3.source的 ...

  6. 安装Redis的PHP扩展

    1.安装phpize(php如果升级到php7,这步会报错,报错参考:https://www.cnblogs.com/clubs/p/10091103.html) yum install php-de ...

  7. deque/defaultdict/orderedict/collections.namedtuple()/collections.ChainMap() 笔记

    关于deque的使用 collections.deque([list[, max_length]]) # 不限定长度,可随意添加没有上限 >>> from collections i ...

  8. C++Builder XE7 中“匿名”方法实现

    class TMyProc : public TCppInterfacedObject<TThreadProcedure> { private: String p1; String p2; ...

  9. spring与activemq(三种消息监听方式)

    1.3     消息监听器MessageListener 在Spring整合JMS的应用中我们在定义消息监听器的时候一共可以定义三种类型的消息监听器,分别是MessageListener.Sessio ...

  10. openwrt 无线中继

    参考: https://wiki.openwrt.org/doc/recipes/relayclient 该方法可以实现中继AP,而不需要AP(WDS)模式.中继后,相当于该路由所有的LAN口以及AP ...