ylsunyuan技术论坛中心

 找回密码
 注册(请使用中文注册)
搜索
热搜: 活动 交友 discuz
查看: 1354|回复: 0
打印 上一主题 下一主题

linux 防火墙放行端口

[复制链接]

124

主题

127

帖子

619

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
619
跳转到指定楼层
楼主
发表于 2015-3-27 16:51:13 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
放行3306端口:/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

关实例代码如下。 /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT #开启80端口
/sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT #开启22端口
/etc/rc.d/init.d/iptables save #保存配置
/etc/rc.d/init.d/iptables restart #重启服务
查看已开放端口
/etc/init.d/iptables status
结果如下
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
2 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80


回复

使用道具 举报

本版积分规则

QQ|Archiver|手机版|小黑屋|ylsunyuan技术论坛 ( 桂ICP备14005218号-1

GMT+8, 2024-4-28 08:09 , Processed in 0.056522 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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