I. Configuration of the network
1. View MAC Address: The command to view IP information in Centos 7 has changed.
IP addr
2. Modify the network configuration to open the VM virtual machine's network settings.
The above information is counted:
IP address in: 192.168.222.128 to 192.168.222.254 choose one.
Subnet Mask: 255.255.255.0
Gateway 192.168.10.2
Broadcast address: 192.168.10.255
DNS 8.8.8.8
(2) Start to modify the network configuration file
cd/etc/sysconfig/network-scripts/ls
See if there's ifcfg-eno16777736 or something like that.
If you have this file, start editing the content.
Modify or add code
bootproto="Static"#获取IP的方式 as static ipaddr="192.168.10.128"#在地址池中选定IP之后写在这里NETMASK="255.255.255.0"#子网掩码GATEWAY="192.168.10.2"#网关BROADCAST=192.168.10.255#子网广播地址DNS1="8.8.8.8"#DNS # Other Basics do not need to be modified.
The configuration is now basically complete.
(3) Restart Network Service
Systemctl Restart Network.service
Try Ping www.baidu.com.
Centos 7 comes with an SSH service, so this machine directly connects to the IP you set by using the putty directly to use the default port of 22
Eg: My IP is: 192.168.10.128
It's done.
Configuration of Centos 7 network and SSH in virtual machines