I'm using VirtualBox on Windows 7 (host) to run a FreeBSD (guest) based web server. I`ve assigned a static ip of 192.168.80. 1 to the (virtualized) NIC which is run in bridged mode. The problem is that when I ping an external server (such as google.com) I get a No route to host error:

dimetro# ping google.com
PING google.com ( 56 data bytes
ping: sendto: No route to host

I can ping the BSD server from both another virtualized machine and my host machine and from the server, I can ping everything on the network. The router ip is

ADDENDUM: I have the following lines in /etc/rc.conf on the BSD VM to configure networking:

ifconfig_em0="inet netmask"
  • What is your IP configuration for the FreeBSD VM? Specifically, what is the default gateway and netmask set to?
    – heavyd
    Mar 2 '10 at 15:06
  • I've edited my question with that info.
    – gvkv
    Mar 2 '10 at 15:45

Solved. I didn't add the domain of the BSD VM to /etc/hosts. What I don't understand is why I need to. If I configured the NIC using dhclient, I don't need to specify the host in /etc/hosts.

  • I don't see why that should matter, either, for the problem you described. Should you have a similar problem in the future, netstat -rn will display the routing table, which will help with the diagnosis.
    – coneslayer
    Apr 9 '10 at 15:53
  • dhclient will set the hostname using the response from the dhcp server.
    – Majenko
    Apr 7 '11 at 8:43

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.