The method of acquiring IP in Linux and manually setting the solid state IP.

Source: Internet
Author: User

When CentOS is installed, the reboot displays the following screen:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5A/DB/wKioL1T-q2zhDaxXAAFWt6pO7PE812.jpg "title=" QQ picture 20150310162439.jpg "alt=" Wkiol1t-q2zhdaxxaafwt6po7pe812.jpg "/>

Log in to the system with the root user:

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5A/DB/wKioL1T-q5aAmzoTAADu17PAUQw832.jpg "title=" QQ picture 20150310162525.jpg "alt=" Wkiol1t-q5aamzotaadu17pauqw832.jpg "/>

The command to view IP is ifconfig, or IP add

When you enter a command you can see

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5A/E0/wKiom1T-quKjd_LSAAHXG50r89I652.jpg "style=" float: none; "title=" QQ picture 20150310162552.jpg "alt=" Wkiom1t-qukjd_lsaahxg50r89i652.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5A/DB/wKioL1T-rAHzJ41wAAK3Q3Z5Ie0770.jpg "style=" float: none; "title=" QQ picture 20150310162822.jpg "alt=" Wkiol1t-rahzj41waak3q3z5ie0770.jpg "/>

Input ifconfig display only Lo,lo is the loopback address, and the input IP add will display two, respectively, is the lo and Eth0,eth0 is the network card, just after the system is installed, there is no IP, if you want to obtain IP input dhclient command, And then view it with the Ifconfig command

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5A/DB/wKioL1T-rOXQrMlqAALy1kxjt8k970.jpg "title=" QQ picture 20150310163137.png "alt=" Wkiol1t-roxqrmlqaaly1kxjt8k970.jpg "/>


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5A/DB/wKioL1T-rdKxiJCYAAOon4pL1N0033.jpg "title=" QQ picture 20150310163200.png "alt=" wkiol1t-rdkxijcyaaoon4pl1n0033.jpg "/> This time your system has acquired the IP, but this is the dynamic IP, The usual operation of the management of the server is all static IP, if you want to get the server to obtain a fixed IP will need to overwrite the configuration file/etc/sysconfig/network-scripts/ifcfg-eth0, this configuration file, through vi/etc/ Sysconfig/network-scripts/ifcfg-eth0 This command into the vi text editor,

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5A/DB/wKioL1T-rwTCLGUpAAOSSGXYADs280.jpg "title=" QQ picture 20150310163951.jpg "alt=" Wkiol1t-rwtclgupaaossgxyads280.jpg "/>

Enter insert mode after entering I,

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5A/E0/wKiom1T-rh_xqS2vAAFHaLD3pbU435.jpg "title=" QQ picture 20150310164241.jpg "alt=" wkiom1t-rh_xqs2vaafhald3pbu435.jpg "/> Change the Onboot=no in the configuration file to Onboot=yes

Change the BOOTPROTO=DHCP in the configuration file to Bootproto=static

Then add ipaddr=192.168.1.107 (the IP assigned to this computer)

netmask=255.255.255.0 (Subnet mask)

gateway=192.168.1.1 (Gateway)

dns1=8.8.8.8 (DNS server)

Then ESC, then shift+; enter Wq, save exit

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5A/E1/wKiom1T-tQ_SjQ-PAAF0A98VzlY125.jpg "title=" QQ picture 20150310165658.jpg "alt=" wkiom1t-tq_sjq-paaf0a98vzly125.jpg "/> How do you know what the default gateway is?

Commands can be netstat-r to see the default route inside, pointing to the gateway.

or command route-n to know what the gateway is.

The method of acquiring IP in Linux and manually setting the solid state 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.