CCIEʵÑ鱸¿¼Ö®BGP(2)
2007-06-22 03:21:47
°æÈ¨ÉùÃ÷£ºÔ´´×÷Æ·£¬Ð»¾ø×ªÔØ£¡·ñÔò½«×·¾¿·¨ÂÉÔðÈΡ£ |
»ã×ÜÉèÖãº
1.bgpÊÇÎÞÀà·ÓÉÐÒ飬֧³ÖVLSM£¬µ«»áÒªÇó×ƥÅ䣬һ°ãËüĬÈÏÆô¶¯×Ô¶¯»ã×ܵ쬵«ÎÒÃÇÒªÇ󹨱Õ×Ô¶¯»ã×Ü£¬²»È»¾Í»áÏñEIGRPÄÇÑù³öÏÖÎÊÌ⣬ÃüÁ no auto-summary 2.ÊÖ¹¤»ã×Ü·½·¨1£º 1£© network »ã×Ü·ÓÉ mask »ã×ܺóµÄ×ÓÍøÑÚÂë 2£© ip route »ã×Ü·ÓÉ »ã×ܺóµÄ×ÓÍøÑÚÂë null0 networkÃüÁî±¾Éí²»ÄÜ»ã×Ü·ÓÉ£¬ËüÖ»ÊǰѾ¹ýigp»ã×ܺóµÄ·ÓÉ·¢²¼³öÈ¥£¬È»ºó»¹ÒªÊÖ¹¤Ö¸¶¨Ò»Ìõ¾²Ì¬»ã×Ü·ÓÉ£¬Ö¸Ïònull½Ó¿Ú£¬²»½ö·¢²¼»ã×Ü·ÓÉ£¬Ò²»á°Ñ¾ßÌåµÄ·ÓÉ·¢²¼³öÈ¥£¬Èç¹û²»Ïë°Ñ¾ßÌå·ÓÉ·¢²¼³öÈ¥£¬ÐèҪ·ÓɹýÂË¡£ 3.ÊÖ¹¤»ã×Ü·½·¨2£º aggregate-address ipµØÖ· ×ÓÍøÑÚÂë ²ÎÊý ²ÎÊý£º summary-only£ºÖ»·¢ËÍ»ã×ܵÄ·ÓÉ£¬¾ßÌåµÄ·Óɲ»»á·¢²¼³öÈ¥ r2#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set
B 199.1.3.0/24 [20/0] via 192.1.1.1, 00:00:09 //Òª»ã×ܵÄÌõÄ¿
B 199.1.2.0/24 [20/0] via 192.1.1.1, 00:00:09 B 199.1.1.0/24 [20/0] via 192.1.1.1, 00:00:09 C 193.1.1.0/24 is directly connected, Ethernet0 C 192.1.1.0/24 is directly connected, Serial1 B 199.1.4.0/24 [20/0] via 192.1.1.1, 00:00:09 B 199.1.0.0/22 [20/0] via 192.1.1.1, 00:00:09 //ÕâÊÇ»ã×ÜÖ®ºóµÄ·ÓÉ ¼ÓÈë²ÎÊýºó r2#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set
C 193.1.1.0/24 is directly connected, Ethernet0
C 192.1.1.0/24 is directly connected, Serial1 B 199.1.0.0/22 [20/0] via 192.1.1.1, 00:00:09 r1#show ip bgp
BGP table version is 18, local router ID is 192.168.194.1 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path
*> 192.1.1.0 0.0.0.0 0 32768 ? *> 193.1.1.0 0.0.0.0 2 32768 ? s> 199.1.2.0 0.0.0.0 0 32768 ? //ÒÖ֯סµÄ·ÓÉ *> 192.168.192.0/21 0.0.0.0 32768 i s> 199.1.1.0 0.0.0.0 0 32768 ? s> 199.1.3.0 0.0.0.0 0 32768 ? s> 199.1.4.0 0.0.0.0 2 32768 ? ![]() Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i192.168.192.0/21 10.1.1.9 100 0 {50,200} i *> 200.200.200.0 0.0.0.0 0 32768 i Ð޸ļӲÎÊý£º router bgp 100 aggregate-address 192.168.192.0 255.255.248.0 as-set summary-only advertise-map cisco ...... ! ip as-path access-list 1 permit ^200$ ! route-map cisco permit 10 match as-path 1 ! r4#show ip bgp
BGP table version is 17, local router ID is 200.200.200.201 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path
*>i192.168.192.0/21 10.1.1.9 100 0 200 i *> 200.200.200.0 0.0.0.0 0 32768 i suppress-map:ÒÖÖÆ»ã×Ü·ÓÉÖ¸¶¨µÄÌõÄ¿
router bgp 100 aggregate-address 192.168.192.0 255.255.248.0 suppress-map supmap ! access-list 1 permit 192.168.195.0 access-list 1 permit 192.168.197.0 route-map supmap permit 10 match ip address 1 ! r3#show ip bgp BGP table version is 10, local router ID is 3.3.3.3 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path
*> 192.168.192.0 10.1.1.1 0 0 50 i *> 192.168.192.0/21 0.0.0.0 32768 i *> 192.168.193.0 10.1.1.1 0 0 50 i *> 192.168.194.0 10.1.1.1 0 0 50 i *> 192.168.196.0 10.1.1.5 0 0 200 i s> 192.168.197.0 10.1.1.5 0 0 200 i *> 192.168.198.0 10.1.1.5 0 0 200 i *>i200.200.200.0 10.1.1.10 0 100 0 i ---------------------------------------------------------------------------------- ·ÓɲßÂÔ£º 1.distribute-list¹ýÂËÁбí ÃüÁ neighbor ÁÚ¾Ó distribute-list ·Ã¿ØºÅ [in | out] router bgp 100 neighbor 10.1.1.1 remote-as 50 neighbor 10.1.1.5 remote-as 200 neighbor 10.1.1.10 remote-as 100 neighbor 10.1.1.10 next-hop-self neighbor 10.1.1.10 send-community neighbor 10.1.1.10 distribute-list 1 out ...... ! access-list 1 deny 192.168.196.0 access-list 1 permit any 2.prefix-listǰ׺Áбí¹ýÂË
ÃüÁ ip prefix-list ÁбíºÅ [seq ÐòºÅ] {deny | permit} ÍøÂçºÅ/lenÆ¥Å䳤¶È [ge ×îСƥÅäÖµ] [le ×î´óÆ¥ÅäÖµ] ÆäÖУº len < ge <= le Èç¹û´æÔÚgeºÍle£¬ÔòlenÆ¥Å䳤¶È½«»á±»ºöÂÔ Ó¦Ó㺠neighbor ÁÚ¾Ó prefix-list Ãû³Æ [in | out] ×¢Ò⣺prefix-listºÍdistribute-list²»ÄÜͬʱӦÓÃÔÚͬһ¸öÁÚ¾ÓÉÏ£¬µ«distribute-list¿ÉÒÔµ÷ÓÃprefix-list¶¨ÒåµÄÁбí ÀýÈ磺 router bgp 100 aggregate-address 192.168.192.0 255.255.248.0 suppress-map supmap neighbor 10.1.1.1 remote-as 50 neighbor 10.1.1.5 remote-as 200 neighbor 10.1.1.10 remote-as 100 neighbor 10.1.1.10 next-hop-self neighbor 10.1.1.10 send-community neighbor 10.1.1.10 prefix-list cisco out ...... ! ip prefix-list cisco seq 5 permit 192.168.192.0/21 ge 22 le 24 r3#show ip bgp
BGP table version is 17, local router ID is 3.3.3.3 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path
s> 192.168.192.0 10.1.1.1 0 0 50 i *> 192.168.192.0/21 0.0.0.0 32768 i *> 192.168.193.0 10.1.1.1 0 0 50 i *> 192.168.194.0 10.1.1.1 0 0 50 i *> 192.168.196.0 10.1.1.5 0 0 200 i s> 192.168.197.0 10.1.1.5 0 0 200 i *> 192.168.198.0 10.1.1.5 0 0 200 i *>i200.200.200.0 10.1.1.10 0 100 0 i 3.AS-PATH¹ýÂË
ÃüÁ ip as-path access-list ±àºÅ { permit | deny } ÕýÔò±í´ïʽ ÆäÖбí´ïʽµÄÔÔò£º . Èκε¥Ò»×Ö·û£¬°üÀ¨¿Õ¸ñ [] ÔÚ·½À¨ºÅÖÐÂÞÁеÄÈκÎ×Ö·û [^] ³ýÁËÔÚ·½À¨ºÅÖÐËùÂÞÁÐ×Ö·ûÍâµÄÈκÎ×Ö·û£¨^±ØÐë·ÅÔÚ×Ö·ûÁбí֮ǰ£© - £¨Á¬×Ö·û£©ÔÚÓÉÁ¬×Ö·ûËù·ÖÅäµÄÁ½¸ö×Ö·ûÖ®¼äµÄÈÎÒâ×Ö·û £¿ ×Ö·û»òģʽ³öÏÖ 0´Î»ò 1´Î * ×Ö·û»òģʽ³öÏÖ 0´Î»ò¶à´Î + ×Ö·û»òģʽ³öÏÖ 1´Î»ò¶à´Î ^ Ò»ÐеĿªÊ¼ $ Ò»ÐеĽáÊø | ÓÉÔª×Ö·ûÌØÊâ×Ö·û·Ö¸ôµÄ×ÖÖ®Ò» _ £¨Ï»®Ïߣ©Ò»¸ö¶ººÅ£¬ÐеĿªÊ¼£¬ÐеĽáÊø»ò¿Õ¸ñ ÀýÈ磺 ip as-path access-list 1 permit ^(850|860)*$ ½«ÔÚAS-PATHÖÐÆ¥ÅäÖØ¸´¶à´ÎµÄASºÅΪ850»ò860ÁÐ±í£¬È磨850£©£¬£¨850£¬850£¬850£©£¬£¨850£¬850£¬888£©»ò£¨860£©£¬£¨860£¬860£¬860£©µÈ Ó¦Ó㺠neighbor ÁÚ¾Ó filter-list as-path¶¨ÒåµÄ±àºÅ [ in | out ] °¸Àý£º r4#show ip bgp BGP table version is 16, local router ID is 200.200.200.201 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path
*>i192.168.193.0 10.1.1.9 0 100 0 50 i *>i192.168.194.0 10.1.1.9 0 100 0 50 i *>i192.168.196.0 10.1.1.9 0 100 0 200 i *>i192.168.198.0 10.1.1.9 0 100 0 200 i *> 200.200.200.0 0.0.0.0 0 32768 i r3ÉÏÐÞ¸Ä router bgp 100 ...... neighbor 10.1.1.10 remote-as 100 neighbor 10.1.1.10 next-hop-self neighbor 10.1.1.10 send-community neighbor 10.1.1.10 filter-list 1 out no auto-summary ! ip as-path access-list 1 permit ^50$ //Ö»ÔÊÐíasºÅΪ50µÄͨ¹ý r4#show ip bgp
BGP table version is 22, local router ID is 200.200.200.201 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path
*>i192.168.193.0 10.1.1.9 0 100 0 50 i *>i192.168.194.0 10.1.1.9 0 100 0 50 i *> 200.200.200.0 0.0.0.0 0 32768 i 4.route-map¹ýÂË£º
ÃüÁ route-map Ãû³Æ [permit | deny ] ±àºÅ match Æ¥Åä Ó¦Ó㺠neighbor ÁÚ¾Ó route-map Ãû³Æ °¸Àý£º router bgp 100 ...... neighbor 10.1.1.10 remote-as 100 neighbor 10.1.1.10 next-hop-self neighbor 10.1.1.10 send-community neighbor 10.1.1.10 route-map mapcisco out no auto-summary ! ip as-path access-list 1 permit ^50$ access-list 1 permit 192.168.193.0 access-list 1 permit 192.168.195.0 route-map mapcisco permit 10 match ip address 1 r4#show ip bgp
BGP table version is 22, local router ID is 200.200.200.201 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal Origin codes: i - IGP, e - EGP, ? - incomplete Network Next Hop Metric LocPrf Weight Path *>i192.168.193.0 10.1.1.9 0 100 0 50 i *>i192.168.194.0 10.1.1.9 0 100 0 50 i *> 200.200.200.0 0.0.0.0 0 32768 i ---------------------------------------------------------------------------------- ±¾Îijö×Ô ¡°ÎÞÁÄÉú»î£¬»ý¼«Ãæ¶Ô¡± ²©¿Í£¬Ð»¾ø×ªÔØ£¡ ±¾Îijö×Ô 51CTO.COM¼¼Êõ²©¿Í |




hello_me
²©¿Íͳ¼ÆÐÅÏ¢
ÈÈÃÅÎÄÕÂ
×îÐÂÆÀÂÛ
ÓÑÇéÁ´½Ó
