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

Óà Linux ´òÔì·ÓÉÆ÷

·¢²¼Ê±¼ä:2005-06-06 00:31:56À´Ô´:ºìÁª×÷Õß:ming
Linux ×÷ΪһÖÖнüáÈÆðµÄ²Ù×÷ϵͳ£¬ÓÉÓÚÆäÐÔÄÜÎȶ¨£¬Ô´Â뿪·Å¼°¼Û¸ñ·½ÃæµÄÓÅÊƶøÖð½¥±»¹ã´óÓû§Ëù½ÓÊÜ¡£ÏÖÔÚLinuxµÄÖ÷ÒªÓÃÎäÖ®µØÔÚÓÚ·þÎñÆ÷ÁìÓò£¬µ«ÊÇ£¬¾­¹ýÊʵ±µÄÅäÖÃÖ®ºó£¬Ëü»¹¿ÉÒÔµ£µ±»¥ÁªÍøµÄÎïÀí»ùʯ--·ÓÉÆ÷ÕâÒ»ÖØÒª½ÇÉ«¡£

·ÓÉÆ÷ÊÇͨÐÅ×ÓÍøÖеÄͨÐŽڵ㣬ÿ¸ö·ÓÉÆ÷¶¼¼ÆË㲢ά»¤Ò»ÕÅ·ÓÉ±í£¬²¢¾Ý´ËÖ¸µ¼Êý¾Ý±¨Ç°Íù×î¼Ñ·¾¶ÖеÄÏÂÒ»Õ¾£¬Õâ±ãÊÇËùνµÄ·ÓÉ¡£ÕâÑù£¬¾­¹ý»¥ÁªÍøÉÏËùÓзÓÉÆ÷µÄͨÁ¦ºÏ×÷£¬Êý¾Ý±¨¾ÍÄܹ»ÑØ×ÅÒ»Ìõ"×î¼Ñ"·¾¶µ½´ïÄ¿µÄµØ¡£ÔÚ GNU Èí¼þ Zebra µÄЭÖúÏ£¬ÎÒÃÇ¿ÉÒÔ½« Linux »úÆ÷´òÔì³Éһ̨¹¦ÄÜÍ걸µÄ·ÓÉÆ÷£¬ËüÄܹ»Í¬Ê±Ö§³Ö RIPv1¡¢ RIPv2¡¢RIPng¡¢OSPFv2¡¢OSPFv3¡¢BGP - 4 ºÍ BGP - 4+ µÈÖî¶à TCP/IP ЭÒé¡£ÏÖÔÚÎÒÃÇÊ×ÏÈÁ˽âһϠOSPF ºÍ BGP ЭÒéµÄÔËÐÐģʽºÍ»ù±¾Ô­Àí£¬È»ºó½éÉÜ Zebra µÄ°²×°ÅäÖ÷½·¨£¬ÈÃÄãµÄ Linux »úÆ÷±ä³ÉÖ§³Ö OSPF Óë BGP µÄ·ÓÉÆ÷¡£

[size=16:2239340282][i:2239340282][b:2239340282]BGP/OSPF ¸ÅÊö[/b:2239340282][/i:2239340282][/size:2239340282]

Èç½ñ£¬Ðí¶à¹«Ë¾¶¼½¨Óжà¸öÍøÂ磬Èç¹ûÕâЩÍøÂçµÄÀàÐͲ»¾¡Ïàͬ£¬ÔòÐèÒªÓ÷ÓÉÆ÷½øÐл¥Áª¡£Â·ÓÉÆ÷ÊÇÓëÁ½¸ö»òÁ½¸öÒÔÉϵÄÍøÂçÁ¬½ÓµÄ¼ÆËã»ú£¬Ëü¸ù¾Ý·ÓÉЭÒéÉú³É²¢Î¬»¤Ò»¸ö·ÓÉ±í£¬²¢°´Õո÷ÓɱíÖеÄÐÅϢת·¢°ü¡£ÕâЩ·ÓÉÆ÷¶Ô¹«Ë¾ÄÚ²¿µÄÍøÂç½á¹¹ÁËÈçÖ¸ÕÆ£¬ÖªµÀ½«·Ö×éË͵½Ä¿µÄµØµÄÈ«²¿Ï¸½Ú£¬µ«¶ÔÓÚÆäËû¹«Ë¾µÄÍøÂç½á¹¹²¢²»Á˽⡣ÏñÕâÑù"ÔÚͬһ»ú¹¹Ï¹ÜÀíµÄһϵÁзÓÉÆ÷ºÍÍøÂç"±»³ÆΪ×ÔÖÎϵͳ(AS)¡£Óɲ»Í¬»ú¹¹ÕƹܵÄ×ÔÖÎϵͳ£¬¿ÉÒÔ²ÉÓò»Í¬µÄ·ÓÉÑ¡ÔñËã·¨£»µ«Í¬Ò»×ÔÖÎϵͳÄÚµÄËùÓзÓÉÆ÷¶¼Ê¹ÓÃͬһ·ÓÉЭÒ飬ÒÔ±ãÓÚ×ÔÖÎϵͳÄÚ²¿¸÷¸ö·ÓÉÆ÷»¥»»Â·ÓÉÐÅÏ¢À´Î¬³ÖÏ໥µÄÁ¬Í¨ÐÔ¡£Ã¿Ò»¸ö×ÔÖÎϵͳ¶¼ÓÐÒ»¸ö16λµÄ"×ÔÖÎϵͳ(AS)±àºÅ"×÷Ϊ±êÖ¾£¬¾ÍÏñ IP µØÖ·Ò»Ñù£¬ËüÊÇÓÉרÃÅ»ú¹¹À´·ÖÅäµÄ¡£

