Internet virtual machine summary

Recently reinstalled CentOS7, need to reconfigure the Internet.

NAT networking mode

If you want to use NAT networking mode, you need to ensure that the two services, and configure a virtual network adapter.

  1. Open VMware NAT Service (enabled by default)
  2. Open the VMware DHCP Service (enabled by default)
  3. 配置VMware Network Adapter VMnet8

CentOS static Internet configuration

View the card name
cmd [root@localhost ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.100.125 netmask 255.255.255.0 broadcast 192.168.100.255 inet6 fe80::572d:417f:b314:6c6c prefixlen 64 scopeid 0x20<link> ether 00:0c:29:e6:49:e4 txqueuelen 1000 (Ethernet) RX packets 11329 bytes 14180259 (13.5 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 2524 bytes 161171 (157.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
to determine the name of the NIC is ens33, direct editing ifcfg-ens33configuration text
cmd [root@localhost /]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
configuration changes to the
cmd TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no 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=2941be46-0698-478b-8fc6-7b99e7a9badd DEVICE=ens33 #开机网卡生效 ONBOOT=yes #配置静态IP模式 BOOTPROTO=static #ip地址(VMnet8 网卡同网段) IPADDR=192.168.100.125 NETMASK=255.255.255.0 #网关(VMnet8 网卡的网关) GATEWAY=192.168.100.2 DNS1=192.168.100.2 DNS2=8.8.8.8
last saved text (the text after each configuration, network cards need to restart to take effect)

[root@localhost /]# systemctl restart network

Record the process of resolving the problem

  • windown system can ping the IP centos, centos but can not ping IP system windown
    this case, whether it is the beginning of thought centos firewall blocking the packets. So it through the command
    cmd systemctl disable firewalld.service
    shut down the firewall based on the same method to ping, or run into the same problem. After taking a sub-ping, ping the gateway, we found the ping fails, then modify the gateway, on the network card instead gateway VMnet8

Guess you like

Origin www.cnblogs.com/Lollipop_Hsu/p/11260773.html