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