Linux服务器防火墙的普遍实际操作包含一般的服务器防火墙运行/终止,端口号打开设置,端口号进到/撤出设定等有关作用。因为不一样Linux桌面操作系统中采用的防火墙软件不一样,因而我还在此梳理此文本文档,以幫助您快速查询。

服务器防火墙较为。

以防火墙软件为数据库索引,应用防火墙软件的Linux桌面操作系统如下所示表所显示:

firewall-cmd,适用centos7。iptables,适用centos6。

一般必要条件。

一般来说,在实际操作服务器防火墙时,必须以网站管理员的真实身份实行命令。本文本文档中的全部系统命令实例都根据得到系统软件访问权限的前提条件。除此之外,文中中的全部命令都以端口号80为例子。

服务器防火墙cmd软件。

查看防火墙情况firewall-cmd --state打开服务器防火墙systemctl start firewalld关闭防火墙systemctl stop firewalld设定开机运行systemctl enable firewalld禁止使用开机运行sytemctl disable firewalld重新启动服务器防火墙firewall-cmd --reload对外开放服务器防火墙端口号firewall-cmd --permanent --add-port=80/tcpfirewall-cmd --reload 关闭防火墙端口号firewall-cmd --permanent --remove-port=80/tcpfirewall-cmd --reload 查看防火墙标准firewall-cmd --list-all

Iptables软件

查看防火墙情况firewall-cmd --state打开服务器防火墙service iptables start关闭防火墙service iptables stop设定开机运行chkconfig iptables on禁止使用开机运行chkconfig iptables off重新启动服务器防火墙service iptables restartd对外开放服务器防火墙端口号/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT /etc/init.d/iptables save service iptables restart 关闭防火墙端口号/sbin/iptables -I INPUT -p tcp --dport 端口 -j DROP /etc/init.d/iptables save service iptables restart 查看防火墙标准/etc/init.d/iptables status

评论(0条)

刀客源码 游客评论