全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
查看: 2056|回复: 3
打印 上一主题 下一主题

[经验] 今天被iptables搞了重装3次环境

[复制链接]
跳转到指定楼层
1#
发表于 2010-7-15 18:05:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
今天申请了个vps,首先安装了一遍 删除的LNMP, 安装好后无法访问,觉得奇怪,然后重装VPS再安装了Licess的LNMP,仍然是无法访问,是连探针都无法访问的那种,并且没有显示NGINX那个错误页,想了一下会不会是防火墙开启了呢? 到论坛搜索到关闭的命令:
  1. iptables -F
复制代码



然后就能正常访问了,看来真是iptables的问题,这个公司提供的OS默认安装了iptables而且是关了几个重要的端口,再次重装VPS,把这个限制了访问的iptable的规则记录下来,大家看看:
  1. [root@hhvps ~]# iptables -L
  2. Chain INPUT (policy ACCEPT)
  3. target     prot opt source               destination
  4. RH-Firewall-1-INPUT  all  --  anywhere             anywhere

  5. Chain FORWARD (policy ACCEPT)
  6. target     prot opt source               destination
  7. RH-Firewall-1-INPUT  all  --  anywhere             anywhere

  8. Chain OUTPUT (policy ACCEPT)
  9. target     prot opt source               destination

  10. Chain RH-Firewall-1-INPUT (2 references)
  11. target     prot opt source               destination
  12. ACCEPT     all  --  anywhere             anywhere
  13. ACCEPT     icmp --  anywhere             anywhere            icmp any
  14. ACCEPT     esp  --  anywhere             anywhere
  15. ACCEPT     ah   --  anywhere             anywhere
  16. ACCEPT     udp  --  anywhere             224.0.0.251         udp dpt:mdns
  17. ACCEPT     udp  --  anywhere             anywhere            udp dpt:ipp
  18. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ipp
  19. ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTAB                                                                              LISHED
  20. ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:s                                                                              sh
  21. REJECT     all  --  anywhere             anywhere            reject-with icmp-ho                                                                              st-prohibited
  22. [root@hhvps ~]#
复制代码




顺便贴另外一个公司的,iptables没有限制访问的规则做对比:

  1. [root@high ~]# iptables -L
  2. Chain INPUT (policy ACCEPT)
  3. target     prot opt source               destination
  4. ACCEPT     udp  --  anywhere             anywhere            udp dpt:ftp-data
  5. ACCEPT     udp  --  anywhere             anywhere            udp dpt:ftp
  6. ACCEPT     udp  --  anywhere             anywhere            udp dpt:domain
  7. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:dnp
  8. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ndmp
  9. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:https
  10. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:http
  11. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:imaps
  12. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:imap
  13. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:pop3s
  14. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:pop3
  15. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ftp-data
  16. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ftp
  17. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:domain
  18. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:smtp
  19. ACCEPT     tcp  --  anywhere             anywhere            tcp dpt:ssh

  20. Chain FORWARD (policy ACCEPT)
  21. target     prot opt source               destination

  22. Chain OUTPUT (policy ACCEPT)
  23. target     prot opt source               destination
  24. [root@high ~]#
复制代码



以后如果大家安装好环境,访问自己的vps没有出现错误页,并且过十几秒才显示页面无法打开的,就很哟可能是防火墙的问题了
2#
发表于 2010-7-15 18:23:46 | 只看该作者
这个比较难搞, 我有一个地方就是搞不定。
3#
发表于 2010-7-15 18:30:12 | 只看该作者
iptables -F太麻烦了 我直接yum remove iptables
4#
发表于 2010-7-16 00:05:09 | 只看该作者
太困难了。有高人来帮帮
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-9-26 03:24 , Processed in 0.059182 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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