‘壹’ Linux涓璱fconfig锻戒护浣灭敤链夊摢浜涳纻
linux涓璱fconfig锻戒护灞炰簬缃戠粶閰岖疆锻戒护
ifconfig锻戒护琚鐢ㄤ簬閰岖疆鍜屾樉绀Linux鍐呮牳涓缃戠粶鎺ュ彛镄勭绣缁滃弬鏁般傜敤ifconfig锻戒护閰岖疆镄勭绣鍗′俊鎭锛屽湪缃戝崱閲嶅惎钖庢満鍣ㄩ吨钖钖庯纴閰岖疆灏变笉瀛桦湪銆傝佹兂灏嗕笂杩扮殑閰岖疆淇℃伅姘歌繙镄勫瓨镄勭数鑴戦噷锛岄偅灏辫佷慨鏀圭绣鍗$殑閰岖疆鏂囦欢浜嗐
璇娉
ifconfig(鍙傛暟)
鍙傛暟
add<鍦板潃>锛氲剧疆缃戠粶璁惧IPv6镄刬p鍦板潃锛
del<鍦板潃>锛氩垹闄ょ绣缁滆惧呕Pv6镄IP鍦板潃锛
down锛氩叧闂鎸囧畾镄勭绣缁滆惧囷绂
<hw<缃戠粶璁惧囩被鍨><纭浠跺湴鍧>锛氲剧疆缃戠粶璁惧囩殑绫诲瀷涓庣‖浠跺湴鍧锛
io_addr<I/O鍦板潃>锛氲剧疆缃戠粶璁惧囩殑I/O鍦板潃锛
irq<IRQ鍦板潃>锛氲剧疆缃戠粶璁惧囩殑IRQ锛
media<缃戠粶濯掍粙绫诲瀷>锛氲剧疆缃戠粶璁惧囩殑濯掍粙绫诲瀷锛
mem_start<鍐呭瓨鍦板潃>锛氲剧疆缃戠粶璁惧囧湪涓诲唴瀛樻墍鍗犵敤镄勮捣濮嫔湴鍧锛
metric<鏁扮洰>锛氭寚瀹氩湪璁$畻鏁版嵁鍖镄勮浆阃佹℃暟镞讹纴镓瑕佸姞涓婄殑鏁扮洰锛
mtu<瀛楄妭>锛氲剧疆缃戠粶璁惧囩殑MTU锛
netmask<瀛愮绣鎺╃爜>锛氲剧疆缃戠粶璁惧囩殑瀛愮绣鎺╃爜锛
tunnel<鍦板潃>锛氩缓绔娅Pv4涓嶪Pv6涔嬮棿镄勯毁阆阃氢俊鍦板潃锛
up锛氩惎锷ㄦ寚瀹氱殑缃戠粶璁惧囷绂
-broadcast<鍦板潃>锛氩皢瑕侀佸线鎸囧畾鍦板潃镄勬暟鎹鍖呭綋鎴愬箍鎾鏁版嵁鍖呮潵澶勭悊锛
-pointopoint<鍦板潃>锛氢笌鎸囧畾鍦板潃镄勭绣缁滆惧囧缓绔嬬洿鎺ヨ繛绾匡纴姝ゆā寮忓叿链変缭瀵嗗姛鑳斤绂
-promisc锛氩叧闂鎴栧惎锷ㄦ寚瀹氱绣缁滆惧囩殑promiscuous妯″纺锛
IP鍦板潃锛氭寚瀹氱绣缁滆惧囩殑IP鍦板潃锛
缃戠粶璁惧囷细鎸囧畾缃戠粶璁惧囩殑钖岖О銆
浣跨敤锷熻兘绀轰緥
钖锷ㄥ叧闂鎸囧畾缃戝崱锛
ifconfig eth0 up
ifconfig eth0 down
ifconfig eth0 up涓哄惎锷ㄧ绣鍗eth0锛宨fconfig eth0 down涓哄叧闂缃戝崱eth0銆俿sh锏婚檰linux链嶅姟鍣ㄦ搷浣滆佸皬蹇冿纴鍏抽棴浜嗗氨涓嶈兘寮钖浜嗭纴闄ら潪浣犳湁澶氱绣鍗°
涓虹绣鍗¢厤缃鍜屽垹闄IPv6鍦板潃锛
ifconfig eth0 add 33ffe:3240:800:1005::2/64 #涓虹绣鍗eth0閰岖疆IPv6鍦板潃
ifconfig eth0 del 33ffe:3240:800:1005::2/64 #涓虹绣鍗eth0鍒犻櫎IPv6鍦板潃
鐢╥fconfig淇鏀MAC鍦板潃锛
ifconfig eth0 hw ether 00:AA:BB:CC:dd:EE
閰岖疆IP鍦板潃锛
[root@localhost ~]# ifconfig eth0 192.168.2.10
[root@localhost ~]# ifconfig eth0 192.168.2.10 netmask 255.255.255.0
[root@localhost ~]# ifconfig eth0 192.168.2.10 netmask 255.255.255.0 broadcast 192.168.2.255
钖鐢ㄥ拰鍏抽棴arp鍗忚锛
ifconfig eth0 arp #寮钖缃戝崱eth0 镄刟rp鍗忚
ifconfig eth0 -arp #鍏抽棴缃戝崱eth0 镄刟rp鍗忚
璁剧疆链澶т紶杈揿崟鍏冿细
ifconfig eth0 mtu 1500 #璁剧疆鑳介氲繃镄勬渶澶ф暟鎹鍖呭ぇ灏忎负 1500 bytes