Network configuration after vmware installs Centos7.5 core

1: The default installation of centos7.5 is the core command line version. The net-tools toolkit is no longer included, and it is changed to the iproute2 suite, so the commonly used ifconfig and route cannot be used. 2: The
new command to view ip is ip addr show input This command can see that the name of the network card is ensxxx. I am ens33 here.
3: Check the gateway address . My vmware network setting is: NAT mode. vmware -> Edit -> Virtual Network Editor -> Select vmware8(NAT) -> NAT Settings
Write picture description here
Get the gateway IP as 192.168.2.2
4: Set the ip address for the network card:
ip addr add 192.168.31.183/24 dev ens33 <-> where ens33 is your network card name
5: Add the default route
ip route add default via 192.168.2.2 <-> Change to your gateway IP
6: Add the system default gateway IP
vi /etc/sysconfig/network
add a line
GATEWAY=192.168.2.2
7: Set the DNS server address
vi /etc/resolv.conf
add the following two lines
nameserver 114.114. 114.114
nameserver 8.8.8.8
8: Configure the network card configuration file
VI/ETC/SYSCONFIG/Network-SCRIPTS/IFCFG-Device Name
This is my network configuration file content
type = ethernet
bootproto = static
proxy_method = none
browser_only = no
defRoute = y. ES
iPaddr = 192.168.2.145
network = 255.255.255.0
network = 192.168 .2.2
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=5db8b74e-9f6a-42c9-ba88-1657b7a 386e5
DEVICE=ens33
ONBOOT=yes
ZONE=public

9: Restart the network service
service network restart

Source: https://blog.csdn.net/a785975139/article/details/53023590

Guess you like

Origin blog.csdn.net/meinaozi/article/details/82316838