2

I have centos 6.6 vps server. When I use command: yum update get error:

Error: Cannot find a valid baseurl for repo: base

when I check for ping and use command: ping -c4 google.com get error:

ping: unknown host google.com

or use ping -c4 62.212.252.84 command get :

4 packets transmitted, 0 received, 100% packet loss, time 12999ms

and /etc/sysconfig/network-scripts/ifcfg-eth0 is:

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=***.***.***.72
NETMASK=255.255.255.255

/etc/sysconfig/network is:

NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mohsenvps
GATEWAY=37.59.19.254
IPV6_AUTOCONF=no

also change NETWORKING_IPV6=yes to no but get same result.

and /etc/resolv.conf is

nameserver 8.8.8.8
nameserver 8.8.4.4

**Edit: ** and iptables:

target     prot opt source               destination
ACCEPT     icmp --  0.0.0.0/0            202.54.10.20         icmptype 0 state RELATED,ESTABLISHED

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0            icmptype 0
ACCEPT     icmp --  202.54.10.20         0.0.0.0/0            icmptype 8 state NEW,RELATED,ESTABLISHED
  • Can you ping 8.8.8.8? Might be a Firewall issue. Can you try temporarily disabling firewall and try again? If that doesn't work, it is a network problem. Can you ping the gateway? – mzhaase May 2 '17 at 11:09
  • @mzhaase ping both 8.8.8.8 and gateway return: 4 packets transmitted, 0 received, 100% packet loss – mohsenJsh May 2 '17 at 11:29
  • Right, then either ICMP is blocked or network is not working at all. Have you tried with disabled firewall? If it doesn't work with disabled FW and you didn't touch the network settings, I would contact support of the hoster. – mzhaase May 2 '17 at 11:30
  • @mzhaase disable firewall and still not working. and I connect to server with ssh – mohsenJsh May 2 '17 at 11:35
  • You connect to the public IP of your server via SSH? That means that networking works. Unknown host means DNS is not working. Ping 8.8.8.8 not working means ICMP is not working. It seems these are blocked. Can you post your FW configuration? – mzhaase May 2 '17 at 11:45
0

Okay so let's try to find whats going on :

  1. You can ping external IP address
  2. You cannot ping Domain name

My guess : DNS issue.

Maybe you should check whats inside /etc/resolv.conf to check nameserver ?

Another technique can be traceroute to find where packet is dropped ?

You should use TCPdump to get deeper information about DNS request and other things ?

  • ping external IP will receive 0 is it okay? – mohsenJsh May 2 '17 at 9:07
  • No, what's giving traceroute to an external IP ? I've noticed a /32 netmask is it normal ? – P0pR0cK5 May 2 '17 at 9:08
  • a /32 netmask was default when install centos – mohsenJsh May 2 '17 at 9:12
  • Yeah but, are you sure this is good ? that mean all of the bit of the IP addr is network. Maybe you should try to investigate about this ? – P0pR0cK5 May 2 '17 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.