centos7关闭firewall,启用iptables

author author     2022-09-11     678

关键词:




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 #增加


本文出自 “李春利” 博客,请务必保留此出处http://990487026.blog.51cto.com/10133282/1952697

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

一、题目:CentOS7禁用firewall防火墙启用iptables步骤二、要求:CentOS7的防火墙默认是firewall防火墙,现在需要启用iptables防火墙并完成常用的配置。三、步骤:1.关闭firewall1systemctlstopfirewalld.service#停止firewall2systemctldisablefirewalld.servic... 查看详情

centos7防火墙关闭和启用iptables防火墙

操作系统环境:CentOS Linuxrelease7.0.1406(Core)64位CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动fir 查看详情

centos7.0关闭默认防火墙启用iptables防火墙

操作系统环境:CentOS Linuxrelease7.0.1406(Core)64位CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动fir 查看详情

centos7防火墙配置

CentOS7中防火墙程序主要是firewall和iptables,CentOS7中firewall服务已经默认安装好了,而iptables服务需要自己用yum install iptabes-services来安装。firewall相关的操作:1.开启防火墙systemctlstartfirewalld.service或者servicefirewalldstart2.关闭防... 查看详情

centos7.0关闭默认防火墙启用iptables防火墙

CentOS7.0关闭默认防火墙启用iptables防火墙http://www.linuxidc.com/Linux/2015-05/117473.htm操作系统环境:CentOS Linuxrelease7.0.1406(Core)64位CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。1、关闭firewall:systemctlstopfi 查看详情

centos7.0关闭默认防火墙启用iptables防火墙

本文从http://www.linuxidc.com/Linux/2015-05/117473.htm转载 操作系统环境:CentOSLinuxrelease7.0.1406(Core)64位CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。1、关闭firewall:systemctlstopfirewalld.service#停止firewa 查看详情

centos7.0关闭默认防火墙启用iptables防火墙

http://www.linuxidc.com/Linux/2015-05/117473.htm  操作系统环境:CentOS Linuxrelease7.0.1406(Core)64位CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。1、关闭firewall:systemctlstopfirewalld.service#停 查看详情

centos7.0关闭默认防火墙启用iptables防火墙

源地址:http://www.linuxidc.com/Linux/2015-05/117473.htm操作系统环境:CentOS Linuxrelease7.0.1406(Core)64位CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。1、关闭firewall:systemctlstopfirewalld.service#停止firewal 查看详情

centos7开启关闭80端口

1.centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewall1.查看已开放的端口(默认不开放任何端口)firewall-cmd--list-ports2.开启80端口firewall-cmd--zone=public(作用域)--add-port=80/tcp(端口和访问类型)--permanent(永久生效)3.重启防火墙fir... 查看详情

centos7使用firewall-cmd打开关闭防火墙与端口

一、centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld1.firewalld的基本使用启动:systemctlstartfirewalld查状态:systemctlstatusfirewalld停止:systemctldisablefirewalld禁用:systemctlstopfirewalld在开机时启用一个服务:systemctlenablefire... 查看详情

centos7使用firewall管理防火墙

一、Centos7使用firewall的管理防火墙1.firewalld基本使用  启动:systemctlstartfirewalld  关闭:systemctlstopfirewalld  状态:systemctlstatusfirewalld  开机禁用:systemctldisablefirewalld  开机启用:systemctlenablefirewalld2.配置项目  例1:... 查看详情

centos7关闭firewall安装iptables并配置

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

centos7关闭firewall安装iptables并配置

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

centos7中firewall-cmd命令

安装firewalld防火墙yuminstallfirewalld开启服务systemctlstartfirewalld.service关闭防火墙systemctlstopfirewalld.service开机自动启动systemctlenablefirewalld.service关闭开机制动启动systemctldisablefirewalld.service使用firewall-cmd命令查看状态firewall-cmd--state//runni... 查看详情

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

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

centos7中firewall-cmd命令

安装firewalld防火墙   yuminstallfirewalld 开启服务   systemctlstartfirewalld.service 关闭防火墙systemctlstopfirewalld.service 开机自动启动systemctlenablefirewalld.service 关闭开机制动启动systemctldisablefirewalld.service&n... 查看详情

centos7.0关闭防火墙

CentOS7.0默认使用的是firewall作为防火墙,这里改为iptables防火墙步骤。1、关闭firewall:systemctlstopfirewalld.service#停止firewallsystemctldisablefirewalld.service#禁止firewall开机启动firewall-cmd--state#查看默认防火墙状态(关闭后显示notrunning,开... 查看详情

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

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