iptables

存在以下两种方式:

一、service方式

查看防火墙状态:

[root@centos6 ~]# service iptables status

iptables:未运行防火墙

开启防火墙: [root@centos6 ~]# service iptables start

关闭防火墙: [root@centos6 ~]# service iptables stop

二、iptables方式

先进入init.d目录,命令如下:

[root@centos6 ~]# cd /etc/init.d/

[root@centos6 init.d]#

然后 查看防火墙状态:

[root@centos6 init.d]# /etc/init.d/iptables status

暂时关闭防火墙:

[root@centos6 init.d]# /etc/init.d/iptables stop

重启iptables:

[root@centos6 init.d]# /etc/init.d/iptables restart

selinux

临时生效:  getenforce  0

永久生效:  改配置文件  /etc/sysconfig/selinux

  1. [root@oldboy /]# vi /etc/sysconfig/selinux
  2. SELINUX=enforcing 改成 disabled
  3.  
  4. [root@oldboy /]# cat /etc/sysconfig/selinux
  5.  
  6. # This file controls the state of SELinux on the system.
  7. # SELINUX= can take one of these three values:
  8. # enforcing - SELinux security policy is enforced.
  9. # permissive - SELinux prints warnings instead of enforcing.
  10. # disabled - No SELinux policy is loaded.
  11. SELINUX=disabled
  12. # SELINUXTYPE= can take one of these two values:
  13. # targeted - Targeted processes are protected,
  14. # mls - Multi Level Security protection.
  15. SELINUXTYPE=targeted

iptables防火墙和selinux的更多相关文章

  1. 关闭SELinux和iptables防火墙

    1.关闭SELinux: 编辑SELinux配置文件: [root@Redis selinux]# vim /etc/selinux/config 修改SELINUX配置项为disable SELIN ...

  2. 2-10~2-11 配置iptables防火墙增强服务 selinux简单讲解

    学习一个服务的过程: 1.此服务器的概述:名字,功能,特点,端口号 2.安装 3.配置文件的位置 4.服务启动关闭脚本,查看端口 5.此服务的使用方法 6.修改配置文件,实战举例 7.排错(从下到上, ...

  3. Centos7 iptables firewalld防火墙与selinux配置

    一.iptables防火墙 1.基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 service ...

  4. Linux关闭防火墙、SELinux

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

  5. linux关闭防火墙及selinux

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

  6. Linux学习笔记 --iptables防火墙配置

    iptables防火墙配置 一.防火墙简介 1.功能: 1)通过源端口,源IP地址,源MAC地址,包中特定标记和目标端口,IP,MAC来确定数据包是否可以通过防火墙 2)分割内网和外网[附带的路由器的 ...

  7. iptables防火墙配置

    iptables防火墙配置 一.防火墙简介 1.功能: 1)通过源端口,源IP地址,源MAC地址,包中特定标记和目标端口,IP,MAC来确定数据包是否可以通过防火墙 2)分割内网和外网[附带的路由器的 ...

  8. Centos7下安装iptables防火墙

    说明:centos7默认使用的firewalld防火墙,由于习惯使用iptables做防火墙,所以在安装好centos7系统后,会将默认的firewall关闭,并另安装iptables进行防火墙规则设 ...

  9. linux防火墙和SELinux

    1. 关闭防火墙 永久性生效 开启:chkconfig iptables on 关闭:chkconfig iptables off 即时生效 开启:service iptables start 关闭: ...

随机推荐

  1. RabbitMQ发布订阅实战-实现延时重试队列

    RabbitMQ是一款使用Erlang开发的开源消息队列.本文假设读者对RabbitMQ是什么已经有了基本的了解,如果你还不知道它是什么以及可以用来做什么,建议先从官网的 RabbitMQ Tutor ...

  2. redis(四))——多实例化——实现主从配置

    引言 redis是一个key-value存储系统. 和Memcached类似,它支持存储的value类型相对很多其它,包含string(字符串).list(链表).set(集合)和zset(有序集合) ...

  3. 【cl】在代码中查找系统页面中的代码方法

    页面链接http://192.168.2.51:8080/xxcb1/xxbs/action/handling!view.action?toId=402882ae4e7d1761014e877fb22 ...

  4. iOS 8 UI布局 AutoLayout及SizeClass(二)

    一.新特性Size Class介绍 随着iOS8系统的公布,一个全新的页面UI布局概念出现,这个新特性将颠覆包含iOS7及之前版本号的UI布局方式,这个新特性就是Size Class. Size Cl ...

  5. VMware workstation虚拟机不能联网解决方法

    以备后用. 第一步:先设置VMware的编辑——虚拟网络编辑器,启用VMnet8,NAT模式,如下图所示. 其实就是VMware默认的设置,无须更改,如果不小心改了,点击还原默认设置. 第二步:虚拟机 ...

  6. 错误: su: 无法设置组: 不允许的操作

    到 /bin目录下,用ls -l 看下su文件的权限是不是rwxr-xr-x或者-rwxrwxrwx 执行这条命令chmod ug+s su

  7. 各种JSON的maven引用

    一.jackjson maven <jackjson.version>2.8.8</jackjson.version> <dependency> <group ...

  8. 网络:万维网(WWW)

    ylbtech-网络:万维网(WWW) www (万维网缩写)同义词 万维网一般指www(万维网缩写)WWW是环球信息网的缩写,(亦作“Web”.“WWW”.“'W3'”,英文全称为“World Wi ...

  9. ffmpeg实现

    最近做一个小项目,要在线播放录制的 MP4 视频,想开源的 flash player 或 html 5 可以播放.可,虽然 MP4 是 H.264 编码,但就是播放不了.可能是封装方式(PS 方式)不 ...

  10. KAFKA 调优

    KAFKA 调优 最近要对kafka集群做调优,就在网上看了些资料,总结如下. 我们的kafka版本是0.10.1.0. 机器配置是40G内存,300G硬盘. 一共有3台机器组成一个小的集群. Kak ...