centos7 not networking, configure static or dynamic ip problem

In the recently installed Centos VMware virtual machine, installed after the discovery unable to get online. Own after some agonizing, finally found a solution to the problem. The net effect is whether it is still within the IP network ping ping outside the network ip, can ping through normal. Method four steps:
The first step, we enter the / etc / sysconfig / network-scripts directory to see if the card identification,
Here Insert Picture Description
if there are messing up the network card is configured to delete and then add a can, here we choose net mode.
Here Insert Picture Description
Below Step two: VMware Lane, then click "Edit" - "Virtual Network Editor" (note that we want to start to edit an administrator) as shown below
Here Insert Picture Description
to select NET mode: If you use a static IP, do not check here "use local DHCP service IP assigned to the virtual machine" option. Then configure the subnet ip, subnet ip host ip address range may not be the same, I host ip is 192.168.1.xxx, then you can fill ip with 192.168.19.xxx, pay attention to fill in the address field (static ip ) to address pool inside, if it is dynamically allocated, then it will automatically assign the address pool inside the address , to the time the command ip addr show you can see the ip assigned.
Here Insert Picture Description

root模式下编辑静态ip:
Here Insert Picture Description
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp #可以设置为静态ip(static)
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=ens32
UUID=2e321ff3-2de4-4260-b544-ad04bee62b50
DEVICE=ens32
ONBOOT=no(动态就可以不改,静态ip的话就改为yes,表示网卡设备自动启动
----------静态ip还需要在下面填写以下内容:-------------------
GATEWAY=192.168.19.1 #这里的网关地址就是第二步获取到的那个网关地址
IPADDR=192.168.19.129 #配置ip,在第二步已经设置ip处于192.168.19.xxx这个范围,在128-254之间就行,只要不和网关相同均可;
NETMASK = 255.255.255.0 # subnet mask
DNS1 = 114.114.114.114 # dns server 1, fill in your dns server address to the network where available

Step Four: Save the configuration and reboot card services, execution service network restart
Check ip, ifconfig:
Here Insert Picture Description
checking able to ping Baidu.Here Insert Picture Description

This, it can be networked.

Released four original articles · won praise 1 · views 42

Guess you like

Origin blog.csdn.net/qq_44730311/article/details/104588304