CentOS 7.0 关闭防火墙

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

1、关闭firewall:
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

2、iptables防火墙(这里iptables已经安装,下面进行配置)
vi/etc/sysconfig/iptables #编辑防火墙配置文件
# sampleconfiguration for iptables service
# you can edit thismanually or use system-config-firewall
# please do not askus to add additional ports/services to this default configuration
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT[0:0]
:OUTPUT ACCEPT[0:0]
-A INPUT -m state--state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -jACCEPT
-A INPUT -i lo -jACCEPT
-A INPUT -p tcp -mstate --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -jACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080-j ACCEPT
-A INPUT -j REJECT--reject-with icmp-host-prohibited
-A FORWARD -jREJECT --reject-with icmp-host-prohibited
COMMIT
:wq! #保存退出

时间: 2024-08-05 05:25:43

CentOS 7.0 关闭防火墙的相关文章

CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙

CentOS 7.0 关闭firewalld防火墙指令 及更换Iptables防火墙 时间:2014-10-13 19:03:48  作者:哎丫丫  来源:哎丫丫数码网  查看:11761  评论:2 service firewalld stop 1. Disable Firewalld Service. [root@rhel-centos7-tejas-barot-linux ~]# systemctl mask firewalld 2. Stop Firewalld Service. [ro

CentOS 7和CentOS 6如何关闭防火墙

CentOS6.5查看防火墙的状态: $service iptable status显示结果:[[email protected] ~]$service iptable statusRedirecting to /bin/systemctl status  iptable.service● iptable.service   Loaded: not-found (Reason: No such file or directory)   Active: inactive (dead)  --表示防

(转)CentOS 7.0关闭默认防火墙启用iptables防火墙

场景:在本地虚拟机上使用ftp软件需要进行相应的端口设置,不可避免要访问Cnetos的防火墙,默认firewall操作不方便,所以需要进行相应的替换. 1 配置防火墙,开启80端口.3306端口 1.1 配置iptables CentOS 7 默认使用firewalld来管理iptables规则,由于防火墙规则变动的情况很少,动不动态变得无所谓了.但是习惯是魔鬼,跟之前不一样,总是感觉不太习惯. systemctl disable firewalld yum remove firewalld -

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

http://www.linuxidc.com/Linux/2015-05/117473.htm 操作系统环境:CentOS Linux release 7.0.1406(Core) 64位CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤. 1.关闭firewall:systemctl stop firewalld.service #停止firewallsystemctl disable firewalld.service #禁止firewall开机

CentOS 7.0设置防火墙

CentOS 7.0默认使用的是firewall作为防火墙, 使用systemctl来管理服务和程序,包括了service和chkconfig 1.查看默认防火墙状态(关闭后显示not running,开启后显示running) [[email protected] ~]# firewall-cmd --state not running 2.检查防火墙的状态 [[email protected] ~]# systemctl list-unit-files|grep firewalld.serv

CentOS开启和关闭防火墙

CentOS Linux开启和关闭防火墙命令有两种,一种是临时的,重启即复原:另外一种是永久性的,重启不会复原. 1) 临时生效,重启后复原 开启: service iptables start 关闭: service iptables stop 2) 永久性生效,重启后不会复原 开启: chkconfig iptables on 关闭: chkconfig iptables off   对于Linux下的其它服务都可以用以上命令执行开启和关闭操作.

CentOS开启与关闭防火墙

CentOS Linux开启和关闭防火墙命令有两种,一种是临时的,重启即复原:另外一种是永久性的,重启不会复原.    1) 临时生效,重启后复原    开启: service iptables start    关闭: service iptables stop    2) 永久性生效,重启后不会复原    开启: chkconfig iptables on    关闭: chkconfig iptables off

CentOS 7.0 Firewall防火墙配置

转自:http://blog.csdn.net/qq1113130712/article/details/70156508 CentOS 7.0防火墙配置参数说明 启动停止 获取firewall状态 systemctl status firewalld.service firewall-cmd --state 开启停止防火墙 开机启动:systemctl enable firewalld.service 启动:systemctl start firewalld.service 停止:system

centOS 6.5关闭防火墙步骤

关闭命令:  service iptables stop         永久关闭防火墙:chkconfig iptables off 两个命令同时运行,运行完成后查看防火墙关闭状态         service iptables status