Linux CentOS Configuration IP

Source: Internet
Author: User
Tags nameserver

Demo Environment
VMware8 + Linux CentOS 6.2 x32

Set up 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

dns1=114.114.114.114

dns2=202.96.134.133

---------------------------------------------The following is a description
Device= "eth0"/NIC device name
Hwaddr=00:0c:29:5d:18:ee/NIC Physical Address
Bootproto=static/Set the network card to obtain 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 a description

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

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

---------------------------------------------The following is a description
Networking=yes/Indicates whether the system uses a network and is generally set to Yes.
Hostname=centos/Set host name for this machine
gateway=192.168.1.1/Set the IP address of the gateway.
---------------------------------------------above is a description
I'm editing this here. The first two items are already 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

---------------------------------------------The following is a description
NameServer 114.114.114.114/dns Preferred Address
NameServer 202.96.134.133/dns Alternate Address
---------------------------------------------above is a description

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

Linux CentOS Configuration IP

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.