Megalayer教程:CentOS 6防火墙常用命令汇总

Megalayer美国服务器

Megalayer美国服务器

大家在租用Megalayer服务器时经常会遇到CentOS 6关闭防火墙和CentOS 6开启防火墙等各种情况,本文为大家整理汇总了CentOS 6防火墙常用命令。

关闭防火墙:

server iptablesd stop

开启防火墙:

server iptablesd start

保存防火墙配置:

server iptablesd save

关闭开机启动:

chkconfig iptables off

开启开机启动:

chkconfig iptables on

开通某个端口(如:2231端口):

iptables -I INPUT -p tcp –dport 2231 -j ACCEPT

iptables -I OUTPUT -p tcp –sport 2231 -j ACCEPT

阻挡某个端口(如:2231端口):

iptables -I INPUT -p tcp –dport 2231 -j DROP

iptables -I OUTPUT -p tcp –sport 2231 -j DROP

相关推荐:《Megalayer教程:CentOS 7防火墙常用命令汇总

本文来自网络,不代表Megalayer评测网立场,转载请注明出处:https://megalayer.idcspy.com/centos6-fhq.html
返回顶部