नेटवर्क लैब Docs सिम्युलेटर खोलें →

BGP — regex match के साथ expanded community-list

Standard community-lists exact-value matching करते हैं। Expanded community-lists आपको printed <asn>:<n> form के against regex-match करने देते हैं — "65001: से शुरू होने वाली किसी भी community को match करें" के लिए useful। Prefix को 65001:777 से tag करके, एक expanded list ^65001: define करके, और verify करके दिखाएँ कि tagged prefix match करता है।

यह लैब ब्राउज़र में खोलें →

मुफ़्त · बिना इंस्टॉल · बिना अकाउंट

परिदृश्य

दो community-list flavours: | Type | Match form | Use case | | --- | --- | --- | | standard | exact value (जैसे 65001:100) | "permit अगर community exactly X हो" | | expanded | printed string पर regex | "permit अगर community 65001:* हो" | Expanded COMMUNITIES attribute के against match करता है जो space-separated <asn>:<n> string के रूप में render होता है — 65001:100 65001:200 ऐसे prefix के लिए जो दोनों carry करता है। ^ / $ से anchor करें; word boundaries के लिए \b उपयोग करें। Real Cisco से netverdict deviation: real IOS _ को boundary metacharacter मानता है (space, comma, start, end match करता है)। netverdict JavaScript का RegExp verbatim उपयोग करता है — boundaries के लिए \b उपयोग करें। इस lab में R1 192.168.1.0/24 को 65001:777 से tag करता है। R2 एक expanded list ^65001: define करता है और confirm करता है कि prefix match करता है।

टोपोलॉजी

2 × router · Cisco IOS-style

आप क्या करेंगे

  1. R1 पर एक route-map define करें जो outbound prefixes को community 65001:777 से tag करे और इसे eBGP neighbour से bind करें। (np-bgp-community-tag-and-filter से pattern reuse कर रहे हैं।)

  2. R2 पर एक *expanded* community-list ANY-65001 define करें जो ^65001: match करे (कोई भी community जिसका AS-part 65001 हो)।

  3. R2 पर route-map MATCH-65001 permit 10 को match community ANY-65001 और set local-preference 200 के साथ define करें। R1 को inbound bind करें।

यह लैब ब्राउज़र में खोलें →

इस विषय पर और लैब

यह लैब अन्य भाषाओं में

BGP — expanded community-list with regex matchBGP — expanded Community-List mit Regex-MatchBGP — community-list expandida con regexBGP — community-list expandida com match regexBGP — community-list expanded avec match regexBGP — 使用正则匹配的 expanded community-listBGP — community-list expanded con match regexBGP — 正規表現マッチ付き expanded community-listBGP — 정규식 매치를 가진 expanded community-listBGP — expanded community-list с regex-совпадениемBGP — regex eşleşmeli expanded community-listBGP — community-list expanded khớp regex