『壹』 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