查看iplinux
❶ linux镆ョ湅ip鍦板潃镄勫懡浠
Linux镆ョ湅IP鍦板潃镄勫懡浠ゆ槸锛歩fconfig鍜宨p锻戒护銆
1. ifconfig锻戒护
ifconfig鏄疞inux涓鐢ㄤ簬閰岖疆缃戠粶鎺ュ彛镄勭粡鍏稿懡浠ゃ傞氲繃璇ュ懡浠わ纴浣犲彲浠ユ煡鐪嬫垨閰岖疆缃戠粶鎺ュ彛镄勫悇绉嶅弬鏁帮纴鍖呮嫭IP鍦板潃銆傝佹煡鐪娅P鍦板潃锛屽彧闇鍦ㄥ懡浠よ屼腑杈揿叆“ifconfig”骞跺洖杞︺傝ュ懡浠ゅ皢鍒楀嚭镓链夌绣缁沧帴鍙e强鍏堕厤缃淇℃伅锛屽寘𨰾琁P鍦板潃銆
2. ip锻戒护
ip锻戒护鏄疞inux涓鍙︿竴涓鐢ㄤ簬閰岖疆缃戠粶鎺ュ彛镄勭幇浠e伐鍏凤纴瀹冩槸ifconfig锻戒护镄勬浛浠e搧銆备娇鐢╥p锻戒护锛屼綘鍙浠ユ洿鏂逛究鍦版煡鐪嫔拰绠$悊缃戠粶鎺ュ彛镄勯厤缃銆傝佹煡鐪娅P鍦板潃锛屽彲浠ヤ娇鐢“ip addr”鎴“ip address”锻戒护銆傝繖灏嗘樉绀烘墍链夌绣缁沧帴鍙g殑璇︾粏淇℃伅锛屽寘𨰾琁P鍦板潃銆
璇︾粏瑙i喷锛
鍦↙inux绯荤粺涓锛岀绣缁滈厤缃鏄闱炲父閲嶈佺殑閮ㄥ垎锛岃屾煡鐪娅P鍦板潃鏄鍏朵腑镄勫熀链镎崭綔涔嬩竴銆傛棤璁烘槸浣跨敤ifconfig杩樻槸ip锻戒护锛岄兘鍙浠ヨ交𨱒捐幏鍙栧埌绯荤粺镄処P鍦板潃淇℃伅銆
* ifconfig锻戒护锛氲繖鏄涓涓铡嗗彶鎭犱箙镄勫懡浠わ纴璁稿氲佺敤鎴峰瑰叾闱炲父镡熸倝銆傞氲繃璇ュ懡浠わ纴浣犲彲浠ユ煡鐪嬬绣缁沧帴鍙g殑璇︾粏閰岖疆锛屽寘𨰾琁P鍦板潃銆佸瓙缃戞帺镰併丮AC鍦板潃绛夈傝槠铹籼p锻戒护鍦ㄦ煇浜涙柟闱㈠姛鑳芥洿寮哄ぇ锛屼絾ifconfig浠岖劧鏄涓涓甯哥敤镄勫伐鍏枫
* ip锻戒护锛氢笌ifconfig鐩告瘆锛宨p锻戒护鎻愪緵浜嗘洿鐜颁唬鍖栫殑鎺ュ彛𨱒ョ$悊缃戠粶閰岖疆銆傚畠鏀鎸佹洿澶氱殑锷熻兘锛屽苟涓旇娉曟洿锷犳竻鏅般傞氲繃“ip addr”鎴“ip address”瀛愬懡浠わ纴浣犲彲浠ヨ交𨱒惧湴镆ョ湅镓链夌绣缁沧帴鍙g殑璇︾粏淇℃伅锛屽寘𨰾琁P鍦板潃銆傝繖瀵逛簬杩涜岀郴缁熺$悊鍜岀绣缁滈厤缃闱炲父链夌敤銆
镐荤殑𨱒ヨ达纴镞犺轰綘阃夋嫨浣跨敤ifconfig杩樻槸ip锻戒护锛岄兘鍙浠ュ湪Linux绯荤粺涓杞绘涧镆ョ湅IP鍦板潃銆傝繖浜涘懡浠ゆ槸Linux缃戠粶绠$悊镄勫熀鐭筹纴瀵逛簬绯荤粺绠$悊锻桦拰鏅阃氱敤鎴锋潵璇撮兘鏄闱炲父閲嶈佺殑宸ュ叿銆
❷ 鍦╨inux/unix绯荤粺涓嬫庝箞镆ヨip鍦板潃锛
鍦↙inux/Unix绯荤粺涓嬫煡璇IP鍦板潃镄勬柟娉曚富瑕佹湁浠ヤ笅鍑犵嶏细
涓銆佷娇鐢ㄥ懡浠よ屽伐鍏锋煡璇IP鍦板潃
1. 浣跨敤ifconfig锻戒护
鍦ㄧ粓绔涓杈揿叆`ifconfig`锛屽洖杞﹀悗浣犲彲浠ョ湅鍒扮绣缁沧帴鍙g殑鐩稿叧淇℃伅锛屽寘𨰾琁P鍦板潃銆
2. 浣跨敤ip锻戒护
杈揿叆`ip addr`鎴朻ip address`锛屼篃鍙浠ユ煡鐪嫔埌IP鍦板潃銆
浜屻侀氲繃缃戠粶閰岖疆鏂囦欢涓镆ヨIP鍦板潃
1. 镆ョ湅缃戠粶閰岖疆鏂囦欢
鍦ㄤ竴浜汱inux鍙戣岀増涓锛岀绣缁滈厤缃淇℃伅浼氢缭瀛桦湪鏂囦欢涓锛屽俙/etc/network/interfaces`鎴朻/etc/sysconfig/network-scripts/`鐩褰曚笅镄勭浉鍏虫枃浠躲备綘鍙浠ヤ娇鐢ㄦ枃链缂栬緫鍣ㄦ墦寮杩欎簺鏂囦欢镆ョ湅IP鍦板潃銆
涓夈
镆ヨ㈡柟娉曡В鏋锛
1. ifconfig锻戒护锛氲繖鏄涓涓浼犵粺镄勭绣缁滈厤缃锻戒护锛岀敤浜庢樉绀哄拰閰岖疆缃戠粶鎺ュ彛镄勪俊鎭銆傚湪澶у氭暟Linux鍙戣岀増涓閮藉彲浠ヤ娇鐢ㄣ傞氲繃璇ュ懡浠わ纴浣犲彲浠ョ湅鍒版疮涓缃戠粶鎺ュ彛镄処P鍦板潃銆
2. ip锻戒护锛氲繖鏄涓涓镟寸幇浠g殑缃戠粶閰岖疆宸ュ叿锛岀敤浜庢樉绀哄拰镎崭綔璺鐢便佺绣缁滆惧囥佺瓥鐣ヨ矾鐢卞拰闅ч亾銆傚畠鍙浠ユ浛浠d紶缁熺殑ifconfig锻戒护锛屽苟涓旀彁渚涗简镟村氱殑锷熻兘鍜岄夐”銆傞氲繃`ip addr`鎴朻ip address`锻戒护锛屼綘鍙浠ヨ交𨱒惧湴镆ョ湅IP鍦板潃銆
3. 镆ョ湅缃戠粶閰岖疆鏂囦欢锛氩湪涓浜汱inux鍙戣岀増涓锛岀绣缁滈厤缃淇℃伅琚淇濆瓨鍦ㄦ枃浠朵腑銆傝繖浜涙枃浠跺寘钖浜嗙绣缁沧帴鍙g殑閰岖疆淇℃伅锛屽寘𨰾琁P鍦板潃銆佸瓙缃戞帺镰併佺绣鍏崇瓑銆傞氲繃鐩存帴镆ョ湅杩欎簺鏂囦欢锛屼綘鍙浠ユ垒鍒癐P鍦板潃淇℃伅銆备笉杩囷纴杩欑嶆柟娉曞彲鑳介渶瑕佷竴浜涘熀链镄勬枃链澶勭悊鑳藉姏锛屽备娇鐢ㄦ枃链缂栬緫鍣ㄨ繘琛屾悳绱㈠拰绛涢夈
浠ヤ笂灏辨槸镆ヨLinux/Unix绯荤粺涓娅P鍦板潃镄勬柟娉曘傛牴鎹瀹为檯𨱍呭喌鍜屽彂琛岀増镄勪笉钖岋纴浣犲彲浠ラ夋嫨阃傚悎浣犵殑鏂规硶𨱒ユ煡璇IP鍦板潃銆