CentOS 6.5 Set Fixed IP

Source: Internet
Author: User

The main system is set up in the following places:

IP address set by this confidential
Netmark Subnet Mask
Gateway Default Gateways
DNS IP
Files related to network configuration in CentOS:

/etc/sysconfig/network
/etc/sysconfig/network-scripts/ifcfg-eth0
/etc/resolv.conf
/etc/hosts

Modify the location (only the parameters that make the modification are listed, not the contents of the modification are listed):

1

/etc/sysconfig/network

gateway=192.168.1.1 #这里是设置网关, I set the router address

2

/etc/sysconfig/network-scripts/ifcfg-eth0

Device=eth0
#BOOTPROTO =dhcp #dhcp是动态获取IP地址
Bootproto=static #static就是设置静态IP
ipaddr=192.168.1.21 #这里就是需要设置的静态IP
netmask=255.255.255.0 #掩码
Type=ethernet #网络类型

Nm_controlled=no
Hwaddr=xx:xx:xx:xx:xx:xx
Onboot=yes

uuid=*************

3

/etc/resolv.conf

NameServer 192.168.1.1 #指定DNS

4
/etc/hosts

This file is used to define the hostname, as needed to set

You need to restart the network service after you have done the changes/etc/inti.d/network restart

CentOS 6.5 Set 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.