×ÔÖÎϵͳÄڵķÓÉÆ÷³ÆΪ"ÄÚ²¿Íø¹Ø"£¬ËùÓõÄЭÒé³ÆΪ"ÄÚ²¿Íø¹ØЭÒé"¡£ÄÚ²¿Íø¹ØЭÒé´óÌåÉÏ·ÖΪÁ½À࣬һÀàÊǾàÀëÏòÁ¿Ð­Ò飬Èç RIP,EIGRP ЭÒ飻ÁíÒ»ÀàÊÇÁ´Â·×´Ì¬Ð­ÒéÈç OSPF ЭÒé¡£Á´Â·×´Ì¬Â·ÓÉЭÒéÓë¾àÀëÏòÁ¿Ð­ÒéµÄ²»Í¬Ö®´¦ÔÚÓÚ£¬²ÉÓÃÁ´Â·×´Ì¬Â·ÓÉЭÒéµÄ·ÓÉÆ÷²»Êǽ»»»µ½´ïÄ¿µÄµØµÄ¾àÀ룬¶øÊÇά»¤Ò»ÕÅÍøÂçÍØÆ˽ṹͼ¡£È»ºóÓÃÊý¾Ý¿â±íʾ¸Ãͼ£¬ÆäÖеıíÏî¶ÔÓ¦ÍøÂçµÄÒ»ÌõÁ´Â·¡£Â·ÓÉÆ÷¸ù¾ÝÊý¾Ý¿âµÄÐÅÏ¢¼ÆËã³ö"×î¼Ñ·ÓÉ"£¬ÓÉ´ËÖ¸µ¼°üµÄת·¢¡£µ±ÍøÂçÍØÆ˽ṹ·¢Éú±ä»¯Ê±£¬Ö»Ð轫ÏàÓ¦¼Í¼¶ø·ÇÕû¸öÊý¾Ý¿â֪ͨÆäËû½Úµã¡£¸÷·ÓÉÆ÷×ö³öÏàÓ¦Ð޸IJ¢ÖØмÆËã·Óɺ󣬾ͿÉÒÔ¼ÌÐøÕý³£¹¤×÷¡£

ÒòΪ"¿ª·Åʽ×î¶Ì·¾¶ÓÅÏÈЭÒé"µÄÎĵµ±ØÐ빫¿ª·¢±í£¬ËùÒÔËüÊÇ"¿ª·ÅʽµÄ"£¨Open£©£»ÓÖÒòΪËü²ÉÓÃ"×î¶Ì·¾¶ÓÅÏÈ"£¨SPF£©Ëã·¨À´¼ÆËãÒ»¸ö½Úµãµ½ËùÓÐÆäËü½Úµã¼äµÄ×î¶Ì·¾¶£¬¹ÊÃûΪ OSPF¡£OSPF ¾ßÓÐÖ§³Ö¶àÖضÈÁ¿ÖÆʽºÍ¶àÖØ·¾¶µÈÖî¶àÓŵ㣬Òò´Ë³ÉΪÒòÌØÍøÉÏÍƼöʹÓõÄÄÚ²¿Íø¹ØЭÒ飬RIP È´ÓÉÓÚ×ÔÉíµÄ¾ÖÏÞÐÔ¶ø±»´òÈëÀ乬¡£ÏÖÔÚ£¬ÔÚÐÔÄÜÉÏΨһÄܹ»Óë OSPF ÏàÆ¥µÐµÄÄÚ²¿Íø¹ØЭÒé±ãÊÇ EIGRP--Cisco µÄÒ»¸öרÓÐЭÒ飬µ« OSPF µÄ"¿ª·Å"±¾Éí¾ÍÊÇÒ»¸öÏìÁÁµÄÕÐÅÆ£¬ÒòΪ˭Ҳ²»ÏëÊÜÖÆÓÚij¼Ò¹©Ó¦ÉÌ¡£

