0

I have a service running on CentOS 7 in Oracle VM Virtual Box, but I can't ping the IP I configured in CentOS from windows.

I tried:

  • Disabling windows firewall
  • Changing network adapter to bridged mode
  • Setting the static IP in centOS to the IP of the Virtual Box. Host-Only network adapter in Windows.

I can ping my windows box from the CentOS virtual machine though. Any ideas?

3 Answers 3

1

I set adapter to bridged. Changed the IP to one a subnet of the adapter on the host server. Changed gateway to server gateway. Bounced services and was able to ping.

The issue was that Cent OS was trying to connect through an unused NIC. Can't believe I didn't see it before.

0

It is possible that the firewall on CentOS is blocking the ICMP Ping requests. To check if there is a rule in place, you can run (as sudo) iptables -L You want to look at the chain labeled INPUT and see what policy is set. If it is set to DENY, then unless there is a rule specifically allowing ping requests, it will get dropped.

To quickly disable the firewall to check if this is the issue, you can run (as sudo) iptables -P INPUT ACCEPT. But be warned, this will allow everything in without an explicit rule denying it. You can set the policy back to drop after troubleshooting iptables -P INPUT DROP.

To allow ping to be responded to, you will need to add a new rule such as described here: https://www.cyberciti.biz/tips/linux-iptables-9-allow-icmp-ping.html But these changes will exist only until next reboot unless you have a method for maintaining persistent iptables rules across reboots.

3
  • I think CentOS blocks ICMP by default.
    – Stephen C
    Feb 18, 2017 at 23:52
  • @StephenC. Default rule on CentOS 7.2 is ACCEPT icmp -- anywhere anywhere
    – fpmurphy
    Feb 19, 2017 at 5:24
  • It was set to accept pings.
    – shelum
    Feb 21, 2017 at 15:10
0

Make sure sshd service is running on Centos 7.

service sshd start

1
  • 3
    How would starting ssh affect ping results?
    – Jeff Schaller
    Jun 13, 2018 at 18:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .