CentOS Configuration Fixed IP

Source: Internet
Author: User
Tags nameserver

Network Configuration method under CentOS (Gateway, DNS, IP address configuration)

Source: Internet anonymous time: 07-13 00:32:07 "Big Small"

This article introduced the CentOS network configuration method, the CentOS network configuration mainly includes the DNS, the gateway, the IP address, mainly configures Resolv.conf\network\ifcfg-eth0 these network configuration files, needs the friend may refer to the next

CentOS Network Configuration Example

1. Configure DNS
Vi/etc/resolv.conf
Join:

Copy CodeThe code is as follows:
NameServer 192.168.0.1
NameServer 8.8.8.8
NameServer 8.8.4.4

2. Configure the Gateway:

Vi/etc/sysconfig/network
Join:
gateway=192.168.0.1
Complete the following:

Copy CodeThe code is as follows:
Networking=yes
Hostname=localhost.localdomain
gateway=192.168.0.1

3, configure the IP address:
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
The contents are as follows:


Copy CodeThe code is as follows:
Device= "Eth0"
Hwaddr= "00:0c:29:6c:bb:e6"
Nm_controlled= "Yes"
Onboot= "No"
netmask=255.255.255.0
ipaddr=192.168.0.8
gateway=192.168.0.1
Bootproto=static
Onboot=yes
Peerdns=yes

4, restart the service:

Copy CodeThe code is as follows:
/etc/init.d/network restart
or use the command:
Service Network restart
Or:
Ifdown eth0 and Ifup eth0

After the configuration is complete, ping the gateway to see if it can ping or check the actual configured IP address with ifconfig eth0.

CentOS Configuration Fixed 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.