BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters

BGP Route Filtering เป็นหัวใจของ BGP operations — ควบคุมว่า routes ไหนจะ advertise ออกไปและ routes ไหนจะ accept เข้ามา ใช้ Prefix Lists สำหรับ filter ตาม network/prefix length, AS-Path Filters สำหรับ filter ตาม AS path และ Route Maps สำหรับ complex policy ที่รวมหลาย conditions + set attributes

BGP เป็น routing protocol ของ internet — ถ้า filter ผิดอาจทำให้ traffic ไปทางที่ไม่ควร หรือ advertise routes ที่ไม่ควร (route leak) ซึ่งสามารถทำให้ส่วนหนึ่งของ internet ใช้งานไม่ได้ การเข้าใจ filtering tools อย่างลึกซึ้งจึงจำเป็นสำหรับทุก network engineer

BGP Filtering Tools

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters — BGP Filtering Tools | Forex คู่มือ iCafeForex
Tool Filter By Use Case
Prefix List Network address + prefix length Filter specific prefixes or prefix length ranges
AS-Path ACL AS path (regex) Filter routes based on AS path origin/transit
Route Map Multiple criteria + set actions Complex policy: match + modify attributes
Community List BGP communities Filter/tag routes using community values
Distribute List (ACL) Network address (legacy) Legacy method (prefer prefix-list)

Prefix List

Feature รายละเอียด
Syntax (Cisco) ip prefix-list NAME seq N permit/deny NETWORK/LEN [ge MIN] [le MAX]
Exact Match ip prefix-list PL permit 10.0.0.0/8 (exactly /8)
Range Match ip prefix-list PL permit 10.0.0.0/8 ge 16 le 24 (subnets /16 to /24 within 10.0.0.0/8)
Default Route ip prefix-list PL permit 0.0.0.0/0 (match default route only)
Match All ip prefix-list PL permit 0.0.0.0/0 le 32 (match everything)
Implicit Deny Entries ที่ไม่ match จะถูก deny (เหมือน ACL)

Prefix List Examples

Purpose Prefix List
Allow only default route permit 0.0.0.0/0
Deny default, allow all others deny 0.0.0.0/0 → permit 0.0.0.0/0 le 32
Allow 10.0.0.0/8 exact permit 10.0.0.0/8
Allow 10.x.x.x /16 to /24 permit 10.0.0.0/8 ge 16 le 24
Block RFC1918 + allow rest deny 10.0.0.0/8 le 32 → deny 172.16.0.0/12 le 32 → deny 192.168.0.0/16 le 32 → permit 0.0.0.0/0 le 32
Allow only /24 or shorter permit 0.0.0.0/0 le 24

AS-Path Filters

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters — AS-Path Filters | Forex คู่มือ iCafeForex
Feature รายละเอียด
Syntax (Cisco) ip as-path access-list N permit/deny REGEX
Regex: ^$ Match empty AS path (locally originated routes)
Regex: ^65001$ Originated by AS 65001 (single AS in path)
Regex: _65001_ Transit through AS 65001 (anywhere in path)
Regex: ^65001_ Received from AS 65001 (first AS)
Regex: _65001$ Originated by AS 65001 (last AS)
Regex: ^[0-9]+$ Single AS in path (directly connected peer’s routes)
Regex: .* Match any AS path (permit all)

AS-Path Regex Symbols

Symbol ความหมาย
^ Start of string
$ End of string
_ Any delimiter (space, start, end, comma)
. Any single character
* Zero or more of previous
+ One or more of previous
? Zero or one of previous
[0-9] Character class (digit)
(65001|65002) Alternation (match either)

Route Maps

Feature รายละเอียด
Structure route-map NAME permit/deny SEQ → match conditions → set actions
Match match ip address prefix-list, match as-path, match community, match metric
Set set local-preference, set weight, set as-path prepend, set community, set metric
Permit clause If match → apply set actions → permit route
Deny clause If match → deny route (no set actions)
No match If no match in clause → check next sequence number
Implicit deny ถ้าไม่ match clause ใดเลย → deny (implicit deny all)
Continue continue N → jump to sequence N (for chaining)

