A FreeBSD7 installed in VirtualBox in Ubuntu cannot access the Internet.
It took only half a day to find out that the problem was caused by the Internet access mode in VirtualBox.
If you select NAT to access the Internet, the client can only obtain IP addresses through DHCP.
For example, if a client in Virutalbox is installed on windows, the IP address is obtained through DHCP, And the IP address is 10.0.2.15 MASK, 255.255.255.0, and 10.0.2.2.
In VIrutalBox, use ifconfig em0 10.0.2.15 netmask 255.255.255.0 Broadcast 10.0.2.2 in another client that installs the UNIX platform .... (Very elegant ...)
In FreeBSD, you can use the following method to enable the NIC to automatically obtain IP addresses through DHCP:
Directly in rc. add ifconfig_XX = "DHCP" to the conf file. Note that "XX" refers to your network card. You can enter ifconfig-a in the term to check your network card name.
You can also:
# Echo ifconfig_em0 = "DHCP">/etc/rc. conf
.
From: http://www.pc-web.cn/1810/