元宝提现
QQ交流群

LINUX6 7开放端口命令

[复制链接]
14 |0
悟尘 发表于 2024-5-6 15:32:24 | 显示全部楼层 |阅读模式
centos 6

1. 开放端口命令:
/sbin/iptables -I INPUT -p tcp --dport 1:65535 -j ACCEPT

2.保存:
/etc/rc.d/init.d/iptables save

3.重启服务:
/etc/init.d/iptables restart

4.查看端口是否开放:
/etc/init.d/iptables status  

1、关闭防火墙:
service iptables stop && chkconfig iptables off





centos 7

1开启防火墙
systemctl start firewalld


2开放指定端口
firewall-cmd --permanent --zone=public --add-port=1-65535/tcp

3关闭防火墙
systemctl stop firewalld

4查看端口
netstat -lntp
共收到 0 元宝
打赏榜
暂无
暂无
暂无
暂无
----
暂无
----
暂无
----
暂无
----
本站资源仅限单机架设!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表