Linux System Configuration IP address

Source: Internet
Author: User
Tags get ip

The most contact in our life is the Windows system, compared to the Linux system, the Windows system configuration IP address is much more convenient.
We all know that in a Windows system, just open "Network and Internet Settings" and select "Change adapter Options" Inside
,


Choose your own network card, click on the properties, select the "Internet Protocol version 4", you can set the host IP address, is also very simple.

so in the Linux system, how to set the host IP address?
First we know that the network card in the Linux system is included in the etc file, enter "Cd/etc" to go to the directory, and then enter the "sysconfig" file, enter LS, to view the currently included files.
Our network card is in the "network-scripts" file.


go to the "network-scripts" directory and enter LS again to view all current files.
One of the "Ifcfg-eth0" is the network card.

Enter "Vim Ifcfg-eth0" to see the information.

You can edit the contents of the letter "I" by typing the word "insert" in the lower left corner.
Change "no" behind "onboot" to "Ye's" to turn on the network card function.
Because the host is configured with its own set of IP address, so "Bootproto" behind the "DHCP (auto Get IP)" to "Static IP".
Next we type:
IPADDR (IP address) = IP address that needs to be configured
NETMASK (subnet mask) = Subnet mask of the configured IP
Gateway address = configured gateway address
After typing, press "ESC" key to exit the edit, you will find the lower left corner of the "insert" disappears, hold "shift+;" Key, you will find that the ":" symbol appears in the lower left corner, and then type "Wq" to enter, you can save this edit and exit.


After returning to the original interface, enter "service network restart" to restart the NIC function.

Enter "Ifconfig" to see that the IP address you just set has been configured successfully.

Thanks for watching

Linux System Configuration IP address

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.