备案 - 控制台 退出
备案 免费注册 登录
云服务器
负载均衡
云数据库
对象存储
阿里云专题
账户问题
选购指南
付款结算
合同及发票
会员相关
账号资产
安全保障
财务相关
商标注册
备案指南
管局备案要求
前置审批说明
法律法规
上架流程
服务器问题
下架流程
重装系统
常见问题
规则说明
总则
信息安全处罚规则
首次备案
备案规则
其它问题 > Linux中iptables(防火墙)中如何打开指定的端口(CentOS6.x)
例:当修改了ssh远程连接端口,如何在iptables上放行新的端口(这里将默认22端口号修改为33端口号)。
1. [root@zzyun ~]# iptables -I INPUT -p tcp --dport 33 -j ACCEPT
1. [root@zzyun ~]# iptables -nvL
2. Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
3. pkts bytes target prot opt in out source destination
4. 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:33
5. 295 23186 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
6. 34 2310 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
7. 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
8. 2342 200K REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
9. Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
10. pkts bytes target prot opt in out source destination
11. 0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited
12. Chain OUTPUT (policy ACCEPT 15 packets, 1412 bytes)
13. pkts bytes target prot opt in out source destination
1. [root@zzyun ~]# service iptables save
2. iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
1. [root@zzyun ~]# service iptables restart
2. iptables: Setting chains to policy ACCEPT: filter [ OK ]
3. iptables: Flushing firewall rules: [ OK ]
4. iptables: Unloading modules: [ OK ]
5. iptables: Applying firewall rules: [ OK ]
1. iptables -I INPUT -p tcp --dport 80 -j ACCEPT && service iptables save && service iptables restart
这条帮助是否解决了您的问题? 已解决 未解决
Copyright © 2013-2022 idca.cn. All Rights Reserved. IDCA 版权所有 湖南冬邦云互联科技有限公司 湘ICP备13011493号-2
《中华人民共和国增值电信业务经营许可证》B1-20214635 湘公网安备43020002000199
TOP