centos7系列关闭防火墙但是端口依然无法访问

centos7.3系统,已经关闭firewalld,但是除了22端口,其余端口无法被外界访问,本地访问正常,解决步骤:
1、先开启firewalld:systemctl start firewalld
2、放通端口:firewall-cmd --zone=public --add-port=8080/tcp --permanent
3、重新加载配置文件:firewall-cmd --reload
此时测试,端口已经能够访问了,如果不需要firewall,可以再关闭,已放通端口不受影响(为什么一开始我不放通端口直接关闭firewall不行?这点有了解的大神帮忙解答下)

注:firewall依赖本机python版本,如果自己升级了python版本,需要修改firewall配置文件(实际版本号以本机实际为准,我的为2.7):
1、vim /usr/bin/firewall-cmd, 将#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es
2、vim /usr/sbin/firewalld, 将#!/usr/bin/python -Es 改为 #!/usr/bin/python2.7 -Es

原文地址:http://blog.51cto.com/11461281/2179025

时间: 2024-08-29 22:11:42

centos7系列关闭防火墙但是端口依然无法访问的相关文章

【Linux】CentOS7 打开关闭防火墙及端口

一.centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld1.firewalld的基本使用启动: systemctl start firewalld查状态:systemctl status firewalld 停止: systemctl disable firewalld禁用: systemctl stop firewalld在开机时启用一个服务:systemctl enable firewalld.service在开机时禁用一个服务:systemctl di

CentOS7打开关闭防火墙与端口的基本命令

1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status firewalld 开机禁用  : systemctl disable firewalld 开机启用  : systemctl enable firewalld 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体. 启动一个服务:

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

一.centos7版本对防火墙进行加强,不再使用原来的iptables,启用firewalld 1.firewalld的基本使用启动: systemctl start firewalld查状态:systemctl status firewalld 停止: systemctl disable firewalld禁用: systemctl stop firewalld在开机时启用一个服务:systemctl enable firewalld.service在开机时禁用一个服务:systemctl d

centos7以后关闭防火墙

centos 6.5关闭防火墙 # service iptables stop    临时关闭防火墙 # chkconfig iptables off   永久关闭防火墙 centos 7.2 关闭防火墙 从centos7 开始使用systemctl 来管理服务和程序,包括了service  chkconfig 查看防火墙状态 # systemctl list-unit-files | grep firewalld.service 或者 # systemctl status firewalld.

Centos7设置关闭防火墙

CentOS 7.0默认使用的是firewall作为防火墙,要想使用iptables必须重新设置一下. 1.关闭防火墙 [[email protected] ~]# systemctl stop firewalld.service 2.禁止防火墙开机自启 [[email protected] ~]# systemctl disable firewalld.service 3.安装iptables service yum -y install iptables-services 4.修改防火墙配置

centos7下关闭防火墙、selinux、挂载光盘和设置ip

使用命令修改ip地址的方法:[[email protected]~]#vi /etc/sysconfig/network-scripts/ifcfg-ens33按i可以添加修改内容ONBOOT="no"改成yes 开启网卡BOOTPROTO="dhcp" 改成none或staticIPADDR=192.168.159.129 NETEWAY=255.255.255.0GATEWAY=192.168. 159.1DNS1=8.8.8.8重启网卡服务[[email pr

Linux CentOS7 开启80,443端口外网访问权限

一.查看系统防火墙状态(如果返回 running 代表防火墙启动正常) 1 firewall-cmd --state 二.开启端口外网访问 1.添加端口 返回 success 代表成功(--permanent永久生效,没有此参数重启后失效) 1 firewall-cmd --zone=public --add-port=80/tcp --permanent 2 firewall-cmd --zone=public --add-port=443/tcp --permanent 3 4 开放多个端口

CentOS7使用firewalld打开关闭防火墙与端口

1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体. 启动一个服务:systemctl start firewalld.service关闭一个服务

莫小安 CentOS7使用firewalld打开关闭防火墙与端口

1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disable firewalld 禁用: systemctl stop firewalld 2.systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体. 启动一个服务:systemctl start firewalld.service关闭一个服务