centos8 network connection (2) IP provided, connected to the external network host

First set up the virtual machine network adapter and network editor, I see another article: " centos8 network connection (1) virtual machine network adapter and network editor settings "

1, View windows10 host of ip

2, IP set (UI interface configuration Edition) ( recommended)

Click the down arrow in the top right of your desktop, then click "Wired Settings":

 

 

 Then click on the + sign:

 

 Definition of Identity Name, to be unreasonable with other virtual machine name, Mac Address drop-down selection, Cloned Address leave it blank:

  Then switch to the "IPv4" tab, set the IP, and finally click "Add button":

 

 

 Finally, a long way:

 

 

 

Verify: ping the host and the external network:

www.baidu.com ping 
ping ping 192.168.2.101 // host here

 3, IP set (code configuration Edition)

vim编辑:       vim /etc/sysconfig/network-scripts/ifcfg-ens33

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp            //动态IP
DEFROUTE=yes
IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=ens33 UUID=dd6e993b-0830-4840-80e7-5716207ec0e4 DEVICE=ens33 ONBOOT=yes //默认联网状态为no,需要手动开启联网状态。

重启网卡生效。

nmcli c reload        //第一步:centos8重启网卡
systemctl restart NetworkManager    //第二步:centos8进行重启网络
systemctl restart network           //centos7 进行重启网络 

验证:ping宿主机与外网:

ping www.baidu.com
ping 192.168.2.101

 

Guess you like

Origin www.cnblogs.com/zhuwenjoyce/p/12311016.html