centos 防火墙 iptables firewalld SELinux
参考
相关内容
centos7 中才开始引用firewalld的概念,它是iptables的升级版,以上两者都不是真正的防火墙,都需要与内核netfilter配合使用。
Centos5、6使用iptables来管理服务器防火墙,Centos7 默认是firewalld。
SELinux是Linux一个子安全机制
本地环境

SELinux
/usr/sbin/sestatus -v # 查看SELinux状态
# 关闭SELinux:
setenforce 0 # 1.临时关闭(不用重启机器)
修改/etc/selinux/config文件将SELINUX=enforcing改为SELINUX=disabled 修改配置文件需要重启机器


firewalld
# 使用systemctl
systemctl stop firewalld.service #关闭firewalld
systemctl start firewalld.service #启动服务
systemctl restart firewalld.service #重启服务
systemctl enable firewalld.service #启用firewalld系统重启firewalld服务加载
systemctl disable firewalld.service #禁用firewalld系统重启firewalld服务不会加载
firewall-cmd --list-ports #查看已经开放的端口
firewall-cmd --zone=public --add-port=80/tcp --permanent #开启80端口:命令含义:–zone #作用域–add-port=80/tcp #添加端口,格式为:端口/通讯协议–permanent #永久生效,没有此参数重启后失效
# 使用service
service firewalld start # 开启
service firewalld restart # 重启
service firewalld stop # 关闭
# 使用firewall-cmd
firewall-cmd --state #查看状态
iptables
systemctl start iptables.service # 开启iptables防火墙的命令是
systemctl restart iptables.service # 重启iptables防火墙的命令是
systemctl stop iptables.service # 关闭iptables防火墙的命令是
systemctl status iptables.service #查看iptables防火墙状态的命令是
service iptables status # 查看防火墙状态
service iptables stop # 停止防火墙
service iptables start # 启动防火墙
service iptables restart # 重启防火墙
chkconfig iptables off # 永久关闭防火墙
chkconfig iptables on # 永久关闭后重启
安装iptables
yum list | grep iptables #查看yum源是否有iptables的安装包

yum install -y iptables.x86_64 #安装iptables.x86_64 :该安装包主要包含iptables的相关命令以及iptables的相关模块
yum install -y iptables-services.x86_64 #该安装包主要配置文件、启动或重启用的systemctl的服务


iptables-services 包含信息

centos 防火墙 iptables firewalld SELinux的更多相关文章
- CentOS防火墙iptables的配置方法详解
CentOS系统也是基于linux中的它的防火墙其实就是iptables了,下面我来介绍在CentOS防火墙iptables的配置教程,希望此教程对各位朋友会有所帮助. iptables是与Linux ...
- 关闭Linux防火墙(iptables) 及 SELinux
一.关闭防火墙 1.重启后永久性生效: 开启:chkconfig iptables on 关闭:chkconfig iptables off 2.即时生效,重启后失效: 开启:service ipta ...
- 关闭Linux中的iptables,firewalld,SELINUX
firewalld 停止firewalld服务 [root@VM_0_13_centos var]# systemctl stop firewalld 或 [root@VM_0_13_centos v ...
- CentOS防火墙iptables使用
1.1 企业安全优化配置原则 尽可能不给服务器配置外网ip ,可以通过代理转发或者通过防火墙映射.并发不是特别大情况有外网ip,可以开启防火墙服务高并发的情况,不能开iptables,会影响性能,利用 ...
- 【Linux】- CentOS 防火墙iptables和firewall
1 iptables防火墙 1.1 基本操作 # 查看防火墙状态 service iptables status # 停止防火墙 service iptables stop # 启动防火墙 s ...
- linux设置iptables防火墙的详细步骤(centos防火墙设置方法)
CentOS系统也是基于linux中的它的防火墙其实就是iptables了,下面我来介绍在CentOS防火墙iptables的配置教程,希望此教程对各位朋友会有所帮助. iptables是与Lin ...
- 解决宿主机不能访问虚拟机CentOS中的站点 | 更新CentOS防火墙设置开启80端口访问
前阵子在虚拟机上装好了centos6.0,并配好了nginx+php+mysql,但是本机就是无法访问.一直就没去折腾了. 具体情况如下 1.本机能ping通虚拟机 2.虚拟机也能ping通本机 3. ...
- CentOS 7.0如何安装配置iptables和seLinux以及firewalld
一.配置防火墙,开启80端口.3306端口 CentOS .0默认使用的是firewall作为防火墙,这里改为iptables防火墙. .关闭firewall: systemctl stop fire ...
- ifconfig 命令,改变主机名,改DNS hosts、关闭selinux firewalld netfilter 、防火墙iptables规则
ifconfig 命令用于查看网络相关的命令: 安装:yum install net-tools -y ifdown eth_name 关闭网卡 ifup eth_name 开启网卡 配 ...
随机推荐
- iview响应式布局
我想说,我要被逼成前端了. 之前没接触过响应式,这两天和另一位前端程序媛小小的研究了下.做了一个小例子,记录一下,方便以后使用. <template> <div> <Ro ...
- Codeforces #499 E Border ( 裴蜀定理 )
题目链接 题意 : 给出 N 种纸币.并且给出面值.每种纸币的数量可以任选.问你得出来的数在 k 进制下.末尾位的数有多少种可能.输出具体方案 分析 : 纸币任意选择组成的和 可以用一个一次多项式来表 ...
- python基础之流程控制
流程控制之----if 流程控制,是指程序在运行时,个别的指令(或者是陈述.子程序)运行或者求值的顺序.人生道路上的岔口有很多,在每个路口都是一个选择,在每个路口加上一个标签,选择哪个就是满足哪个条件 ...
- 按下enter触发事件
原理:按下enter的事件属于键盘事件,我们可以先用下面函数来获取enter的键码(键盘上的按键都有各自的键码),通过这个键码可以来判断按下的是哪个键 document.addEventListene ...
- JavaWeb_(session和application)用户登录注册模板_进阶版
用户登录注册模板_基础版 传送门 用户登录注册模板进阶版 添加了获得获得当前登录用户信息及存储登录人数 用户登录后,在首页.注册页.登录页显示登录用户信息和存储登录人数信息 目录结构 <%@pa ...
- C_clock()测试代码(循环)运行时间
clock() 传送门(百度百科) clock()是C/C++中的计时函数,而与其相关的数据类型是clock_t.在MSDN中,查得对clock函数定义如下: clock_t clock(voi ...
- C++入门经典-例4.8-同名的全局变量和局部变量
1:代码如下: // 4.8.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <iostream> using ...
- 使用JS生成HTML标签,以达到母板页的效果
前台页面 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1. ...
- leetcode-easy-design-384 Shuffle an Array
mycode class Solution(object): def __init__(self, nums): """ :type nums: List[int] &q ...
- [C#菜鸟]C# Hook (三) Windows常用消息大全
表A-1 Windows消息分布 消息范围 说 明 0 - WM_USER – 1 系统消息 WM_USER - 0x7FFF 自定义窗口类整数消息 WM_APP - 0xBFFF 应用程序自定义消 ...