How to set the IP address of CentOS, Linux How to modify IP address

Source: Internet
Author: User
Tags get ip

How to set the IP address of CentOS, Linux How to modify IP address
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
Step through ReadingBaidu Experience: jingyan.baidu.com

For many friends who have just come into contact with Linux, how to set the IP address of the Linux system, as the first step, the following small series of CentOS system as an example, to show you how to set the IP address of CentOS, how to modify the Linux system IP address?

steps to readBaidu Experience: jingyan.baidu.comTools/Materials
    • Linux systems, CentOS

Baidu Experience: jingyan.baidu.comView IP Address
    1. 1

      Login to connect to the CentOS system, enter ifconfig to view IP address information for the current local computer, such as

      steps to read END
Baidu Experience: jingyan.baidu.comTemporarily set IP address
    1. 1

      For example, the above query IP is 1.117, enter ifconfig eth0 (default is the first network card) followed by IP address, netmask and gateway, if not set, use the default mask

      Steps to read
    2. 2

      Checking the IP again becomes the new IP address.

      Note that this method is modified only temporarily, restarting the NIC or server and restoring

      steps to read END
Baidu Experience: jingyan.baidu.comSet \ Modify IP Address
  1. 1

    If you want to make the IP address permanent, you need to edit the NIC configuration file

    Use the VI editor settings, such as Vi/etc/sysconfig/network-scripts/ifcfg-eth0

    Steps to read
  2. 2

    describe the document; Device=eth0 NIC corresponding device alias, such as Ifcfg-eth0 first NIC Bootproto=static

    How the NIC obtains the IP address,

    Static IP Address

    DHCP (get IP via DHCP protocol)

    Bootip IP address obtained through the BOOTP protocol broadcast=192.168.0.255 subnet broadcast address HWADDR=00:50:56:8e:47:ee nic Physical Address ipaddr =12.168.1.117 Network card IP address

    Ipv6init=no whether to enable IPV6ipv6_autoconf=no netmask=255.255.255.0 network card corresponding netmask networ k=192.168.1.0 the network address of the NIC Onboot=yes if the system is set to Yes when it is started, the device is activated when the system starts. The default setting is Yes

    As for the following type and UUID this does not have to worry about, the type of the network card

  3. 3

    2. Using the VI editor, press the Insert key to enter edit mode

    Steps to read
  4. 4

    3. Move the cursor to the IPADDR Settings section and change to the IP address you want to set.

    As in this example, change to 1.118. Press the ESC key.

    Enter Colon: Wq Save exit

    Will prompt "/etc/sysconfig/network-scripts/ifcfg-eth0" 14L, 302C written

    Steps to read
  5. 5

    4. After setting up, restart the network service, such as 2 commands can be service network restart

    Steps to read
  6. 6

    5. Check the IP again you will find that you have changed to the new IP address 1.118.

    END
Baidu Experience: jingyan.baidu.comGraphical interface operation
    1. 1

      Besides

      You can manipulate it in the graphical interface. Edit the network card settings, or use the Netconfig command to enter the graphical interface settings

      Steps to read
    2. 2

      After setting, if IP is required to take effect. Also need to restart the network service, or restart the computer

      END
Baidu Experience: jingyan.baidu.comPrecautions
    • Ifconfig Modify the password is temporary, restart the network card service or server and then restore. The above methods are valid for other Linux distributions

How to set the IP address of CentOS, Linux How to modify IP address

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.