Ç°ÃæÌáµ½£¬×ÔÖÎϵͳÄڵķÓÉÆ÷²»±ØÖªµÀÆäËû×ÔÖÎϵͳµÄÄÚ²¿½á¹¹Ï¸½Ú£¬´Ó¶øÓÐЧµØ½ÚÔ¼ÁË·ÓÉÆ÷µÄÄÚ´æºÍ CPU ʱ¼ä£¬²¢Ìá¸ßÁËÍøÂç´ø¿íµÄÀûÓÃÂÊ¡£µ«ÊÇ£¬Èç¹ûÏëÓëÆäËû¹«Ë¾£¨×ÔÖÎϵͳ£©Í¨ÐÅʱ¸ÃÔõô°ìÄØ£¿ºÜ¼òµ¥£¬ÎÒÃÇ¿ÉÒÔÔÚ×ÔÖÎϵͳÄÚÖ¸¶¨Ò»¸öÓëÆäËû×ÔÖÎϵͳÏàÁ¬µÄ·ÓÉÆ÷Ϊ"ÍⲿÍø¹Ø"£¬Í¨¹ýËü½øÈëÆäËû×ÔÖÎϵͳ¡£¸Ã·ÓÉÆ÷ʹÓõÄЭÒé½Ð×ö"ÍⲿÍø¹ØЭÒé"£¬Èç±ß½çÍø¹ØЭÒ飨BGP£©¡£ÏàÁÚµÄÁ½¸öÍø¹Ø±ØÐëÊ×ÏÈ»¥»»"ÁÚ»ú̽²â"±¨ÎÄ£¬Ð­ÉÌÊÇ·ñÔ¸Òâ³ÉΪ"ÁÚ»ú"¡£³ÉΪÁÚ»úÔòÒâζ×ÅÁ½¸ö×ÔÖÎϵͳͬÒâÖÐת˫·½µÄͨÐÅÁ÷¡£Í¬Òâºó£¬Á½¸öÁÚ»ú»¥»»"ÁÚ»ú¿É´ïÐÔ±¨ÎÄ"£¬À´¼à¶½ËûÃÇÖ®¼äµÄÁ´Â·µÄ¹¤×÷Çé¿ö¡£½ÓÏÂÀ´±ãÊÇ×îÖØÒªµÄ¹¤×÷£¬ÓÃ"ÍøÂç¿É´ïÐÔ±¨ÎÄ"À´½»»»Í¨¹ý¸÷ÁÚ»úËùÄܵ½´ïµÄÍøÂçµÄÐÅÏ¢£¬´Ó¶øʵÏÖ×ÔÖÎϵͳ֮¼äµÄÁ¬Í¨ÐÔ¡£ÔÚÍⲿÍø¹ØµÄÑÛÀïÖ»ÓÉÍⲿÍø¹ØºÍÁ¬½ÓËûÃǵÄÁ´Â·£¬Èç´ËÒÔÀ´£¬×ÔÖÎϵͳÄÚµÄͨÐÅÓÉÄÚ²¿Íø¹Ø´¦Àí£¬×ÔÖÎϵͳ֮¼äµÄͨÐŽ»ÓÉÍⲿÍø¹Ø´¦Àí--Ò»¸ö·Ö¼¶Â·Óɵľ°ÏóÒѾ­Õ¹ÏÖÔÚÎÒÃÇÃæÇ°£¬Êµ¼ÊÉÏ£¬ÒòÌØÍøÕýÊÇÓÉ´óÁ¿×ÔÖÎϵͳ×é³ÉµÄ¡£

[b:2239340282][i:2239340282][size=16:2239340282]½¨Á¢Ò»¸ö¸ß¼¶Â·ÓÉÆ÷[/size:2239340282][/i:2239340282][/b:2239340282]

Ðí¶àÈ˶Ô·ÓÉÆ÷¸Ðµ½±È½ÏÄ°Éú£¬ÊÂʵÉÏ×÷Ϊһ¸ö·À»ðǽʹÓÃµÄ Linux ϵͳÒѾ­ÊÇÒ»¸ö·ÓÉÆ÷ÁË£¬Ö»²»¹ý»¹Óеã"¼òª"¶øÒÑ¡£È»¶ø£¬ÎÒÃǵÄÄ¿±êÊÇÓà Linux ´òÔìÒ»¸ö"¸ß¼¶"·ÓÉÆ÷£¬Ëü±ØÐëÄܹ»ÀûÓö¯Ì¬Â·ÓÉЭÒ飨ÉÏÎÄÌáµ½µÄЭÒé½ÔΪ¶¯Ì¬Â·ÓÉЭÒ飩¹¤×÷¡£ÕâЩЭÒéÄܹ»Ê¹Â·ÓÉÆ÷»¥»»Ïà¹ØÐÅÏ¢£¬´Ó¶ø¹²Ïí´©Ô½ÍøÂçʱËùÓõÄÄÇЩ·¾¶--·ÓÉ¡£ÕâÒ»µã¶ÔÓÚ´óÐÍÍøÂç(±ÈÈç Internet)¶øÑÔÊÇ"Òì³£"ÖØÒªµÄ£¬ÒòΪ´ËʱÔÙÓþ²Ì¬Â·ÓÉ£¨Ò²¾ÍÊÇÈ˹¤¼ÆËãÉèÖ÷ÓÉ£©ÊǸù±¾²»ÏÖʵµÄ¡£

