1. Set up the virtual network under window
2 setting in WMware
3.4 Gateway and Linux network configuration file ifg-ens32
gateway=192.168.23.2 #此处设置网关IP
4. Set Vim/etc/sysconfig/network-scripts/ifcfg-ens32
Type=ethernet
Bootproto=static
Defroute=yes
Peerdns=yes
Peerroutes=yes
Ipv4_failure_fatal=no
Ipv6init=yes
Ipv6_autoconf=yes
Ipv6_defroute=yes
Ipv6_peerdns=yes
Ipv6_peerroutes=yes
Ipv6_failure_fatal=no
Ipv6_addr_gen_mode=stable-privacy
Name=ens32
uuid=6d0dfd75-483a-466d-8770-e906eb92226c
Device=ens32
Onboot=yes
ipaddr=192.168.23.129 #此处设置固定的IP
netmask=255.255.255.0 #此处设置掩码
ateway=192.168.23.2 #此处设置网关IP
Restart the Network service under Linux
Systemctl Restart Network.service
Linux-related network commands
ifconfig Search IP
IP route query Routing information
hos hostname Viewing hosts
p Ping Test network connectivity
Dig
host to see if DNS resolution is normal "test DNS resolution
mtr Domain uses MTR for network quality testing combined with traceroute and ping
traceroute domain name tracking the network path to the destination address
mntui Command
nmcli Command
is a very rich and flexible command-line tool. Nmcli are used in the following situations:
Device – The network interface being used
Connect – A set of configuration settings that can have multiple connections for a single device and can be switched between connections.
NIC configuration file/etc/sysconfig/network-scripts
DNS configuration file
/etc/resolv.conf
Host name configuration file
/etc/sysconfig/network
static Host name configuration file
/etc/hosts/
Network troubleshooting
Network troubleshooting follows from the bottom up to the top, from the self to the external process
1. First Look (check) the network configuration information is correct
--ip Address
--Subnet mask
--Gateway
--dns
2. Check to see if the gateway is connected
--ping Gateway IP Address
3. Check if DNS resolution is normal
--host www.baidu.com
--host www.163.com
Linux FAQ: How to configure a static IP for CentOS 7 CentOS 7 in VMware Network settings detailed description of changes in CentOS 7 system configuration: Nmtui Configuring basic network connectivity