Teach you to use virtualBox to connect virtual machines to the network

First open the network settings:

Start the virtual machine and use the nmcli command to view the basic network information of the current virtual machine 

nmcli connection show

 Shown as follows:

DEVICE: is the name of the network card

Set the network acquisition method of centos7 to automatically acquire ip

nmcli connection modify enp0s3 \
connection.autoconnect yes \
ipv4.method auto
nmcli connection up enp0s3

Then we tested and found that the network was connected

Guess you like

Origin blog.csdn.net/qq_30631063/article/details/108267564