¾ÙÀýÀ´Ëµ£¬¼´Ê¹ÔڱȽÏÀíÏë--¼´²»¿¼ÂÇ·Óɵı仯µÄÇé¿öÏ£¬Ò»¸ö±ß½çÍø¹ØЭÒé(BGP)·ÓɱíÒ²ÖÁÉÙ°üº¬ 100,000 ÌõÒÔÉϵıíÏî¡£Õâʱ£¬ÊÖ¹¤½¨Á¢ÕâÑùµÄ¾²Ì¬Â·ÓÉÊÇÄÑÒÔÈÌÊܵġ£ºÜÃ÷ÏÔ£¬¼´Ê¹ÎÒÃǵÄÍøÂçСÓÚ Internet--±ÈÈçÒ»¸ö´óÐ͹«Ë¾ÍøÂ磬ÎÒÃÇ»¹ÊǸü¼Óϲ»¶¶¯Ì¬Â·ÓÉЭÒé¡£

ÍⲿÍø¹ØЭÒé BGP ͨ³£×÷Ϊ Internet µÄ¹Ç¸ÉʹÓ㬶øÆäËüµÄЭÒ飨Èç OSPF£©ÔòÊÊÓÚСÐ͵Ļ¥Á¬ÍøÂç¡£¿ª·Åʽ×î¶Ì·¾¶ÓÅÏÈ(OSPF)ЭÒéÊÇÒ»¸öÓ¦ÓÃ×î¹ãµÄÄÚ²¿Íø¹ØЭÒé(IGP)¡£Zebra ÊÇÒ»¸ö¿ª·ÅÔ´´úÂë³ÌÐò°ü£¬Í¨¹ýËüÄã¿ÉÒÔÔÚ Linux ÉÏÔËÐÐ BGP Óë / »ò OSPF¡£

[b:2239340282][i:2239340282][size=16:2239340282]°²×° Zebra[/size:2239340282][/i:2239340282][/b:2239340282]

Äã¼È¿ÉÒÔ´Ó Zebra.org ÍøÕ¾ÏÂÔØ Zebra µÄ×îÐÂÔ´³ÌÐò£¬Ò²ÄÜ´Ó Redhat ºÍ Debian ÖлñµÃËü£¬µ«²»Ò»¶¨ÊÇ×îаæµÄ¡£´ÓÔ´´úÂëÖнøÐÐÈí¼þ°²×°£¬Äã¾Í»á·¢ÏÖʹÓõÄÊÇһЩÆÕͨµÄ°²×°¹ý³Ì¡£¼ò½éÈçÏ£º

[code:1:2239340282]
./configure
make
make install
[/code:1:2239340282]

ÅäÖýű¾»áËÑË÷ϵͳÉÏÒѾ­°²×°µÄ IP Õ»²¢ÇÒ×Ô¶¯µØÉèÖóÉÖ§³ÖËûÃÇ¡£µ±Ç°£¬IP Õ»ºÜ¿ÉÄܽö½öÊÇÖ¸ IPv4£¬µ«ÊÇ IPv6 Óû§Ò²²»Óõ£ÐÄ£¬ÒòΪ Zebra Ò²»á·¢ÏÖ²¢ÇÒÖ§³ÖËü¡£

³ÌÐò°²×°Ö®ºó£¬»¹¿ÉÄܱØÐëÔÚ /etc/services ÖÐÔö¼ÓһЩÃüÁîÐС£Zebra µÄÊØ»¤³ÌÐòÔÚËûÃÇ×Ô¼ºµÄÐéÄâÖÕ¶ËÁ¬½Ó(VTY)ÏÂÔËÐУ¬ËùÒÔÄãµÄϵͳ±ØÐëÖªµÀÕâЩÐéÄâÖÕ¶ËÁ¬½Ó¡£ÕâÀïÊÇÄãÓ¦¸ÃÔö¼ÓµÄһЩÁ¬½Ó¡Ã

[code:1:2239340282]
zebrasrv 2600/tcp # zebra service
zebra 2601/tcp # zebra vty
ripd 2602/tcp # RIPd vty
ripngd 2603/tcp # RIPngd vty
ospfd 2604/tcp # OSPFd vty
bgpd 2605/tcp # BGPd vty
ospf6d 2606/tcp # OSPF6d vty

[/code:1:2239340282]

[b:2239340282][i:2239340282][size=16:2239340282]ÅäÖÃ Zebra[/size:2239340282][/i:2239340282][/b:2239340282]

Èç¹ûÄãÒѾ­ÊìϤ Cisco IOS£¬ÄÇÄã¾ÍÄÜÔÚ¶Ìʱ¼äÄÚÕÆÎÕ Zebra£¬ÒòΪÄã»á·¢ÏÖÁ½Õß¼«ÎªÏàËÆ¡£Zebra µÄÿ¸öÊØ»¤³ÌÐòʹÓÃÒ»¸öµ¥¶ÀµÄ VTY£¬ÕâЩ VTY ¿ÉÒÔͨ¹ýÒ»¸öÔ¶³ÌµÇ¼»á»°½øÐж¯Ì¬ÅäÖá£ËùÒÔ£¬Èç¹ûÄãÐèÒªÉèÖà OSPF£¬¼òµ¥µØÔ¶³ÌµÇ¼µ½¸Ã Linux ÉÏ 2604 ¶Ë¿Ú£»ÎªÁËÐÞ¸ÄÄں˵Ä·Óɱí»òÉèÖ÷ÓÉЭÒé¼äµÄÔÙ·Ö·¢£¬Äã¿ÉÒÔÔ¶³ÌµÇ¼µ½¶Ë¿Ú 2601£¬¸Ã Zebra ÊØ»¤³ÌÐò³äµ±Äں˹ÜÀíÆ÷£¬¹ÜÀíÆäËûµÄÊØ»¤³ÌÐòºÍϵͳ±¾ÉíÖ®¼äµÄͨÐÅ¡£

