Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to make CentOS use Bridge to surf the Internet in VMware

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to make CentOS use bridging to surf the Internet in VMware". In daily operation, I believe that many people have doubts about how to make CentOS use bridging to surf the Internet in VMware. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "how to make CentOS use bridging in VMware". Next, please follow the editor to study!

How to choose the right way to surf the Internet, to put it bluntly, are the following:

To enable the virtual machine to connect to the Internet, and the external network or LAN can access the virtual machine (independent public network ip or LAN ip), use bridging mode

To make the virtual machine connect to the Internet, but do not care whether the virtual machine can communicate with the host (such as connecting to ssh), the external network can not access the virtual machine, use nat mode

To make the virtual machine unable to connect to the Internet, but need the virtual machine and host to communicate with each other, use host-only mode

The method of making centos use bridging to surf the Internet in vmware

Step 1: set up vmware

Open [Edit]-> [Virtual Network Editor] in vmware, add vmnet0, and select bridging mode. It should be noted that you need to select the "bridged" network card, select the wireless network card when using the wireless network card, and choose the wired network card when using the wired network card, as shown below:

Step 2: set up the virtual machine

Right-click on the virtual machine system, enter the * * Settings * * interface, and on the * * hardware * * tab, find * * Network Adapter * * (no hardware is added by yourself), and set it to bridging mode, as shown below. Among them, "copy physical network connection status" does not know whether to select it or not, at least it can be connected if not selected.

Step 3: configure ip within the virtual machine

Since the centos of the blogger does not have a graphical interface installed, the following is all in the form of a command line.

Vim / etc/sysconfig/network-scripts/ifcfg-eth0# open the above file, press a to enter edit mode # blogger this shows the following content device=eth0hwaddr=00:0c:29:f4:f5:d6type=ethernetuuid=36312bb1-d1ed-4702-a53c-cf19afb88c51onboot=nonm_controlled=yesbootproto=dhcp#device is the network card number, hwaddr is the mac address, type, uuid and nm_controlled these five items do not need to change # onboot is set whether to enable the network card when starting the network service, you need to change it to onboot=yes Otherwise, you will use ifup eth0 to start the network card every time. # bootproto is set to obtain ip, which can be selected as staic (static ip), dhcp (dynamic allocation), and none (not used). Even if the router is set to enable dhcp, the ip can be obtained using static ip.

1. If you use staic (static ip) to obtain ip, you need to modify the file to the following form

Device=eth0hwaddr=00:0c:29:f4:f5:d6type=ethernetuuid=36312bb1-d1ed-4702-a53c-cf19afb88c51onboot=yes # modify nm_controlled=yesbootproto=staic # modify netmask=255.255.255.0 # subnet mask, consistent with the host ipaddr=192.168.1.55 # static ip address, in the same network segment as the host, cannot be occupied by other devices, the ipgateway=192.168.1.1 # gateway is the same as the host

After that, open the following file to set up dns, otherwise you can connect to the Internet but cannot resolve the domain name.

Vim / etc/resolv.conf# this file is empty by default, so add dns. For example, nameserver 114.114.114.114nameserver 8.8.8.8#dns does not need to be consistent with the host, but it must be set, otherwise you can use ip.

Finally, restart the network service using service network restart, and the virtual machine can be connected to the network.

2. If you use dhcp (dynamic allocation) to obtain ip, you need to modify the file to the following form

Device=eth0hwaddr=00:0c:29:f4:f5:d6type=ethernetuuid=36312bb1-d1ed-4702-a53c-cf19afb88c51onboot=yes # modify nm_controlled=yesbootproto=dhcp # modify

Do not need to set dns, directly use service network restart to restart the network service, the virtual machine can be connected to the network.

At this point, the correct use of hundreds of degrees:

The correct use of Baidu

At this time, ping Baidu can already ping.

Ps: comes with a method to modify the centos language

Vim / etc/sysconfig/i18nlang= "zh_cn.utf-8" has been changed to lang= "en_us.utf-8" reboot. This is the end of the study on "how to make CentOS use bridging to surf the Internet in VMware". I hope you can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report