由于用户的增长,需要将服务器迁移到新购买的阿里云ECS上。
购买完ECS之后 尝试安装环境,发现连不上外部网络。
开始检查问题:
首先:ping 91bangtu.com 发现ping不通
[root@iZ2zeisksgn4j ~]# ping 91bangtu.com
ping: 91bangtu.com: Name or service not known
其次 通过一下命令查看问题
[root@iZ2zeisksgn4ju7w0dgsh0Z ~]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 172.17.111.253 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0
172.17.96.0 0.0.0.0 255.255.240.0 U 0 0 0 eth0
[root@iZ2zeisks ~]# cat /etc/resolv.conf
options timeout:2 attempts:3 rotate single-request-reopen
; generated by /usr/sbin/dhclient-script
nameserver 100.100.2.136
nameserver 100.100.2.138
[root@iZ2zeisks ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)
[root@iZ2zeisks ~]# iptables -nL
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
[root@iZ2zeisks ~]# ping
Usage: ping [-aAbBdDfhLnOqrRUvV64] [-c count] [-i interval] [-I interface]
[-m mark] [-M pmtudisc_option] [-l preload] [-p pattern] [-Q tos]
[-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp_option]
[-w deadline] [-W timeout] [hop1 ...] destination
Usage: ping -6 [-aAbBdDfhLnOqrRUvV] [-c count] [-i interval] [-I interface]
[-l preload] [-m mark] [-M pmtudisc_option]
[-N nodeinfo_option] [-p pattern] [-Q tclass] [-s packetsize]
[-S sndbuf] [-t ttl] [-T timestamp_option] [-w deadline]
[-W timeout] destination
没有发现具体问题。
最后去阿里云官网检查配置: 实例-》选择安全组
查看安全组类型为 企业级安全组
查看具体的出入口端口限制:
自己认为这样的出入口限制应该没有问题。
结果测试的时候还是不行。没有办法只能给阿里云提交工单。
回复之后才知道,企业级安全组 必须要出入口全部开放才行。
设置如下:(必须选择全部,要不然所有端口都是有问题的!!!)
设置完毕之后 可以正常ping通了。