Linux开放指定端口号

1.编辑系统文件

vim /etc/sysconfig/iptables

2.进入编辑页面后,增加如下内容:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT  //8080表示要开放的端口号

3.保存后退出,重启网卡服务

service iptables restart

参考:https://www.cnblogs.com/zengweiming/p/6604424.html

猜你喜欢

转载自www.cnblogs.com/romancetown/p/9367620.html