Solve the problem that FreeBSD cannot access the Internet in VirtualBox.

Source: Internet
Author: User

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/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.