Manually configure IP addresses in centos

Source: Internet
Author: User
Tags vmware server

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.