ºìÁªLinuxÃÅ»§
Linux°ïÖú

ifconfig ÃüÁîʹÓü°½á¹û·ÖÎö£¨ÒÔRedhat9.0ΪÀý£©

·¢²¼Ê±¼ä:2007-12-25 15:54:10À´Ô´:ºìÁª×÷Õß:weidrson
LinuxÍøÂçÐÅÏ¢²é¿´¼°ÅäÖÃÃüÁî--ifconfig£¨ÒÔRedhat9.0ΪÀý£©
×÷Õߣºlysde@163.com
²©¿Í£ºlysde.cublog.cn

LinuxÏÂÍø¿¨ÃüÃû¹æÂÉ£ºeth0£¬eth1¡£µÚÒ»¿éÒÔÌ«Íø¿¨£¬µÚ¶þ¿é¡£loΪ»·»Ø½Ó¿Ú£¬ËüµÄIPµØÖ·¹Ì¶¨Îª127.0.0.1£¬ÑÚÂë8λ¡£Ëü´ú±íÄãµÄ»úÆ÷±¾Éí¡£

1 ifconfigÊDz鿴Íø¿¨µÄÐÅÏ¢¡£

ifconfig [Interface]
InterfaceÊÇ¿ÉÑ¡ÏÈç¹û²»¼Ó´ËÏÔòÏÔʾϵͳÖÐËùÓÐÍø¿¨µÄÐÅÏ¢¡£Èç¹ûÌí¼Ó´ËÑ¡ÏîÔòÏÔʾËùÖ¸¶¨µÄÍø¿¨ÐÅÏ¢

ÀýÈ磺ifconfig eth0

ÒýÓÃ:
eth0 Link encap:Ethernet
HWaddr 00:0C:29:F3:3B:F2
inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:78 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:11679 (11.4 Kb)
TX bytes:14077 (13.7 Kb)
Interrupt:10 Base address:0x1080


ÎÒÃÇ¿ÉÒÔ¿´µ½
µÚÒ»ÐУºÁ¬½ÓÀàÐÍ£ºEthernet£¨ÒÔÌ«Íø£©HWaddr£¨Ó²¼þmacµØÖ·£©
µÚ¶þÐУºÍø¿¨µÄIPµØÖ·¡¢×ÓÍø¡¢ÑÚÂë
µÚÈýÐУºUP£¨´ú±íÍø¿¨¿ªÆô״̬£©RUNNING£¨´ú±íÍø¿¨µÄÍøÏß±»½ÓÉÏ£©MULTICAST£¨Ö§³Ö×é²¥£©MTU:1500£¨×î´ó´«Êäµ¥Ôª£©£º1500×Ö½Ú
µÚËÄ¡¢ÎåÐУº½ÓÊÕ¡¢·¢ËÍÊý¾Ý°üÇé¿öͳ¼Æ
µÚÆßÐУº½ÓÊÕ¡¢·¢ËÍÊý¾Ý×Ö½ÚÊýͳ¼ÆÐÅÏ¢¡£

2 ifconfig ÅäÖÃÍø¿¨

ÅäÖÃÍø¿¨µÄIPµØÖ·
ifconfig eth0 192.168.0.1 netmask 255.255.255.0

ÔÚeth0ÉÏÅäÖÃÉÏ192.168.0.1 µÄIPµØÖ·¼°24λÑÚÂë¡£ÈôÏëÔÙÔÚeth0ÉÏÔÚÅäÖÃÒ»¸ö192.168.1.1/24 µÄIPµØÖ·Ôõô°ì£¿ÓÃÏÂÃæµÄÃüÁî

ifconfig eth0:0 192.168.1.1 netmask 255.255.255.0

ÕâʱÔÙÓÃifconifgÃüÁî²é¿´£¬¾Í¿ÉÒÔ¿´µ½Á½¸öÍø¿¨µÄÐÅÏ¢ÁË£¬·Ö±ðΪ£ºeth0ºÍeth0:0¡£Èô»¹ÏëÔÙÔö¼ÓIP£¬ÄÇÍø¿¨µÄÃüÃû¾Í½Ó×ÅÊÇ£ºeth0:1¡¢eth0:2...ÏëÒª¼¸¸ö¾ÍÌ¸ö¡£ok£¡

ÅäÖÃÍø¿¨µÄÓ²¼þµØÖ·
ifconfig eth0 hw ether xx£ºxx£ºxx£ºxx£ºxx£ºxx

¾Í½«Íø¿¨µÄÓ²¼þµØÖ·¸ü¸ÄÁË£¬´ËʱÄã¾Í¿ÉÒÔÆ­¹ý¾ÖÓòÍøÄÚµÄIPµØÖ·°î¶¨ÁË¡£

½«Íø¿¨½ûÓÃ
ifconfig eth0 down
½«Íø¿¨ÆôÓÃ
ifconfig eth0 up

ifconfig ÃüÁîµÄ¹¦ÄܺÜÇ¿´ó£¬»¹¿ÉÒÔÉèÖÃÍø¿¨µÄMTU£¬»ìÔÓģʽµÈ¡£¾Í²»Ò»Ò»½éÉÜÁË£¬ÓÃʱ¼ä¿ÉÒÔ×Ô¼ºÑо¿Ò»Ï¡£

×¢Ò⣺ÓÃifconfigÃüÁîÅäÖõÄÍø¿¨ÐÅÏ¢£¬ÔÚÍø¿¨ÖØÆôºó»úÆ÷ÖØÆôºó£¬ÅäÖþͲ»´æÔÚ¡£ÒªÏ뽫ÉÏÊöµÄÅäÖÃÐÅÏ¢ÓÀÔ¶µÄ´æµÄµçÄÔÀÄǾÍÒªÐÞ¸ÄÍø¿¨µÄÅäÖÃÎļþÁË¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. guilinhangtian ÓÚ 2007-12-25 18:44:58·¢±í:

    "Èô»¹ÏëÔÙÔö¼ÓIP£¬ÄÇÍø¿¨µÄÃüÃû¾Í½Ó×ÅÊÇ£ºeth0:1¡¢eth0:2...ÏëÒª¼¸¸ö¾ÍÌ¸ö¡£ok£¡"
    ÊDz»ÊǶ¼ÄÜÁ¬ÍøÄØ? »¹ÓÐÔõôûÓн²Íø¹ØµÄÅäÖð¡?