Home > OS >  How to make a virtual machine connected to the Internet
How to make a virtual machine connected to the Internet

Time:09-27


As is known to all, Linux as an open source operating system, we can be sent to us directly by modifying the related documents, the purpose of the
How to connected to the Internet?
The first input ifconfig
See your first network name, mine is ens32 ens32 so the following is used in place of the virtual interface, this step is to let us find we should edit name
And then modify the configuration files of the network card, such as/etc/sysconfig/network - scripts/ifcfg - ens32
Add the following four lines

IPADD two * * * * (here by readers to set up the IP address)

NETMASK=* * * * * (based on IP address Settings subnet mask)

GATEWAY=* * * * * (set GATEWAY)

DNS1=114.114.114.114 (generally dns114)

Run systemctl restart network, virtual machine at this time should be able to access network,

From a new operation of, if there is improper operation of the bosses, please point it out oh

CodePudding user response:

The first!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

Virtual machine is not clear what the system, networking also didn't say external public or the host's private network, based on the different internal system have different network configuration, virtual machine external first configured networking way
1, bridging the host network: this virtual machine configuration of the network need according to the host of the private network address with the same private network can access the Internet or directly in the DHCP automatically assigned
2, NAT model connected to the host network: this is internal map configuration of virtual machine tools, can be the default DHCP automatically assigned can access the Internet
3, host - only mode (this only and host communication each other, can't share the host's Internet network)
  • Related