ÏÖÔÚ½éÉÜÈçºÎÔÚÒ»¸ö·þÎñÆ÷ÉÏ´´½¨ºÍÔËÐÐ OSPF ºÍ BGP¡£Zebra µÄÊØ»¤³ÌÐòÔËÓô¿Îı¾Îļþ´¢´æËüÃǵÄÅäÖ᣶ÔÓÚ OSPF/BGP ·ÓÉÆ÷£¬½«Óõ½Èý¸öÎļþ¡Ãzebra.conf¡¢ospfd.conf ºÍ bgpd.conf¡£¾ÙÀýÀ´Ëµ£¬zebra.conf Îļþ¿ÉÄÜ»áÊÇÕâÑù:

[code:1:2239340282]
! Zebra configuration saved from vty
! 2002/02/28 01:46:12
!
hostname LinuxRouter /*Ö÷»úÃûΪ LinuxRouter*/
password zebra /*¿ÚÁîΪ zebra*/
enable password z3bRa /*½øÈëÌØȨģʽʱµÄ¿ÚÁîΪ z3bRa */
log file /var/log/zebra/zebra.log /*ÈÕÖ¾ÎļþµÄµØÖ·*/
!
interface eth0 /*ÒÔÌ«½Ó¿Ú eth0*/
description Interface to External Network/*¶Ô½Ó¿ÚµÄÃèÊö*/
ip address 10.0.0.1/24 /*¸Ã½Ó¿ÚµÄ IP µØÖ·*/
!
interface eth1/*ÒÔÌ«½Ó¿Ú eth0*/
description Interface to Internal Network/*¶Ô½Ó¿ÚµÄÃèÊö*/
ip address 192.168.66.1/24/*¸Ã½Ó¿ÚµÄ IP µØÖ·*/

[/code:1:2239340282]

ÕâÀïµÄ¸Ð̾ºÅ³äµ±×¢½â±êʶ»ò·Ö¸ô·û¡£¾¡¹Ü´æÔÚ´óÁ¿²»Í¬µÄÍøÂç½Ó¿ÚÀàÐÍ(Ethernet¡¢ISDN µÈµÈ)£¬µ«Ö»ÒªÊÇ Linux ÄÚºËÄܹ»±æÈϵÄÍøÂç½Ó¿ÚÀàÐÍ£¬Zebra ¶¼¿ÉÒÔʹÓá£

×ÓÍøÑÚÂ붼´øÓÐÍøÂçλµÄλÊý(ÀýÈç/24)£¬Ä¬ÈÏÑÚÂëÔò²»È»£¨±ÈÈç 255.255.255.0£©¡£×¢Òâ´æÔÚÁ½¸ö¿ÚÁһ¸öÓÃÓÚÓû§Ä£Ê½¶øÁíÒ»¸öÓÃÓÚÌØȨģʽ¡£Õâ²»½öÓÐÀûÓÚÏò·Ç¹ÜÀíÔ±Ìṩ·ÃÎÊȨÏÞ£¬¶øÇÒ¶ÔÓÚ´´½¨Â·ÓÉ·þÎñÆ÷»òÕß·ÓÉ̽²â¾µÒ²ÊǷdz£ÖØÒªµÄ¡£ËùÓÐ BGP ¹ÜÀíÔ±¶¼ÖªµÀ£¬ÕâЩ̽²â¾µÊǵ÷ÊÔ·ÓÉÎÊÌâµÄ¹Ø¼ü£¬ÒòΪËûÃÇÄܹ»Ê¹Äã¾ÍÏó´ÓÒ»¸öÍⲿ AS( AS´ú±í×ÔÖÎϵͳ)Ò»Ñù²é¿´Â·ÓÉ¡£ BGP ·ÓÉÐèÒªÓõ½ AS ±àºÅ£¬AS ±àºÅÊÇһЩÓÉ ARIN (ÃÀ¹ú»¥ÁªÍøÂçºÅÂë×¢²á»ú¹¹)¿ØÖƵÄ×¢²áºÅÂë¡£

ÏÂÒ»²½½«Æô¶¯Ò»Ð©±ØÒªµÄ³ÌÐò¡£ÓÃÒÔÏÂÃüÁîÍê³É¡Ã

[code:1:2239340282]
/usr/sbin/zebra -dk
/usr/sbin/ospfd -d
/usr/sbin/bgpd -d
[/code:1:2239340282]

