Linux CentOS configuration IP, linuxcentos configuration ip

Source: Internet
Author: User

Linux CentOS configuration IP, linuxcentos configuration ip

Demo Environment
VMware8 + Linux CentOS 6.2x32

Set IP, website, DNS
1. Modify and edit Nic configurations

# 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.dr
NETMASK = 255.255.255.0
NETWORK = 192.168.1.1
DEFROUTE = yes
20174_failure_fatal = yes
IPV6INIT = no

DNS1 = 114.114.114.114

DNS2 = 202.96.134.20.

--------------------------------------------- The following is a description
DEVICE = "eth0"/nic device name
HWADDR = 00: 0C: 29: 5D: 18: EE/NIC physical address
BOOTPROTO = static/set the way for the NIC to obtain the IP address. Here, manually enter
IPADDR = 192.168.1.133/static IP Address
NETMASK = 255.255.255.0/subnet mask
NETWORK = 192.168.1.1/gateway address
--------------------------------------------- The preceding descriptions are as follows:

2. Modify and edit the gateway Configuration
# 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 the network, which is generally set to yes.
HOSTNAME = centos/set the Host Name of the Local Machine
GATEWAY = 192.168.1.1/set the IP address of the GATEWAY.
--------------------------------------------- The preceding descriptions are as follows:
The first two items are already available by default when I edit them here, so only GATEWAY is added.

3. Modify DNS and edit DNS
# 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 backup address
--------------------------------------------- The preceding descriptions are as follows:

4. Restart the 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.