Linux CentOS configuration IP graphics and text detailed

Source: Internet
Author: User
Tags centos nameserver

I am a Yun-Wei, the company's computers and servers, etc. i will set fixed IP to facilitate my management. This is mainly CentOS set fixed IP address, because I was just beginning to learn Linux encountered a second challenge problem, if I do not fix it I can not move forward.

Demo Environment
VMware8 + Linux CentOS 6.2 x32

Set IP, Web site, DNS
1, modify the network card configuration, edit
#vi/etc/sysconfig/network-scripts/ifcfg-eth0

Device= "Eth0"
Onboot=yes
Hwaddr=00:0c:29:5d:18:ee
Type=ethernet
Bootproto=static
ipaddr=192.168.1.251
netmask=255.255.255.0
network=192.168.1.1
Defroute=yes
Ipv4_failure_fatal=yes
Ipv6init=no

---------------------------------------------Below is a description
Device= "eth0"/NIC device name
Hwaddr=00:0c:29:5d:18:ee/network card Physical Address
Bootproto=static/Set the way the NIC gets the IP address, here is the manual fill
ipaddr=192.168.1.251/Static IP address
netmask=255.255.255.0/Subnet Mask
network=192.168.1.1/Gateway Address
---------------------------------------------above is the description


2, modify the gateway configuration, edit
#vi/etc/sysconfig/network

Networking=yes
Networking_ipv6=no
Hostname=centos
gateway=192.168.1.1

---------------------------------------------Below is a description
Networking=yes/Indicates whether the system uses the network and is generally set to Yes.
Hostname=centos/Set host name for this machine www.111cn.net
gateway=192.168.1.1/Set the IP address of the gateway.
---------------------------------------------above is the description
I'm editing this here. The first two items are already by default, so only the gateway is added

3, modify DNS, edit
#vi/etc/resolv.conf

NameServer 114.114.114.114
NameServer 202.96.134.133
Search Localdomain

---------------------------------------------Below is a description
NameServer 114.114.114.114/dns Preferred Address
NameServer 202.96.134.133/dns Alternate Address
---------------------------------------------above is the description

4. Restart Service
#service Network restart or #/etc/init.d/network restart

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.