Setting IP for CentOS7#
Experimental Environment:#
- CentOS7: 192.168.0.2
- Windows7: 192.168.0.100
Experimental Steps:#
-
Connect to the internet through the virtual machine (wired connection)
-
Configure the IP address of CentOS7: Complete by modifying the configuration file
Tip: Use the tab key to autocomplete commands (tab key autocompletes the unique path)
Configuration File#
File name:
ifcfg-ens33
BOOTPROTO=dhcp (automatic) or static (manual) ONBOOT=no (disable) or yes (enable) IPADDR0=ip address NETMASK0=subnet mask IPADDR1=second ip address NETMASK1=subnet mask of the second ip address