µÚÒ»¸öÃüÁÆô¶¯ zebra£¬¸ÃÊØ»¤³ÌÐòʵ¼ÊÉÏÓÃÀ´¸üÐÂÄں˵Ä·ÓÉ±í¡£-dk ¸æË߸óÌÐò×÷Ϊһ¸öÊØ»¤³ÌÐòÔËÐÐ(d)£¬ËüµÄ´ó²¿·Öʱ¼äÔÚºǫ́ÔËÐС£k ÊÇÁíÍâµÄÒ»¸öÑ¡Ï¸æËß Zebra ά»¤ËùÓÐÒÑÅäÖõÄ·ÓÉ¡£ËüÓÃÀ´±£Ö¤ÔÚÄã²âÊÔ Zebra µÄʱºò²»»áÒâÍâµØɾ³ý·ÓÉ±í¡£Ò»°ãÇé¿öÏ£¬ÉèÖ÷Óɺͽӿڣ¬ÐèÒª½« ifconfig ºÍ route ÕâÁ½¸öÃüÁîÅäºÏʹÓ᣶ø Zebra ÍêÈ«¿ÉÒÔÌæ´úÕâÖÖ·ÓɹÜÀí·½Ê½£¬Ê¹ÓÃÆðÀ´¸üΪ¼ò½à¡£

[b:2239340282][i:2239340282][size=16:2239340282]ÉèÖÃOSPF[/size:2239340282][/i:2239340282][/b:2239340282]

ÖÁ´Ë£¬»ù±¾µÄ·þÎñÒѾ­¾ß±¸£¬ÏÖÔÚÈÃÎÒÃÇ Telnet µ½±¾µØ»úÆ÷µÄ 2604 ¶Ë¿Ú£¬¿ªÊ¼ÅäÖà OSPF¡£Îª½øÈëÌØȨģʽ£¬¼üÈë enable (ÕýÈçÔÚCisco IOS ÖÐÒ»Ñù)£¬È»ºó¼üÈëÌØȨģʽ¿ÚÁî¡£½ÓÏÂÀ´£¬Óà configuration terminal ÃüÁîÇл»µ½ÅäÖÃģʽ¡£ÖµµÃÒ»ÌáµÄÊÇ Zebra Ò²ÄܽÓÊÜÃüÁîËõдÐÎʽ£¬ÕâÓë Cisco ¼«ÎªÏàËÆ£¬Èç configuration terminal ¿ÉÒÔ¼òдΪ config t£¬Õâ´ó´óËõ¶ÌÁËÊäÈëʱ¼ä£¬Ê¹ÓÃÆðÀ´¸üΪ·½±ã¡£ÁíÍ⣬Èç¹ûÊäÈë list ºÍ ?£¬Ëü½«ÏÔʾһ¸öµ±Ç°¿ÉÓÃÃüÁîµÄÇåµ¥£¬²¢¸½ÓÐһЩ¼òÂÔ½âÊÍ¡£³ý´ËÖ®Í⣬»¹¿ÉÒÔ¼üÈë tab ÓÃÓÚÃüÁîµÄ×Ô¶¯Íê³É¡£Õâ¾ÍÊÇ˵£¬Èç¹ûÄãÏë¼üÈëÃüÁî clock£¬Ö»Òª¼üÈëÇ°Á½¸ö×Öĸ cl È»ºó°´ tab ¼ü£¬»úÆ÷¾Í»á×Ô¶¯"²¹È«"ÕâÌõÃüÁî--Ç°ÌáÊÇÄã¼üÈëµÄ×Ö·û×ãÒÔΨһµØÈ·¶¨ÕâÌõÃüÁî¡£ÕâÊÇÒ»¸öºÜºÃµÄ¹¦ÄÜ£¬ÓÈÆäÊǵ±ÄãÏ°¹ßÓÚÕâÖÖÓ÷¨Ê±¡£

½ÓÏÂÀ´£¬ÎÒÃÇ»¹ÐèÒª¸æËßÊØ»¤³ÌÐò½«Í¨¹ý OSPF ¹ã²¥ÄÄЩÍøÂçÒÔ¼°Ïà¹ØµÄÓò£¨area£©¡£OSPF µÄ¿ÉÉìËõÐÔÔÊÐíËüÖ§³Ö¶à¸öÓò¡£¼üÈë router ospf ¿ªÊ¼ÅäÖà OSPF£¬È»ºó¼üÈë network 192.168.66.0/24 area 0¡£Õâ¸æËß·ÓÉÆ÷£¬ÎÒÃǽ«Ê¹Óà OSPF ¹ã²¥Ò»¸ö×ÓÍøÑÚÂëΪ 255.255.255.0 µÄ 192.168.66.0 ÍøÂç¡£

