Iptables – Server can’t ping but it can curl only limited websites

iptablesnetworking

I have a server that is having some networking problems. The server is in its LAN where I can access it via VPN. The server can ping to any other machines in the LAN but not outside of it.

ping google.com
PING google.com (216.58.217.14) 56(84) bytes of data.
^C
--- google.com ping statistics ---
74 packets transmitted, 0 received, 100% packet loss, time 73001ms

But It can cURL to the same address:

curl google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>

Also if I want to get the wget rpm package from the internet and download it to the server to install it, it takes forever.

 curl -O ftp://195.220.108.108/linux/centos/7.3.1611/os/x86_64/Packages/wget-1.14-13.el7.x86_64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:01:25 --:--:--     

But I can get the website contents with curl:

curl http://www.rpmfind.net/linux/RPM/centos/7.3.1611/x86_64/Packages/wget-1.14-13.el7.x86_64.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /linux/RPM/centos/7.3.1611/x86_64/Packages/wget-1.14-13.el7.x86_64.html was not found on this server.</p>
</body></html>

If you are wondering about my iptables configuration I already flushed it.

sudo iptables -F

also I made selinux to be permissive:

sudo setenforce 0

But nothing makes my server reach anything outside the network. Any help will be appreciated.

Best Answer

you are clearly behind a router / firewall that does not allow ping to outside from that server. reason: you can connect to outside on dns service (you resolved the ip of google) and you can clearly connect on http(s) port aswell both these facts combined prove your connection is working fine.