全球主机交流论坛

标题: 今天被iptables搞了重装3次环境 [打印本页]

作者: sunday    时间: 2010-7-15 18:05
标题: 今天被iptables搞了重装3次环境
今天申请了个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没有出现错误页,并且过十几秒才显示页面无法打开的,就很哟可能是防火墙的问题了
作者: Host.HowPick    时间: 2010-7-15 18:23
这个比较难搞, 我有一个地方就是搞不定。
作者: wordpress    时间: 2010-7-15 18:30
iptables -F太麻烦了 我直接yum remove iptables
作者: 酥油茶    时间: 2010-7-16 00:05
太困难了。有高人来帮帮




欢迎光临 全球主机交流论坛 (https://443502.xyz/) Powered by Discuz! X3.4