centos7关闭firewall安装iptables并配置

author author     2022-08-20     192

关键词:

一、配置防火墙,开启80端口、3306端口

CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。

1、关闭firewall:

systemctl stop firewalld.service #停止firewall

systemctl disable firewalld.service #禁止firewall开机启动

 

2、安装iptables防火墙

yum install iptables-services #安装

vi /etc/sysconfig/iptables #编辑防火墙配置文件

# Firewall configuration written by system-config-firewall

# Manual customization of this file is not recommended.

*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

-A INPUT -p icmp -j ACCEPT

-A INPUT -i lo -j ACCEPT

-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

-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 3306 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT

:wq! #保存退出

systemctl restart iptables.service #最后重启防火墙使配置生效

systemctl enable iptables.service #设置防火墙开机启动

 

二、关闭SELINUX

vi /etc/selinux/config

#SELINUX=enforcing #注释掉

#SELINUXTYPE=targeted #注释掉

SELINUX=disabled #增加

:wq! #保存退出

setenforce 0 #使配置立即生效

centos7关闭firewall安装iptables并配置(转)

http://www.cnblogs.com/valu/p/5649689.html 一、配置防火墙,开启80端口、3306端口CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。1、关闭firewall:systemctlstopfirewalld.service #停止firewallsystemctldisablefirewalld. 查看详情

转载centos7关闭firewall防火墙指令以及更换安装iptables并配置

转载连接 http://ashui.net/archives/2015/943.html 一、配置防火墙,开启80端口、3306端口CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld 查看详情

centos7关闭firewall,启用iptables

1,关闭并停掉firewall[[email protected] ~]# systemctl  stop firewalld.service[[email protected] ~]# systemctl  disable firewalld.service2,安装iptabl 查看详情

linux学习之八--关闭firewall安装iptables并配置

CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动2、安装iptables防火墙yuminstalliptables-services#安装vi/etc/s 查看详情

centos7开启iptables防火墙关闭firewall防火墙(代码片段)

一、场景介绍因服务器被GJ,删除了数据库,并索要金额。鉴于不安全性,决定开启iptables防火墙实现安全性,并将默认的firewalld卸掉。二、具体步骤安装iptableiptable-service先检查是否安装了iptablesserviceiptablesstatus安装iptablesyuminstal... 查看详情

centos7下部署iptables环境纪录(关闭默认的firewalle)

 CentOS7默认的防火墙不是iptables,而是firewall.由于习惯了用iptables作为防火墙,所以在安装好centos7系统后,会将默认的firewall关闭,并另安装iptables进行防火墙规则设定下面介绍centos7关闭firewall安装iptables,并且开启80端口、3306... 查看详情

centos7配置iptables(转)

一、防火墙配置1、检测并关闭firewall12345systemctlstatusfirewalld.service#检测是否开启了firewall systemctlstopfirewalld.service#关闭firewall sytsemctldisablefirewalld.service#禁止firewall开机自启2、检测并安装iptables 1yuminst 查看详情

如何关闭centos7上的firewall

参考技术A1、执行“systemctlstopfirewalld.service”,停止系统中的firewall服务,“systemctldisablefirewalld.service”,禁止firewall开机启动2、通过yum来安装iptables,执行命令“yuminstalliptables-services”,也可以使用命令“yum-yinstalliptables-services... 查看详情

centos7安装配置iptables笔记

1.关闭firewall#停止firewallsystemctlstopfirewall.service#禁止firewall开机启动systemctldisablefirewall.service2.安装iptables#安装iptablesyuminstalliptables-services-y#编辑防火墙文件vi/etc/sysconfig/iptables添加80和3306端口-AINP 查看详情

centos7为啥要关闭firewall防火墙

CentOS7.0默认使用的是firewall作为防火墙,使用iptables必须重新设置一下1、直接关闭防火墙systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动2、设置iptablesserviceyum-yinstalliptables-services如果要修改防火墙... 查看详情

centos7安装配置iptables防火墙

CentOs7安装配置Iptables测试环境下如果不想用centos7自带的FIREwall而用7之前版本的iptables当防火墙,这样自动加端口比较方便,可以如下方式配置:一、关闭Firewall防火墙执行以下操作:systemctlstopfirewalld.servicesystemctldisablefirewalld.service... 查看详情

centos7关闭防火墙

1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动firewall-cmd--state#查看默认防火墙状态(关闭后显示notrunning,开启后显示running)2、iptables防火墙(这里iptables已经安装,下面进行配置... 查看详情

centos7关闭防火墙

entOS7.0默认使用的是firewall作为防火墙关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动firewall-cmd--state#查看默认防火墙状态(关闭后显示notrunning,开启后显示running)   将centos设... 查看详情

centos7中使用iptables

1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动2、安装iptables防火墙#安装yuminstalliptables-services编辑防火墙配置文件vi/etc/sysconfig/iptables#sampleconfiguratio 查看详情

centos7关闭防火墙

一、配置防火墙CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。1、关闭firewall:systemctlstopfirewalld.servi(www.111cn.net)ce#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动2、安装iptables防火墙yuminstalliptabl 查看详情

centos7.3下的一个iptables配置

centos7.3默认使用的防火墙应该是firewall,而不是iptables。而我们xxmj服务器使用的是iptables防火墙。所以,在配置防火墙之前,我们需要先关闭firewall,安装iptables。查看firewall的安装和启动状态[[email protected]~]#yumlistinstalledfirewall... 查看详情

centos7.0关闭防火墙

1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动firewall-cmd--state#查看默认防火墙状态(关闭后显示notrunning,开启后显示running)2、iptables防火墙(这里iptables已经安装,下面进行配置... 查看详情

centos7安装lamp环境

一、配置防火墙,开启80端口、3306端口CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙。1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动2、安装iptables防火墙yuminstalli... 查看详情