#用ping命令随便ping一下那个网站,如果有回应就说明能上网例如下面的例子
[root@localhost ~]# ping -c 5 www.baidu.com
PING www.a.shifen.com (180.97.33.107) 56(84) bytes of data.
64 bytes from 180.97.33.107: icmp_seq=1 ttl=54 time=30.8 ms
64 bytes from 180.97.33.107: icmp_seq=2 ttl=54 time=31.5 ms
64 bytes from 180.97.33.107: icmp_seq=3 ttl=54 time=31.8 ms
64 bytes from 180.97.33.107: icmp_seq=4 ttl=54 time=30.5 ms
64 bytes from 180.97.33.107: icmp_seq=5 ttl=54 time=30.7 ms
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 13078ms
rtt min/avg/max/mdev = 30.528/31.106/31.846/0.550 ms
ping www.baidu.com