Route Map Examples

Purpose Match Set Action
Prefer routes from AS 65001 match as-path (AS 65001) set local-preference 200
De-prefer backup link match (applied to neighbor) set local-preference 50
Prepend AS outbound match prefix-list (customer routes) set as-path prepend 65000 65000 65000
Set community for tagging match prefix-list set community 65000:100
Set MED for inbound traffic match prefix-list (primary) set metric 100 (primary) / 200 (backup)

BGP Communities

Community ความหมาย
Standard ASN:VALUE (e.g., 65000:100) — 32-bit
Extended Type:ASN:VALUE — 64-bit (used in MPLS VPN, EVPN)
Large ASN:VALUE1:VALUE2 — 96-bit (for 4-byte ASNs)
Well-known: no-export Don’t export to eBGP peers
Well-known: no-advertise Don’t advertise to any peer
Well-known: local-AS Don’t export outside local AS (confederation)

Filtering Direction

Direction Applied To Purpose
Inbound (in) neighbor X route-map IN in Filter/modify routes received from peer
Outbound (out) neighbor X route-map OUT out Filter/modify routes advertised to peer
Redistribute redistribute ospf route-map RM Filter routes being redistributed into BGP

Best Practices

Practice รายละเอียด
Always filter inbound + outbound Never accept or advertise everything (default deny)
Filter bogons inbound Block RFC1918, RFC5737, default route, too-specific prefixes (> /24)
Max-prefix limit Set maximum prefixes per neighbor (protection against route leak)
Use prefix-list over ACL Prefix lists are more efficient and readable
Document policies Comment every filter rule with purpose and ticket number
RPKI/ROA Validation Use RPKI to validate route origins (prevent hijacking)
IRR Filtering Build filters from IRR databases (RADB, RIPE) automatically

ทิ้งท้าย: BGP Filtering = Control Your Routing

BGP Route Filtering Prefix List = filter by network/prefix length (most common) AS-Path Filter = filter by AS path (regex-based) Route Map = complex policy (match + set attributes) Communities = tag routes for policy signaling Always filter inbound (bogons, max-prefix) + outbound (only your routes) RPKI + IRR = automated origin validation

อ่านเพิ่มเติมเกี่ยวกับ MPLS VPN และ EVPN-VXLAN Fabric ที่ siamlancard.com หรือจาก icafeforex.com และ siam2r.com

อ่านเพิ่มเติม: เทรดทองคำ XAU/USD | กลยุทธ์เทรดทอง

อ่านเพิ่มเติม: กราฟทอง TradingView | Panel SMC MT5

อ่านเพิ่มเติม: EA Forex ฟรี | Panel SMC MT5

อ่านเพิ่มเติม: EA Forex ฟรี | Panel SMC MT5

อ่านเพิ่มเติม: เทรด Forex | ดาวน์โหลด EA ฟรี

FAQ

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters คืออะไร?

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters เป็นหัวข้อสำคัญในวงการเทคโนโลยีที่ช่วยให้การทำงานมีประสิทธิภาพมากขึ้น ไม่ว่าจะเป็นด้าน IT, Network หรือ Server Management

ทำไมต้องเรียนรู้เรื่อง BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters?

เพราะ BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters เป็นทักษะที่ตลาดต้องการสูง และช่วยให้คุณแก้ปัญหาในงานจริงได้อย่างมืออาชีพ การเรียนรู้ตั้งแต่วันนี้จะเป็นประโยชน์ในระยะยาว

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters เหมาะกับผู้เริ่มต้นไหม?

ได้แน่นอนครับ บทความนี้เขียนให้เข้าใจง่าย เหมาะทั้งผู้เริ่มต้นและผู้มีประสบการณ์ มี step-by-step guide พร้อมตัวอย่างให้ทำตามได้ทันที

สิ่งที่คุณจะได้เรียนรู้จากบทความนี้

บทความ BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters นี้ครอบคลุมทุกอย่างที่คุณต้องรู้ ตั้งแต่พื้นฐานไปจนถึงการนำไปใช้จริง เขียนจากประสบการณ์จริง ไม่ใช่แค่ทฤษฎี มีตัวอย่างและ step-by-step guide ให้ทำตามได้ทันที

