VirtualBox Linux virtual machine How to achieve "bridging" the Internet __linux

Source: Internet
Author: User
Tags get ip


Reproduced from: http://jingyan.baidu.com/article/c843ea0ba8b70677931e4adc.html


All operations of the virtual machine do not affect the real machine, even if the virtual machine crashes or the virus, so we do some of the dangerous operations can be done in the virtual machine, so how to enable virtual machines to access the network, today, in the CentOS system as an example, to tell you how to access the network in the simplest way.


1, first open the virtual machine

Right-click on the lower right corner of the network connection

Click on the network in the pop-up box

Click on the Settings screen-network-connection mode selection-Bridging network card-OK




2, open the CentOS virtual machine terminal, is the command line

Switch to root and edit the NIC file

shell#cd/etc/sysconfig/network-scripts/

shell# Vim IFCFG-ENP0S3





3, the main modification of two items:

Bootproto=dhcp

Onboot=yes

Change the two items in the configuration to the same as above, DHCP for dynamic get ip,onboot=yes for boot





4. Save and exit.

Reboot network card

Shell#service Network Restart

Or

Shell#systemctl Restart Network (CENTOS7 version command)





5, do a simple test, ping Baidu

Shell#ping www.baidu.com

As the figure, that is ping pass, means that you can access the Internet




"Note" 3rd--> 4th: Use the VI command to save, I use is: press ESC to jump to the command mode, and then: Wq Save the file and Exit VI.
5th, when the ping command succeeds, use CTRL + C (interrupt command) to exit

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.