CentOS7.3 下开放防火墙的端口

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

  • 1:关闭firewall:

    systemctl stop firewalld.service

    systemctl disable firewalld.service

    systemctl mask firewalld.service

  • 2、安装iptables防火墙

    yum install iptables-services -y

  • 3.启动设置防火墙
      systemctl enable iptables
      systemctl start iptables
  • 4.查看防火墙状态
      systemctl status iptables
  • 5.编辑防火墙,增加端口

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

    :wq! #保存退出

  • 6.重启配置,重启系统

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

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

原文地址:https://www.cnblogs.com/EWEADN/p/10016017.html

时间: 2024-08-30 07:50:35

CentOS7.3 下开放防火墙的端口的相关文章

iptables下开放ftp连接端口

iptables下开放ftp连接端口 转载 2014年04月19日 10:04:27 2275 iptables 就是linux系统的防火墙,很多人安装iptables之后重启服务器发现网站无法访问,ftp无法连接.关闭iptables之后网站和ftp服务器都能正常访问,但是为了服务器的安全,不建议关闭防火墙. 要想配置好iptables让ftp服务器正常访问,我们首先要了解一下ftp服务器的工作机制. ftp协议是一个简单.保密性差(明码)的tcp协议,它的工作原理是客户端先连服务器端的21端

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

systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体. 启动一个服务:systemctl start firewalld.service 关闭一个服务:systemctl stop firewalld.service 重启一个服务:systemctl restart firewalld.service 显示一个服务的状态:systemctl status firewalld.service 在开机时启用一个服务:systemctl

CentOS7下Firewall防火墙配置用法详解

官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide/sec-Using_Firewalls.html#sec-Introduction_to_firewalld1 修改防火墙配置文件之前,需要对之前防火墙做好备份 重启防火墙后,需要确认防火墙状态和防火墙规则是否加载,若重启失败或规则加载失败,则所有请求都会被防火墙拦截 1 2 3 4 5 6 7

CentOS 7通过Firewall开放防火墙端口

发现在CentOS 7上开放端口用iptables没效果(或者是sodino没找到正确的命令,传说Centos7 下默认的防火墙是 Firewall,替代了之前的 iptables)- 使用firewall-cmd开放端口则立即就生效了.见下操作: 1 2 3 4 5 6 7 firewall-cmd --state //查看运行状态 // 开放1024的端口 firewall-cmd --add-port=1024/tcp permanent // 重载生效刚才的端口设置 firewall-c

CentOS 7 开放防火墙端口命令

CentOS 7 开放防火墙端口 命令 最近公司新的server要求用CentOS7, 发现以前CentOS 6 系列中的 iptables 相关命令不能用了,查了下,发现Centos 7使用firewalld代替了原来的iptables. 使用方法如下: >>> 关闭防火墙 systemctl stop firewalld.service             #停止firewallsystemctl disable firewalld.service        #禁止firew

CentOS 7 开放防火墙端口

我:最近在使 CentOS 7时发现在本地不能访问linux上8080端口,以上是我的操作,修改后访问成功 CentOS 7 开放防火墙端口 命令 最近公司新的server要求用CentOS7, 发现以前CentOS 6 系列中的 iptables 相关命令不能用了,查了下,发现Centos 7使用firewalld代替了原来的iptables. 使用方法如下: >>> 关闭防火墙 systemctl stop firewalld.service             #停止firew

CentOS7环境下SSH端口修改笔记

CentOS7环境下SSH端口修改笔记 说明: CentOS7服务器环境,默认SSH端口为22,考虑到安全方面问题,欲修改端口为62231(机器内网IP为192.168.1.31) ssh配置文件和iptables中端口开放配置调整时,原先的先不要移除,显式的同时打开22和62231端口,待配置完成确认62231端口访问正常后再逐个移除22端口的配置,防止配置过程中出现差错导致服务器访问不了. 一.SELinux配置修改 1.先检查SELinux状态,如果已关闭则无需相关修改 [[email p

CentOS 7 开放防火墙端口 命令(转载)

CentOS 7 开放防火墙端口 命令 最近公司新的server要求用CentOS7, 发现以前CentOS 6 系列中的 iptables 相关命令不能用了,查了下,发现Centos 7使用firewalld代替了原来的iptables. 使用方法如下: >>> 关闭防火墙 systemctl stop firewalld.service             #停止firewallsystemctl disable firewalld.service        #禁止firew

windows防火墙设置端口开放技巧

选择"打开或者关闭windows防火墙"把防火墙打开,然后选择"高级设置",选择"创建规则"来指定端口.(这里也可以在"入站规则"里选择已经存在的端口.) 指定ip开放3389端口 某新服务器,开放80.3389后,Nmap扫描结果: 禁止这4条规则 Nmap重新扫描端口,发现只剩下80,3389 参考链接: windows防火墙设置只允许指定IP访问指定端口 http://www.gzidc.org/notice/n686.