Today, a centos (free RedHat) is installed on the VMware Server. It is a clone version of little red hat, which corresponds to the version of Little Red Hat). The IP address is not set during installation, generally, the nic ip address of centos is stored in the file. The configuration file is stored in/etc/sysconfig/network-scripts,
The names are ifcfg-eth0, ifcfg-eth1 .... if you have a network card, there is only one ifcfg-eth0 file, if you have two or more of the network card, there will be a ifcfg-eth1, ifcfg-eth2 and other files.
File structure:
Device = eth0 // specify the device name
Onboot = Yes // whether to start the application
Bootproto = static // static Startup Type (default DHCP)
Ipaddr = 192.168.0.77 // ip address
Netmask = 255.255.255.0 // Subnet Mask
Gateway = 192.168.0.1 // Gateway
Steps:
1. VI/etc/sysconfig/network-scripts/ifcfg-teh0 (you can also set it through Administrative Tools setup or netconfig command)
2. Restart the network service network restart.
To connect to the Host: you also need to configure the XP host, set it to host-only mode on Vmware, change the vmnet1 IP address in XP to 192.168.0.1, and change the Linux centos IP address to 192.168.0.77.
Internet sharing settings: in XP, modify the network attribute of the first virtual network card to share the Internet (properties-> advanced-> select "allow other network users to connect through the Internet connection of this computer ") will automatically change vmnet1 to 192.168.0.1, Linux centos will be able to access the Internet
In centos, you can connect to SSH or ping the gateway.
However, when you ping the Internet, Ping: Unknown host XXX. xxxxxx. Xxxxx is missing.
Check the resolv. conf file.
VI/etc/resolv. conf
Add nameserver 192.168.0.1