1.cmd ipconfig /all
2. vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0C:29:13:CE:8F
TYPE=Ethernet #Network card type
UUID=9394288a-82cd-4a09-bdc8-e139726ff20b
ONBOOT=yes
NM_CONTROLLED= yes BOOTPROTO
=dhcp #Enable address protocol --static: Static protocol --bootp protocol --dhcp protocol
IPV6INIT=no
IPADDR=192.168.2.133 #Network card IP address
NETMASK=255.255.255.0 #Subnet mask
GATEWAY=192.168.2.1 #Default gateway
DNS1=192.168.2.1 #DNS server
3. service network restart restart the service
Reference: https://www.cnblogs.com/zengguowang/p/5492982.html