CentOS 7 如何开放 3002 端口

您可以使用以下两种方法在 CentOS 7 中开放 3002 端口:

1. 使用 iptables 命令

sudo iptables -I INPUT -p tcp --dport 3002 -j ACCEPT

2. 使用 firewalld 命令

sudo firewall-cmd --zone=public --add-port=3002/tcp --permanent
sudo firewall-cmd --reload

以上命令会将 3002 端口添加到防火墙规则中,允许 TCP 流量通过该端口。在使用 firewalld 命令时,需要使用 --permanent 选项将规则永久保存到防火墙配置文件中,并重新加载防火墙以使规则生效。

CentOS 7 如何开放 3002 端口

原文地址: https://www.cveoy.top/t/topic/m9lJ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录