Because you are using a mobile network, that is, mobile provides a network cable and dial-up Internet access. I installed ubuntu11.04 on the virtual machine. It is currently the latest version! As a result, you want to access the Internet on both the host and virtual machine. I checked a lot of information on the Internet, but I was not clear about it. On the basis of these materials, I have been doing things for a long time. Fortunately, I finally got it done! Next, let's take a look at my setup steps, hoping to help you!
========================================================== =========== Bridge Mode ======================================== ======================================
1. Set the network under the virtual machine to bridge:
2. Set the broadband connection attributes:
The system automatically sets "Local Connection" to 192.168.0.1. Note that this setting will take effect only after the connection is disconnected and restarted!
3. Ubuntu network settings:
Sudo ifconfig eth0 192.168.0.x netmask 255.255.255.0, where X can be 2 ~ 254
Sudo route add default GW 192.168.0.1 and set the default gateway. At this time, Ping 192.168.0.1 and you will be able to ping it! In fact, at this time, I am connected to the Internet. If you ping Baidu's IP address, you can only ping the IP address, not the domain name, because the DNS server is not installed yet.
Sudo gedit/etc/resolv. conf, set the DNS server
Save. After restarting Ubuntu, you should be able to access the Internet!
========================================================== ========================================================== ======================================
========================================================== ========================================================== ======================================
A QQ Group created by myself! This article mainly discusses Linux C language, shell script, and driver development. You are welcome to join us. First of all, I declare that my skills are good .... Haha
QQ: 213622826
========================================================== ========================================================== ======================================