ÔÚ±¾ÀýÖУ¬ÎÒÃÇÈà eth0 ½Ó¿Ú±ä³ÉÒ»¸ö±»¶¯£¨passive£©½Ó¿Ú£¬ÒÔ±ãʹËü²»ÄÜ·¢ËÍ·ÓɸüС£Õâ¶ÔÓÚʵÑéÊǷdz£ÖØÒªµÄ£¬ÒòΪÔÚÄǸö·½ÏòÉϵÄÆäËûµÄ·ÓÉÆ÷¿ÉÄܼàÌýµ½·¢Ë͵Ä·ÓɸüУ¬½«½Ó¿Ú±ä³ÉÒ»¸ö±»¶¯£¨passive£©½Ó¿Ú£¬´Ó¶øÓÐЧµÄ±ÜÃâÈÅÂÒÍøÂçµÄÕý³£ÔËÐС£Îª´Ë£¬¼üÈëÃüÁî passive - interface eth0¡£Èç¹û´òË㽫´Ë·ÓÉÆ÷×÷Ϊ¹¤×÷·ÓÉÆ÷ʹÓÃʱ£¬¾ÍûÓÐÕâ¸ö±ØÒªÁË¡£Ò»µ©ÄãÍê³ÉÐ޸ģ¬Óà end ÃüÁî´ÓÅäÖÃģʽÖÐÍ˳ö£¬È»ºóÓà write file ÃüÁî±£´æ¡£ÕâÀïÊÇÒ»¸ö¿ìÕÕ£º

[code:1:2239340282]
labrat:~# telnet 0 2604 /*Telnet µ½±¾µØ»úÆ÷µÄ 2604 ¶Ë¿Ú*/
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'. /*Óà '^]'Í˳ö¸Ã»á»°*/

Hello, this is zebra (version 0.84b)
Copyright 1996-2000 Kunihiro Ishiguro

User Access Verification

Password: /*Ôڴ˼üÈë¿ÚÁÈç zebra*/
ospfd> enable/*½øÈëÌØȨģʽ*/
Password: /*ÊäÈëÌØȨģʽ¿ÚÁÈç z3bRa*/
ospfd# configure terminal /*´ÓÖÕ¶ËÅäÖ÷ÓÉÆ÷*/
ospfd(config)# router ospf /*ÅäÖÃ OSPF*/
ospfd(config-router)# network 192.168.66.0/24 area 0 /*ͨ¹ý OSPF ¹ã²¥ÍøÂç network 192.168.66.0£¬/24 Ö¸³ö×ÓÍøÑÚÂëΪ 24 룬area 0 Ö¸³ö¸ÃÍøÂçËùÔÚµÄÓò*/
ospfd(config-router)# passive-interface eth0 /*½« eth0 ½Ó¿ÚÉèÖóÉÒ»¸ö±»¶¯£¨passive£©½Ó¿Ú*/
ospfd(config-router)# end /*Í˳öÅäÖÃģʽ*/
ospfd# write file /*±£´æÐÞ¸Ä*/
Configuration saved to /etc/zebra/ospfd.conf

[/code:1:2239340282]

Çë¼Çס£¬ÎªÁËÈà OSPF »ò BGP ÔÚij½Ó¿ÚÉϹ¤×÷£¬ÄÇô¸Ã½Ó¿Ú±ØÐë´¦ÓÚ"ÔËÐÐ"״̬¡£ÎªÊÖ¹¤ÔËÐÐÒ»¸ö½Ó¿Ú£¬µÇ¼µ½¶Ë¿Ú 2601 ²¢ÇÒÔڸýӿÚÉÏÖ´ÐÐ no shut ÃüÁî¡£

[b:2239340282][i:2239340282][size=16:2239340282]½¨Á¢ BGP[/size:2239340282][/i:2239340282][/b:2239340282]

BGP Óë OSPF µÄÅäÖôóÖÂÏàͬ¡£¿ªÊ¼£¬´ò¿ªÒ»¸öÔ¶³ÌµÇ¼»á»°µ½¶Ë¿Ú 2605¡£Ö®ºóÖ´ÐÐ configure terminal£¬ÊäÈë router bgp ½øÈë BGP ÅäÖÃģʽ¡£ÈçÇ°ËùÊö£¬BGP ʹÓà AS ±àºÅ½¨Á¢ÁÚ»ú¹Øϵ²¢Â·ÓÉͨÐÅÁ÷¡£ÔÚÎÒÃǵÄÊÔÑéÖУ¬ÎÒÃǽ«Ê¹ÓÃÒ»¸ö·¶Î§ÔÚ 64512 µ½ 65534 Ö®¼äµÄ˽ÓÐ AS ºÅÂ루»»¾ä»°Ëµ£¬¸ÃºÅÂëÖ¼ÔÚ»ú¹¹ÄÚ²¿ÓÐЧ£¬¶øÔÚÒòÌØÍøÉÏÎÞЧ£©¡£Óà network ÃüÁîÉèÖÃÓÉ BGP ¹ã²¥µÄÄÇЩÍøÂ磬Èç network 192.168.66.0/24.¡£Óë OSPF ²»Í¬µÄÊÇ£¬BGP ÁÚ»ú±ØÐ뾲ָ̬¶¨¡£ÈçͬÏÂÊö¡Ãneighbor remote-as ¡£ÕâÀïÊÇÒ»¸ö·¶Àý£º

[code:1:2239340282]
labrat:~# telnet 0 2605
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.

Hello, this is zebra (version 0.84b)
Copyright 1996-2000 Kunihiro Ishiguro

User Access Verification

