VPS侦探论坛
标题:
关于IPTABLES,为什么有些端口不能生效?
[打印本页]
作者:
muhero
时间:
2015-8-24 14:11
标题:
关于IPTABLES,为什么有些端口不能生效?
下面的配置文件中开放的非常规端口不能生效(如:2218,8883等)
服务器为新网的云5
# Generated by iptables-save v1.4.7 on Mon Aug 24 10:48:01 2015
*filter
:INPUT DROP [797:69256]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [134:17963]
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 2218 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 8883 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 20000:30000 -j ACCEPT
-A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
-A INPUT -m state --state ESTABLISHED -j ACCEPT
COMMIT
# Completed on Mon Aug 24 10:48:01 2015
复制代码
作者:
licess
时间:
2015-8-24 21:27
国内的一般都有限制先找服务商确定一下
centos的话看看是否有其他防火墙如firewalld
作者:
muhero
时间:
2015-8-24 22:27
标题:
回复 2# 的帖子
感谢回复,补充一下:
1、确认服务器未安装firewalld,服务器版本为centos 6.7
2、使用的是lnmp配置的环境,新系统配置时设置2218是有效的,后来增加8883则导致上述故障,且奇怪的是执行service iptables stop表示无效(根本不能停止)
3、问过新网技术客服,他们确认没有做限制
作者:
licess
时间:
2015-8-25 12:47
标题:
回复 3# 的帖子
规则是怎么添加的
iptables -L -n看一下
可以尝试清空iptables试试
https://www.vpser.net/security/linux-iptables.html
不能停止报什么错误
作者:
muhero
时间:
2015-8-25 17:48
1、是按照你给的教程做的
2、运行service iptables stop正常卸载,但卸载以后和没卸载一样,开放和未开放端口照旧,一直怀疑有另外的防火墙或他们有限制,但删除规则(如21端口)又能立即生效,问他们技术员回答很官方:未限制,设置问题自行解决
[root@ZWCLC6X-1x39 ~]# service iptables stop
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
复制代码
3、
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:2218
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8883
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpts:20000:3000 0
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 icmp type 8
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTAB LISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
复制代码
[
本帖最后由 muhero 于 2015-8-25 17:50 编辑
]
作者:
licess
时间:
2015-8-25 21:22
iptables这个正常,而且你上面没有firewalld,目前基本上就排除你vps上的可能性了
欢迎光临 VPS侦探论坛 (https://bbs.lnmp.com/)
Powered by Discuz! X3.4