设置æ¹æ³ï¼ä¸ãæ¥çIPå°åç»éè¿æ¥centosç³»ç»ï¼è¾å
¥ ifconfig å¯ä»¥æ¥çå°å½åæ¬æºçIPå°åä¿¡æ¯ï¼å¦ä¸å¾äºã临æ¶è®¾ç½®IPå°å1ãå¦æ¬æºä¸ºä¾ï¼ä¸é¢æ¥è¯¢IP为1.117ï¼è¾å
¥ ifconfig eth0 ï¼é»è®¤æ¯ç¬¬ä¸ä¸ªç½å¡ï¼ åé¢æ¥IPå°åï¼ ç½ç»æ©ç å ç½å
³ï¼å¦æä¸è®¾ç½®ï¼å°±ä½¿ç¨é»è®¤çæ©ç ã2ãå次æ¥çIP就已ç»åææ°çIPå°åäºã注æè¿ç§æ¹æ³ä¿®æ¹åªæ¯ä¸´æ¶ä¿®æ¹ï¼éå¯ç½å¡ææå¡å¨ååä¼è¿åãä¸ã设置\ä¿®æ¹IPå°å1ãå¦æè¦è®©IPå°åæ°¸ä¹
çæï¼éè¦ç¼è¾ç½å¡é
ç½®æ件ï¼ä½¿ç¨VIç¼è¾å¨è®¾ç½®ï¼å¦ vi /etc/sysconfig/network-scripts/ifcfg-eth0 Centoså¦ä½è®¾ç½®IPå°å,LINUXæä¹ä¿®æ¹IPå°åã2ã说æä¸ä¸è¿ä¸ªæ件ãDEVICE=eth0 ç½å¡å¯¹åºç设å¤å«åï¼å¦ifcfg-eth0第ä¸åç½å¡ BOOTPROTO=static ç½å¡è·å¾ipå°åçæ¹å¼ï¼Staticï¼éæ ipå°åï¼ï¼dhcpï¼éè¿dhcpåè®®è·åipï¼ï¼bootipéè¿bootpåè®®è·å¾çipå°åï¼BROADCAST=192.168.0.255åç½å¹¿æå°åãHWADDR=00:50:56:8E:47:EEç½å¡ç©çå°åã IPADDR=12.168.1.117ç½å¡IPå°åï¼IPV6INIT=noï¼æ¯å¦å¯ç¨IPV6IPV6_AUTOCONF=no NETMASK=255.255.255.0 ç½å¡å¯¹åºç½ç»æ©ç ã NETWORK=192.168.1.0 ç½å¡å¯¹åºçç½ç»å°åï¼ ONBOOT=yesï¼ç³»ç»å¯å¨æ¶æ¯å¦è®¾ç½®æ¤ç½ç»æ¥å£ï¼è®¾ç½®ä¸ºyesæ¶ï¼ç³»ç»å¯å¨æ¶æ¿æ´»æ¤è®¾å¤ãé»è®¤è®¾ç½®ä¸ºyesï¼è³äºåé¢ç TYPE åUUIDè¿ä¸ªå°±ä¸ç¨ç®¡äºï¼è¿ç½å¡çç±»åã3ã使ç¨viç¼è¾å¨ï¼ æ inserté®æå
¥ï¼è¿å
¥ç¼è¾æ¨¡å¼ã4ãå°å
æ 移å¨å° IPADDR 设置é¨åï¼æ¹æéè¦è®¾ç½®çIPå°åï¼å¦æ¬ä¾ä¸æ¹æ 1.118. æä¸esc é®ã è¾å
¥ åå·ï¼wq ä¿åéåºï¼ä¼æ示 "/etc/sysconfig/network-scripts/ifcfg-eth0" 14L, 302C written ã5ã设置好ä¹åï¼æç½ç»æå¡éå¯ä¸ä¸ï¼å¦ä¸å¾2个å½ä»¤åå¯ä»¥ service network restartCentoså¦ä½è®¾ç½®IPå°å,LINUXæä¹ä¿®æ¹IPå°åã6ãå次æ¥çIPä¼åç°å·²ç»æ¹ææ°çIPå°å 1.118äºã注æäºé¡¹ifconfigä¿®æ¹å¯ç æ¯ä¸´æ¶çï¼éå¯ç½å¡æå¡ææå¡å¨ååä¼è¿åã以ä¸æ¹æ³å¯¹linuxå
¶ä»åè¡çææã
温馨提示:答案为网友推荐,仅供参考