CentOS7 关闭firewall,启用iptables

1,关闭并停掉firewall
[[email protected] ~]# systemctl  stop firewalld.service
[[email protected] ~]# systemctl  disable firewalld.service

2,安装iptables
[[email protected] ~]# yum install iptables-services
[[email protected] ~]# systemctl  enable iptables.service
[[email protected] ~]# systemctl  restart firewalld.service
[[email protected] ~]# cat /etc/sysconfig/iptables
# sample configuration for iptables service
# you can edit this manually or use system-config-firewall
# please do not ask us 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 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT   #允许
-A INPUT -p tcp -m state --state NEW -m tcp --dport 23 -j ACCEPT
-A INPUT -p udp -m state --state NEW -m udp --dport 6970 -j DROP   #禁止
-A INPUT -p udp -m state --state NEW -m udp --dport 6971 -j DROP

#-A INPUT -j REJECT --reject-with icmp-host-prohibited
#-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
[[email protected] ~]# 

3,关闭selinux
[[email protected] ~]# setenforce 0 #使配置立即生效
[[email protected] ~]# vim /etc/selinux/config
#SELINUX=enforcing #注释掉
#SELINUXTYPE=targeted #注释掉
SELINUX=disabled #增加
时间: 2024-08-05 02:40:28

CentOS7 关闭firewall,启用iptables的相关文章

centos7 关闭firewall安装iptables并配置

一.配置防火墙,开启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/ip

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

http://www.cnblogs.com/valu/p/5649689.html 一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2.安装iptables防火墙 yum install

centos7 关闭firewall安装iptables并配置,关闭SELINUX

一.配置防火墙,开启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 #安装 显示ok以后,就表示已经安装成功,那么就

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

转载连接 http://ashui.net/archives/2015/943.html 一.配置防火墙,开启80端口.3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.service #停止firewall systemctl disable firewalld.service #禁止firewall开机启动 2.安装iptables防火墙 Linux学习,

服务器安全设置Centos7 防火墙firewall与iptables

一.>>>>>>启用centos7 iptables防火墙Centos7 防火墙firewall设置方法 我们Sinesafe在处理客户服务器Linux Centos7 64位系统里配置防火墙安全设置需要选择2种方案其中之一,最后选择了iptables防火墙. 因为在Centos 7版本里默认的防火墙是firewall,所以首先用firewall防火墙的话,下面就是配置方法: **# firewall-cmd --zone=public --add-port=8080/

Linux学习之八--关闭Firewall安装Iptables并配置

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 #编辑防火墙配置文件 # Fi

CentOS7 禁用firewall防火墙 启用iptables 步骤

一.题目:CentOS7 禁用firewall防火墙 启用iptables 步骤 二.要求:CentOS7 的防火墙默认是firewall 防火墙,现在需要启用iptables防火墙并完成常用的配置. 三.步骤: 1. 关闭firewall 1 systemctl stop firewalld.service # 停止firewall 2 systemctl disable firewalld.service # 禁止firewall 开机启动 3 systemctl status firewa

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

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

centos7 关闭默认firewalld,开启iptables

编者按: 对于使用了centos6系列系统N年的运维来说,在使用centos7的时候难免会遇到各种不适应.比如防火墙问题.本文主要记录怎么关闭默认的firewalld防火墙,重新启用iptables. 1.关闭firewalld防火墙 systemctl stop firewalld systemctl mask firewalld 2.安装iptables yum install iptables-services 3.设置开机启动 systemctl enable iptables.serv