CentOS6.5 text mode to configure network parameters (static IP)

Source: Internet
Author: User

First, describe

CentOS6.5 start by default does not automatically connect to the network, the method of obtaining IP address is automatically assigned by DHCP, if we want to temporarily change the IP address can be used simple command: ifconfig eth0 192.168.202.129, where ifconfig represents the interface parameter configuration, eth0 represents the first Ethernet card, and finally the static IP address you want to configure, but this configuration is temporary, if you restart the server then the configured IP address will be invalidated. So we set a long-term, valid static IP address by changing the configuration file.


Second, the text mode configuration IP address

The path to the configuration file is::/etc/sysconfig/network-scripts/ifcfg-eth0 file, the default configuration for this file is as follows:

[email protected] network-scripts]$ cat Ifcfg-eth0
Device=eth0
hwaddr=00:0c:29:85:fc:09
Type=ethernet
Uuid=6b218dfa-ff8e-4455-be44-ffdfd95ccefb
Onboot=no
Nm_controlled=yes
Bootproto=dhcp

At this point we will set the onboot to Yes, that is, automatically connect to the network after power on, and DHCP dynamic mode to static allocation of IP mode, the configuration file is as follows;

[email protected] network-scripts]$ cat Ifcfg-eth0

Device=eth0
hwaddr=00:0c:29:85:fc:09
Type=ethernet
Uuid=6b218dfa-ff8e-4455-be44-ffdfd95ccefb
Onboot=yes
Nm_controlled=yes

ipaddr=192.168.202.129
Bootproto=none

netmask=255.255.255.0
gateway=192.168.202.1


CentOS6.5 text mode to configure network parameters (static IP)

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.