Password:
bgpd> enable
Password:
bgpd# configure terminal
bgpd(config)# router bgp 65530 /*ÅäÖà BGP£¬65530 ÊÇ×ÔÖÎϵͳ±àºÅ¡£Ò²¾ÍÊǽ«¸ÃϵͳÅäÖóÉ×ÔÖÎϵͳ 65530 ÉϵÄÍⲿÍø¹Ø*/
bgpd(config-router)# network 192.168.66.0/24 /*ÓÉ BGP ¹ã²¥µÄÍøÂç*/
bgpd(config-router)# neighbor 10.0.0.5 remote-as 65531 /*¾²Ì¬Ö¸¶¨×ÔÖÎϵͳ 65531 ÉÏ IP µØַΪ 10.0.0.5 µÄ·ÓÉÆ÷Ϊ±¾»úµÄÁÚ»ú*/
bgpd(config-router)# end
bgpd# write file
Configuration saved to /etc/zebra/bgpd.conf
[/code:1:2239340282]

¶ÔÓÚ OSPF ºÍ BGP£¬ÓдóÁ¿Ñ¡Ïî¿ÉÓã¬ÏÞÓÚƪ·ù²»ÄÜÔÚ´ËÒ»Ò»½éÉÜ¡£¶ÔÓÚÿ¸öЭÒ飬ÎÒ½¨ÒéÔÚʵ¼ÊʹÓÃ֮ǰ£¬²»·ÁÏÈÑо¿Ò»·¬¡£Îª´Ë£¬¿ÉÒԲο¼ GNU Zebra Îĵµ£¬Ëü»á¸øÄãÌṩÐí¶à°ïÖú¡£

[b:2239340282][i:2239340282][size=16:2239340282]½áÊøÓï[/size:2239340282][/i:2239340282][/b:2239340282]

ÔÚÍøÂçÖУ¬Â·ÓÉͨÐÅÁ÷µÄ·½·¨ÓÐÈô¸ÉÖÖ¡£¾Í·ÓÉÆ÷¶øÂÛ,ËäÈ»ÓÐÓø÷ÖÖÓ²¼þ¿ÉÓÃ,µ«ÊÇ·ÑÓýϸß--ÈËÃÇ×ÔÈ»¾Í»áÏëµ½ÔËÐÐÒ»¸öÓà Linux ϵͳ¹¹ÖþµÄ¹¦ÄܷḻµÄ·ÓÉÆ÷×÷Ϊ´úÌæ¡£Zebra ·ÓÉÊØ»¤³ÌÐòÒѾ­Ê¹ÕâÒ»ÇбäΪÏÖʵ¡£ÒòΪ֧³Ö IPv4¡¢IPv6 ºÍÆäËü¸÷ʽ¸÷ÑùµÄЭÒ飬ËùÒÔ Zebra Äܹ»Âú×ãÎÒÃÇËùÓеÄ·ÓÉÐèÇó¡£Ëü»¹ÓÐÒ»¸öºÃ´¦¾ÍÊÇ£¬ÒòΪ Cisco IOS ºÍ Zabra ¼«ÎªÏàËÆ£¬Èç¹ûÄãÒÔÇ°ÔÚ Cisco IOS »·¾³Öй¤×÷£¬¿ÉÒÔÇáËɵĹý¶Éµ½ Zebra ϵͳ£»Í¬Ê±£¬Ê¹Óà Zebra Ò²ÄÜÈÃÄã»ýÀÛÆð·á¸»µÄÀàËÆÓÚʹÓà Cisco IOS ·ÓÉÆ÷µÄ¾­ÑéºÍ֪ʶ¡£

[b:2239340282][i:2239340282][size=16:2239340282]×÷Õß¼ò½é£º[/size:2239340282][/i:2239340282][/b:2239340282]

º«²¨£¬×ÔÓÉ׫¸åÈË£¬ÓнüÊ®ÄêµÄ C ÓïÑÔ±à³Ì¾­Ñ飬Ö÷Òª¸ÐÐËȤµÄÁìÓòΪ TCP/IP ЭÒéÒÔ¼° Linux Äںˡ£¸öÈËÈÏΪ×ÔÓÉ׫¸åÈ˵ļÛÖµÔÚÓÚ£ºÔÚ²»Ó°ÏìÎÊÌâʵÖʵÄÇ°ÌáÏ£¬ÓÃÒ»ÖÖͨË׵ģ¬Ò×ÓÚÀí½âµÄ·½Ê½À´²ûÊö×Ô¼ºµÄ¼û½â¡£Äú¿ÉÒÔͨ¹ý Email:hbzzx2001@yahoo.com.cn ÓëËûÈ¡µÃÁªÏµ¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 6 ÌõÆÀÂÛ

  1. feidecheng ÓÚ 2008-04-27 14:29:19·¢±í:

    ÊܽÌÁË.
    Ç¿º·:0w223dc :0w223dc :0w223dc

  2. eoboot ÓÚ 2005-10-20 00:33:34·¢±í:

    ²»´í

  3. root ÓÚ 2005-09-19 00:41:37·¢±í:

    Ö§³Ö

  4. linux ÓÚ 2005-08-14 01:22:52·¢±í:

    ¶¥

  5. »ð ÓÚ 2005-07-15 11:10:34·¢±í:

    ¶¥

  6. uu ÓÚ 2005-06-18 11:38:24·¢±í:

    ÊܽÌ