LinuxCentOS IP configuration

Source: Internet
Author: User

LinuxCentOS IP configuration

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 = yesHWADDR = 00: 0C: 29: 5D: 18: EETYPE = EthernetBOOTPROTO = staticIPADDR = bandwidth = 255.255.255.0NETWORK = 192.168.1.1DEFROUTE = bandwidth = yesIPV6INIT = noDNS1 = bandwidth = commandid The following describes DEVICE = "eth0"/nic device name HWADDR = 00: 0C: 29: 5D: 18: EE/NIC physical address BOOTPROTO = static/set the nic ip address acquisition method, here is the manual filling IPADDR = 192.168.1.133/static IP address NETMASK = 255.255.255.0/subnet mask NETWORK = 192.168.1.1/gateway address ----------------------------------------- the above is a description
2. Modify and edit the gateway Configuration
# Vi/etc/sysconfig/network

 

NETWORKING = yesNETWORKING_IPV6 = noHOSTNAME = centosGATEWAY = 192.168.1.1 --------------------------------------------- The following describes whether the NETWORKING = yes/indicates whether the system uses the network. Generally, it is set to yes. HOSTNAME = centos/set the local host name 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.114nameserver 202.96.134.133search localdomain names the following describes nameserver 114.114.114.114/DNS preferred address nameserver 202.96.134.133/DNS backup address later
4. Restart the service
# Service network restart or #/etc/init. d/network restart

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.