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

  • 228 个用户发现这个很有用
这个答案有用吗?

相关文章

如何远程Linux服务器/VPS

以CentOS系统为例,注意:登录信息请通过交付邮件查找 1. 安装SSH工具,如Putty、Termius等 2....

Ubuntu 如何修改远程端口

1. ssh登录服务器   2. 输入:vi /etc/ssh/sshd_config   3. 找到Port这个字段,后面的数字就是端口号   4....

Debian 如何修改远程端口

1. ssh登录服务器   2. 输入:/etc/init.d/sshd restart sshd   3. 找到Port这个字段,后面的数字就是端口号   4....

Esxi如何修改远程端口

1. 修改SSH配置文件 vi /etc/ssh/sshd_config   2. 复制并修改应用的端口配置文件 cp /etc/services...

CentOS 7、8 防火墙常用命令

关闭防火墙 systemctl stop firewalld   开启防火墙 systemctl start firewalld   关闭开机启动 systemctl...