ทำไม BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters ถึงน่าสนใจ?

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters เป็นหัวข้อที่กำลังได้รับความสนใจสูงมากในปี 2569 ทั้งจากมือใหม่และผู้เชี่ยวชาญ เพราะมีการเปลี่ยนแปลงและพัฒนาใหม่ๆ อยู่ตลอด การติดตามข้อมูลล่าสุดเป็นสิ่งสำคัญ

FAQ

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters คืออะไร?

อ่านรายละเอียดทั้งหมดในบทความนี้ ครอบคลุมตั้งแต่พื้นฐานไปจนถึงขั้นสูง

iCafeForex | SiamLanCard | Siam2R | XM Signal

สิ่งที่ควรรู้เพิ่มเติมเกี่ยวกับ BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters ยังมีมิติอื่นที่น่าสนใจ การศึกษาเพิ่มเติมจะช่วยให้เข้าใจภาพรวมได้ดีขึ้น แนะนำให้อ่านบทความที่เกี่ยวข้องเพิ่มเติมและฝึกปฏิบัติจริง

อ่านเพิ่มเติม: iCafeForex | XM Signal EA ฟรี | SiamLanCard | Siam2R

สิ่งที่ควรรู้เพิ่มเติมเกี่ยวกับ BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters ยังมีมิติอื่นที่น่าสนใจ การศึกษาเพิ่มเติมจะช่วยให้เข้าใจภาพรวมได้ดีขึ้น แนะนำให้อ่านบทความที่เกี่ยวข้องเพิ่มเติมและฝึกปฏิบัติจริง

อ่านเพิ่มเติม: iCafeForex | XM Signal EA ฟรี | SiamLanCard | Siam2R

สิ่งที่ควรรู้เพิ่มเติมเกี่ยวกับ BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters ยังมีมิติอื่นที่น่าสนใจ การศึกษาเพิ่มเติมจะช่วยให้เข้าใจภาพรวมได้ดีขึ้น แนะนำให้อ่านบทความที่เกี่ยวข้องเพิ่มเติมและฝึกปฏิบัติจริง

อ่านเพิ่มเติม: iCafeForex | XM Signal EA ฟรี | SiamLanCard | Siam2R

สิ่งที่ควรรู้เพิ่มเติมเกี่ยวกับ BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters ยังมีมิติอื่นที่น่าสนใจ การศึกษาเพิ่มเติมจะช่วยให้เข้าใจภาพรวมได้ดีขึ้น แนะนำให้อ่านบทความที่เกี่ยวข้องเพิ่มเติมและฝึกปฏิบัติจริง

อ่านเพิ่มเติม: iCafeForex | XM Signal EA ฟรี | SiamLanCard | Siam2R

สิ่งที่ควรรู้เพิ่มเติมเกี่ยวกับ BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters

BGP Route Filtering: Prefix Lists, Route Maps และ AS-Path Filters ยังมีมิติอื่นที่น่าสนใจ การศึกษาเพิ่มเติมจะช่วยให้เข้าใจภาพรวมได้ดีขึ้น แนะนำให้อ่านบทความที่เกี่ยวข้องเพิ่มเติมและฝึกปฏิบัติจริง

อ่านเพิ่มเติม: iCafeForex | XM Signal EA ฟรี | SiamLanCard | Siam2R

จัดส่งรวดเร็วส่งด่วนทั่วประเทศ
รับประกันสินค้าเคลมง่าย มีใบรับประกัน
ผ่อนชำระได้บัตรเครดิต 0% สูงสุด 10 เดือน
สะสมแต้ม รับส่วนลดส่วนลดและคะแนนสะสม

© 2026 SiamLancard — จำหน่ายการ์ดแลน อุปกรณ์ Server และเครื่องพิมพ์ใบเสร็จ

SiamLancard
Logo
Free Forex EA — XM Signal · SiamCafe Blog · SiamLancard · Siam2R · iCafeFX
iCafeForex.com - สอนเทรด Forex | SiamCafe.net