当前位置:网站首页 / Linux / 正文

CentOS6.9添加删除指定端口

时间:2017年02月22日 | 作者 : liuhui | 分类 : Linux | 浏览: 6646次 | 评论 0

阿里云限量代金券 | 此广告位出租25元/月

CentOS 6.9添加删除指定端口方法

1、LINUX下通过命令开启允许对外访问的网络端口: 
 /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT    #8080为指定端口

/etc/rc.d/init.d/iptables save 

/etc/rc.d/init.d/iptables restart 

2、查看端口是否开放 
 /etc/init.d/iptables status

比如我现在有 2 个相同的端口,我想删除一个:

iptable.png

我可以使用

iptables -D INPUT 2


结果:

iptable2.png


推荐您阅读更多有关于“”的文章

猜你喜欢

网站分类
关注电脑博士
友情链接

分享:

支付宝

微信