跳到主要内容
帮助中心

新闻公告

产品更新、运营公告与行业观察
一手消息,第一时间同步给你

CentOS开启iptables UDP端口

若没有安装请先安装:yum?install?-y iptables

随后禁用firewalld默认防火墙:

#停止firewalld服务

systemctl stop firewalld

#禁用firewalld服务

systemctl mask firewalld

开启防火墙:systemctl start iptables.service

此处以开启UDP端口9966为例,方法有两个。

方法一,执行以下命令:

iptables -I INPUT -p UDP --dport 9966 -j ACCEPT

service iptables save

方法二,执行以下命令:

vi /etc/sysconfig/iptables

#插入下面这一行

-A INPUT -p udp -m udp --dport 9966 -j ACCEPT

#vi保存退出

#输入“:”wq

#重启iptables

service iptables restart

本文链接
返回本栏目
工单