Configure centos7 network

Turn on the virtual machine
Configure the network card

vi /etc/sysconfig/network-scripts/ifcfg-eth0

Modify the relevant configuration pay attention to modify HWADDR, UUID, IPADDR, GATEWAY
Insert picture description here

NAME=ens33
UUID=99ae368f-6443-42e7-b978-9f6e0e791c3a
DEVICE=ens33
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.92.12
NETMASK=255.255.255.0
GATEWAY=192.168.92.2
DNS1=233.5.5.5
DNS2=8.8.8.8

Get IPADDR
Insert picture description here
Insert picture description here
Insert picture description here

Restart the network service.

service network restart

To verify whether the network configuration is successful, first ping 192.168.1.1 and
Insert picture description here
try ping www.baidu.com from the external network
Insert picture description here

Guess you like

Origin blog.csdn.net/G_whang/article/details/111461611