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

The virtual machine and the real machine bridge the Internet.

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Bridging: premise: your host must be able to access the Internet.

Virtual machine and real machine bridge: select "bridge br0" in the settings for virtual machine access mode, then restart, then configure the virtual machine ip, gateway (/ etc/sysconfig/network), dns (/ etc/resolv.conf) are all set to the same as the real machine (ip the same network segment), and then restart network. Retest: ping www.baidu.com. You can get through ping.

I. bridging mode

The most common way is to bridge. I just figured it out recently!

1. Virtual machine settings

[find

< 编辑->

Virtual Network Editor-> VMnet >

Select the bridging mode:

Bridge to the network card you choose which network card you now use as the host, you will bridge to which network card (wired or wireless)]

2. Linux configuration

First find the network segment and gateway where your host is located.

Because your linux virtual machine is on the same network segment as it.

You can configure the network with setup and edit eth0

(1) static ip settings

BOOTPROTO=static

IPADDR=192.168.1.40

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

DNS1=114.114.114.114

IPV6INIT=no

USERCTL=no

Restart the network: service netwok restart

Ping 192.168.1.1 (Gateway)

Ping www.baidu.com

You will find that you can surf the Internet.

(2) dynamic ip

I used to be lazy and found dynamic settings. You can surf the Internet!

Edit eth0

BOOTPROTO=dhcp

Restart the network and you can go online directly. The configuration is simple. But the lease term of ip is easy to change!

Convenient, long-term is not very convenient!

II. NAT mode

I know that I can restart the Internet even though I don't know much about it. But a host. It won't work if I surf the Internet again. It has something to do with the virtual network editor.

You need to find and restore the default settings. Restart. Only in this way can I surf the Internet! It's disgusting. But it wouldn't be bridged. When you only know how to NAT, you have to restore the network settings every time you turn off the computer!

Third, host-only mode

It is not connected to the external network, which is equivalent to the network created in the whole virtual machine! This is also the intranet!

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

Network Security

Wechat

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

12
Report