Linux Set fixed IP

Source: Internet
Author: User

Recently the company has a new project, need to be deployed on the Linux system prior to the Linux system also have a certain understanding, feel no problem. In order to improve the performance of the server, the installation is the CentOS mini-version (minimized without desktop).

After the system successfully installed, you need to set the fixed IP, because I have been operating before, so I do not want to follow the process set

Vi/etc/sysconfig/network-scripts/ifcfg-etho

and change Onboot=yes.

On the command line input: ifconfig eth0 192.178.0.2 netmask 255.255.255.0

Restart Services: Service network restart

And then try, you can ping, I thought this can be done, the next day when using the CRT connection server, there is a

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/72/D4/wKiom1XuRQSR1BElAABZUihCNWg747.jpg "title=" Connection closed "alt=" wkiom1xurqsr1belaabzuihcnwg747.jpg "/> tried a bit, is can ping, instant very depressed, in the Internet also read some information, most suddenly remembered, IP is automatically obtained by DHCP and requires a fixed IP to be set for the server, and the previously used method does not take effect.

# vi/etc/sysconfig/network-scripts/ifcfg-eth0device=eth0bootproto=staticipaddr=192.168.0.2netmask= 255.255.0.0gateway=192.168.0.1onboot=yestype=ethernet Restart the configuration file to make it effective #/etc/init.d/network restartshutting down Interface eth0: [OK]shutting down loopback interface: [OK]]setting network parameters: [OK]bringing up loopback Inter Face: [OK]bringing up interface eth0: [OK]

At this point, the problem solved successfully.

Linux Set fixed 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.