Linux set static IP

Source: Internet
Author: User

First, modify the network card configuration file

Execute vi/etc/sysconfig/network-scripts/ifcfg-eth0 to enter the network card configuration file and edit the following six items. (There is a modification, none is added.) )

bootproto= "Static"

onboot= "Yes"

dns1=192.168.0.1

ipaddr=192.168.30.245

netmask=255.255.255.0

gateway=192.168.30.254

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/02/wKiom1fRCASTW4oKAAAmSDt1NBo394.png "title=" vh3}9d [Me0$xvq9%ql{gy]5.png "style=" Float:none; "alt=" Wkiom1frcastw4okaaamsdt1nbo394.png "/>


Second, restart the network card

Perform the service network restart restart the network card so that the previous configuration takes effect.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/00/wKioL1fRCATgIUkVAAA1gfxGQ8I828.png "title=" gk1cp6@% @FA]~0_t4}g6{]w.png "style=" Float:none; alt= "Wkiol1frcatgiukvaaa1gfxgq8i828.png"/>


Third, test whether the change is successful

1) Execute ifconfig to see if IP is in effect

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/87/02/wKiom1fRCAPQ6FQiAAB0eZTDS70900.png "title="]d~~ W7737tvcesk ' E}tcfmi.png "style=" Float:none; alt= "Wkiom1frcapq6fqiaab0eztds70900.png"/>

2) Ping External Network test gateway, DNS is correct

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/87/00/wKioL1fRCAORXy6yAABKUbHkpes995.png "title=" ~0757[ F24}E1R} ' E ' Sb6[dq.png "style=" Float:none; "alt=" Wkiol1frcaorxy6yaabkubhkpes995.png "/>


This article is from "Love, Lynn" blog, please be sure to keep this source http://love11forever.blog.51cto.com/11313259/1850732

Linux set 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.