Chapterبەش 4 · Lectureوانە 4.11

BGP: Routing Between Autonomous SystemsBGP: ڕێدۆزی لە نێوان سیستەمە سەربەخۆکاندا

How the Internet’s networks reach each other: autonomous systems and their numbers (public, private, documentation), BGP-4 over TCP port 179, path vector and the AS_PATH, policy before path length, eBGP and iBGP, OSPF compared with BGP and the size of today’s table, the book’s three labs with private AS numbers, verification with show commands, hijacks and RPKI, and common mistakes.

چۆن دەگەنە یەکتری: و ژمارەکانیان (گشتی، تایبەت، بەڵگەنامەکردن)، ⁦BGP-4⁩ لەسەر ⁦179⁩، و ⁦AS_PATH⁩، سیاسەت پێش درێژیی ڕێڕەو، eBGP و iBGP، بەراوردی و و قەبارەی خشتەی ئەمڕۆ، سێ تاقیکردنەوەکەی کتێبەکە بە ژمارەی ASـی تایبەت، پشکنین بە show، و RPKI و هەڵە باوەکان.

19 min read20 خولەک خوێندنەوە · 17 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Explain what an autonomous system is and tell public, private and documentation AS numbers apart.
  • Describe how BGP neighbours talk (TCP port 179, OPEN, UPDATE, KEEPALIVE) and how the AS_PATH prevents loops.
  • Compare BGP with OSPF and explain why BGP chooses paths by policy.
  • Configure eBGP between two and three autonomous systems and verify it with show ip bgp summary, show ip bgp and show ip route.
  • Explain BGP hijacks and how RPKI route origin validation helps.
  • ڕوون بکەیتەوە چییە و ژمارەی ASـی گشتی، تایبەت و بەڵگەنامەکردن لە یەکتری جیا بکەیتەوە.
  • باس بکەیت چۆن قسە دەکەن ( ⁦179⁩، OPEN، UPDATE، KEEPALIVE) و ⁦AS_PATH⁩ چۆن ڕێگە لە دەگرێت.
  • لەگەڵ بەراورد بکەیت و ڕوون بکەیتەوە بۆچی بەپێی سیاسەت ڕێڕەو هەڵدەبژێرێت.
  • eBGP لە نێوان دوو و سێ ڕێک بخەیت و بە show ip bgp summary، show ip bgp و show ip route بیپشکنیت.
  • ڕوون بکەیتەوە و بڵێیت پشکنینی سەرچاوەی ڕێگە بە RPKI چۆن یارمەتی دەدات.

The protocol between networksپرۆتۆکۆڵەکەی نێوان ڕایەڵەکان

When you watch a video on your phone in Sulaimani, the packets cross several networks that belong to different companies: your mobile operator, an international carrier, the video company. Each company runs its own network in its own way. Something must tell all of them how to reach each other. That is BGP, the Border Gateway Protocol.

کاتێک لە سلێمانی ڤیدیۆیەک لەسەر مۆبایلەکەت دەبینیت، بە چەند تێدەپەڕن کە هی کۆمپانیای جیاوازن: کۆمپانیای مۆبایلەکەت، گوازەرەوەیەکی نێودەوڵەتی و کۆمپانیای ڤیدیۆکە. هەر کۆمپانیایەک خۆی بە شێوەی خۆی بەڕێوە دەبات. شتێک پێویستە بە هەموویان بڵێت چۆن بگەنە یەکتری. ئەوە ـە، Border Gateway Protocol.

A phone in Sulaimani on the left and a video server on the right. Between them three clouds in a row: a mobile operator (AS 64500), a transit provider (AS 64501) and a video company (AS 64502). Each cloud says “inside: its own IGP”. The links between the clouds are labelled eBGP. A note says: inside each AS an IGP chosen by its owner; between ASes, BGP.مۆبایلێک لە سلێمانی لە چەپ و ڕاژەکارێکی ڤیدیۆ لە ڕاست. لە نێوانیاندا سێ هەور بە ڕیز: کۆمپانیای مۆبایل (AS 64500)، دابینکەری نێودەوڵەتی (AS 64501) و کۆمپانیای ڤیدیۆ (AS 64502). لەسەر هەر هەورێک نووسراوە «لە ناوەوە: IGPـی خۆی». بەستەرەکانی نێوان هەورەکان eBGPـن. تێبینییەک دەڵێت: لە ناو هەر ASـێکدا IGPـێک کە خاوەنەکەی هەڵی دەبژێرێت؛ لە نێوان ASـەکاندا BGP.
Inside each network: its own routing protocol. Between the networks: BGP.لە ناو هەر : خۆی. لە نێوان : .CêIT

You met the two groups of routing protocols in IGP and EGP: interior protocols such as OSPF work inside one network; BGP works between networks. This lesson explains how BGP does that, why it chooses paths by policy, and how to configure it on Cisco routers.

دوو گرووپەکەی لە IGP و EGP ناسیت: ناوخۆییەکانی وەک لە ناو یەک کار دەکەن؛ لە نێوان کار دەکات. ئەم وانەیە ڕوون دەکاتەوە چۆن ئەوە دەکات، بۆچی ڕێگە بەپێی سیاسەت هەڵدەبژێرێت و چۆن لەسەر Cisco ڕێکی دەخەیت.

Autonomous systemsسیستەمە سەربەخۆکان

An autonomous system (AS) is a group of networks and routers run by one organisation with one routing policy: one Internet provider, one mobile operator, one university or one large company. Inside, the owner decides everything: which routers, which addresses, which interior protocol. Outside, the AS is one unit with one number. The Kurdish name says the same: «سیستەمی سەربەخۆ», an independent system.

⁦(AS)⁩ گرووپێکە لە و کە یەک دامەزراوە بە یەک سیاسەتی بەڕێوەی دەبات: یەک ، یەک کۆمپانیای مۆبایل، یەک زانکۆ یان یەک کۆمپانیای گەورە. لە ناوەوە خاوەنەکەی هەموو شتێک بڕیار دەدات: کام ، کام ناونیشان، کام ناوخۆیی. لە دەرەوە AS یەک یەکەیە بە یەک ژمارە. ناوە کوردییەکەشی هەمان شت دەڵێت: سیستەمێک کە سەربەخۆیە.

Definitionپێناسە

A group of networks under one organisation's control with one routing policy, such as an ISP or a large university, identified by an AS number (ASN; 16 or 32 bits). The Internet is a network of tens of thousands of autonomous systems joined by BGP.

کۆمەڵێک ڕایەڵەیە لەژێر کۆنترۆڵی یەک دامەزراوەدا بە یەک سیاسەتی ڕێدۆزی، وەک یان زانکۆیەکی گەورە، کە بە ژمارەی ⁦AS (ASN⁩؛ ⁦16⁩ یان ⁦32⁩ بیتی) دەناسرێتەوە. ڕایەڵەیەکە لە دەیان هەزار سیستەمی سەربەخۆ کە بە بەیەکەوە بەستراون.

Two operators, one phone callدوو کۆمپانیا، یەک پەیوەندیی تەلەفۆنی

Think of two mobile operators in Kurdistan. Each one builds and runs its own network, and neither tells the other how to route inside it. Still, when a customer of one calls a customer of the other, the two networks must exchange traffic at their border. Each operator is an autonomous system; what they agree at the border is what BGP carries: “these addresses are reached through me”.

دوو کۆمپانیای مۆبایل لە کوردستان بهێنە بەرچاو. هەریەکەیان خۆی دروست دەکات و بەڕێوەی دەبات و هیچیان بە ئەوی تر ناڵێت لە ناوەوە چۆن بکات. لەگەڵ ئەوەشدا، کاتێک کڕیارێکی یەکەمیان پەیوەندی بە کڕیارێکی دووەمیانەوە دەکات، دوو دەبێت لە سنوورەکەیاندا هاتوچۆ ئاڵوگۆڕ بکەن. هەر کۆمپانیایەک ؛ ئەوەی لە سنوورەکەدا لەسەری ڕێک دەکەون ئەوەیە کە دەیگوازێتەوە: «بۆ گەیشتن بەم ناونیشانانە بە مندا وەرن».

Where the analogy stops workingسنووری ئەم نموونەیە

Real operators also exchange traffic through exchange points and international carriers, and voice calls use more than BGP. The example only shows why two independent networks need an agreed way to swap routes.

کۆمپانیا ڕاستەقینەکان لە ڕێی و گوازەرەوە نێودەوڵەتییەکانیشەوە هاتوچۆ ئاڵوگۆڕ دەکەن و پەیوەندیی دەنگیش زیاتر لە بەکار دەهێنێت. نموونەکە تەنیا پیشان دەدات بۆچی دوو سەربەخۆ پێویستیان بە ڕێگایەکی ڕێککەوتوو هەیە بۆ ئاڵوگۆڕی ڕێگەکان.

Today about 80,000 autonomous systems announce routes on the Internet (79,851 IPv4 ASes in the CIDR Report of 7 November 2026). Big content companies run their own: Wikimedia, the organisation behind Wikipedia, is AS14907.

ئەمڕۆ نزیکەی ⁦80,000⁩ ڕێگە لەسەر ڕادەگەیەنن (⁦79,851 AS⁩ـی لە CIDR Reportـی 7ی تشرینی دووەمی ⁦2026⁩دا). کۆمپانیا گەورەکانی ناوەڕۆک هی خۆیان هەیە: Wikimedia، ئەو دامەزراوەیەی Wikipediaـی لە پشتە، ⁦AS14907⁩ـە.

AS numbers: public, private and for booksژمارەی AS: گشتی، تایبەت و بۆ کتێب

Every autonomous system that connects to the Internet has a unique AS number (ASN). Like public IP addresses, ASNs come from IANA through the regional registries; a network in Iraq gets one from RIPE NCC. AS numbers were 16 bits (up to 65,535). When they started to run out, 32-bit numbers were added (RFC 4893 in 2007, now RFC 6793), so up to 4,294,967,295.

هەر کە بە دەبەسترێت ژمارەیەکی ASـی ⁦(ASN)⁩ تاقانەی هەیە. وەک ، ASNـەکان لە IANAـوە لە ڕێی تۆمارگە هەرێمییەکانەوە دێن؛ لە عێراق لە RIPE NCCـەوە وەریدەگرێت. ژمارەکانی AS پێشتر ⁦16⁩ بوون (تا ⁦65,535⁩). کاتێک خەریک بوو تەواو دەبوون، ژمارەی ⁦32⁩ زیاد کران ( ⁦4893⁩ لە ⁦2007⁩، ئێستا ⁦6793⁩)، بۆیە تا ⁦4,294,967,295⁩.

Two bars. 16-bit numbers: 0 reserved, 1–64495 public (registered to one network), 64496–64511 documentation, 64512–65534 private (labs, inside), 65535 reserved. 32-bit numbers (4 bytes, since 2007): 65536–65551 documentation, 65552–131071 reserved, 131072–4199999999 public (handed out by the regional registries), 4200000000–4294967294 private, 4294967295 reserved. Note: this course’s labs use private numbers such as 65001, 65002, 65003; a few other numbers such as 23456 are kept for special uses.دوو شریت. ژمارەی 16 بیتی: 0 پارێزراو، 1–64495 گشتی (تۆمارکراو بۆ یەک ڕایەڵە)، 64496–64511 بۆ بەڵگەنامەکردن، 64512–65534 تایبەت (تاقیگە، ناوخۆ)، 65535 پارێزراو. ژمارەی 32 بیتی (4 بایت، لە 2007ـەوە): 65536–65551 بۆ بەڵگەنامەکردن، 65552–131071 پارێزراو، 131072–4199999999 گشتی (تۆمارگە هەرێمییەکان دابەشی دەکەن)، 4200000000–4294967294 تایبەت، 4294967295 پارێزراو. تێبینی: تاقیکردنەوەکانی ئەم کۆرسە ژمارە تایبەتەکانی وەک 65001، 65002 و 65003 بەکار دەهێنن؛ چەند ژمارەیەکی تریش وەک 23456 بۆ کاری تایبەت پارێزراون.
Private ASNs are to AS numbers what 192.168.x.x is to IP addresses.ASNـی تایبەت بۆ ژمارەی AS وەک ⁦192.168.x.x⁩ـە بۆ .CêIT

Two kinds are never seen on the Internet. Private ASNs — 64512–65534 and 4200000000–4294967294 (RFC 6996) — are for labs and for networks inside one organisation, like private IP addresses. Documentation ASNs — 64496–64511 and 65536–65551 (RFC 5398) — are for books and examples. That is why this course uses 65001, 65002 and so on in labs, and 64500 and similar numbers in pictures of the real Internet.

دوو جۆر هەرگیز لەسەر نابینرێن. ASNـی تایبەت — ⁦64512–65534⁩ و ⁦4200000000–4294967294⁩ ( ⁦6996⁩) — بۆ تاقیگە و بۆ لە ناو یەک دامەزراوەدان، وەک . ASNـی بەڵگەنامەکردن — ⁦64496–64511⁩ و ⁦65536–65551⁩ ( ⁦5398⁩) — بۆ کتێب و نموونەن. بۆیە ئەم کۆرسە لە تاقیکردنەوەکاندا ⁦65001⁩، ⁦65002⁩ و هتد بەکار دەهێنێت و لە وێنەکانی ڕاستەقینەدا ⁦64500⁩ و ژمارەی هاوشێوە.

How BGP neighbours talk: TCP port 179ڕێدۆزە دراوسێکانی BGP چۆن قسە دەکەن: TCP پۆرت ⁦179⁩

Today’s version is BGP-4, defined in RFC 4271 (2006) and updated by many later RFCs. Two BGP routers that exchange routes are neighbours, also called peers. Unlike OSPF or EIGRP, BGP does not discover its neighbours: you type each one by hand. They then open an ordinary TCP connection to port 179, so every message arrives reliably and in order.

وەشانی ئەمڕۆ ⁦BGP-4⁩ـە کە لە ⁦4271 (2006)⁩ پێناسە کراوە و زۆر دواتر نوێیان کردۆتەوە. دوو کە ڕێگە ئاڵوگۆڕ دەکەن ـن کە پێیان دەگوترێت یش. بە پێچەوانەی یان ، خۆی نادۆزێتەوە: هەریەکەیان بە دەست دەنووسیت. پاشان پەیوەندییەکی ئاسایی بۆ ⁦179⁩ دەکەنەوە، بۆیە هەموو پەیامێک بە دڵنیایی و بە ڕیز دەگات.

A message ladder between R1 in AS 65001 and R2 in AS 65002. First the TCP handshake to port 179: SYN, SYN-ACK, ACK. Then OPEN messages in both directions with each AS number and router ID, then KEEPALIVE both ways; the state becomes Established. Then UPDATE messages: R1 sends 192.168.1.0/24 with AS_PATH 65001, R2 sends 192.168.3.0/24 with AS_PATH 65002. At the bottom: afterwards only changes are sent, and a KEEPALIVE every 60 seconds by Cisco default.پەیژەیەکی پەیام لە نێوان R1 لە AS 65001 و R2 لە AS 65002. یەکەم سێ ڕێی تەوقەکردنی TCP بۆ پۆرت 179: SYN، SYN-ACK، ACK. پاشان پەیامی OPEN لە هەردوو ئاڕاستەدا بە ژمارەی AS و ناسێنەری ڕێدۆز، پاشان KEEPALIVE بۆ هەردوولا؛ دۆخەکە دەبێتە Established. پاشان پەیامی UPDATE: R1 ‏192.168.1.0/24 بە AS_PATH 65001 دەنێرێت، R2 ‏192.168.3.0/24 بە AS_PATH 65002. لە خوارەوە: دواتر تەنیا گۆڕانکارییەکان دەنێردرێن و بە بنەڕەتی Cisco هەر 60 چرکە جارێک KEEPALIVE.
TCP first, then OPEN, KEEPALIVE and UPDATE.سەرەتا ، پاشان OPEN، KEEPALIVE و UPDATE.CêIT

BGP has four message types: OPEN starts the session (with the AS number and the router ID), UPDATE announces or withdraws routes, KEEPALIVE says “I am still here” (every 60 seconds on Cisco; after 180 seconds of silence the neighbour is declared down) and NOTIFICATION reports an error and closes the session. After the first full exchange, BGP sends only changes — never its whole table again.

چوار جۆر پەیامی هەیە: OPEN پەیوەندییەکە دەست پێ دەکات (بە ژمارەی AS و )، UPDATE ڕێگە ڕادەگەیەنێت یان دەکشێنێتەوە، KEEPALIVE دەڵێت «هێشتا لێرەم» (لە Cisco هەر ⁦60⁩ چرکە جارێک؛ دوای ⁦180⁩ چرکە بێدەنگی بە کوژاوە دادەنرێت) و NOTIFICATION هەڵەیەک ڕادەگەیەنێت و پەیوەندییەکە دادەخات. دوای یەکەم ئاڵوگۆڕی تەواو، تەنیا گۆڕانکارییەکان دەنێرێت — هەرگیز دووپاتە هەموو خشتەکەی نا.

Path vector: every route carries its pathڕێڕەوی ئاڕاستە: هەموو ڕێگەیەک ڕێڕەوەکەی خۆی هەڵدەگرێت

OSPF is a link-state protocol: every router draws a map. BGP is a path-vector protocol (the family tree): every route it announces carries a list of the autonomous systems it has passed through, the AS_PATH. Each AS puts its own number at the front before it passes the route to another AS. Both are ways of choosing the best path from one network to another; they just keep different information.

: هەموو نەخشەیەک دەکێشێت. ـە (داری خێزانەکە): هەموو ڕێگەیەک کە ڕایدەگەیەنێت لیستی ئەو ASـانەی هەڵدەگرێت کە پێیاندا تێپەڕیوە، ⁦AS_PATH⁩. هەر ASـێک پێش ئەوەی ڕێگەکە بداتە ASـێکی تر ژمارەی خۆی دەخاتە پێشەوەی لیستەکە. هەردووکیان ڕێگان بۆ هەڵبژاردنی باشترین ڕێڕەو لە بۆ تر؛ تەنیا زانیاریی جیاواز هەڵدەگرن.

Animation with four clouds, AS 65001 to AS 65004, joined in a row and by a link back from 65004 to 65001. AS 65001 owns 10.1.0.0/16. Its update travels right: AS 65002 learns path 65001, AS 65003 learns 65002 65001, AS 65004 learns 65003 65002 65001. When the update comes back to AS 65001 with 65004 65003 65002 65001, AS 65001 sees its own number and drops it. Last frame: AS 65004 knows two paths, 65001 and 65003 65002 65001, and prefers the shorter.
Animation with four clouds, AS 65001 to AS 65004, joined in a row and by a link back from 65004 to 65001. AS 65001 owns 10.1.0.0/16. Its update travels right: AS 65002 learns path 65001, AS 65003 learns 65002 65001, AS 65004 learns 65003 65002 65001. When the update comes back to AS 65001 with 65004 65003 65002 65001, AS 65001 sees its own number and drops it. Last frame: AS 65004 knows two paths, 65001 and 65003 65002 65001, and prefers the shorter.
One number is added at every border; your own number in the path means a loop.لە هەر سنوورێکدا ژمارەیەک زیاد دەکرێت؛ ژمارەی خۆت لە ڕێڕەوەکەدا واتە .CêIT

The AS_PATH does two jobs. It stops loops: a router that finds its own AS number in a path rejects the route. And it is a length: when nothing else decides, the route through fewer autonomous systems wins. It does not count routers or link speeds inside each AS.

⁦AS_PATH⁩ دوو کار دەکات. ڕادەگرێت: کە ژمارەی ASـی خۆی لە ڕێڕەوێکدا ببینێت ڕێگەکە ڕەت دەکاتەوە. هەروەها درێژییە: کاتێک هیچ شتێکی تر بڕیار نادات، ئەو ڕێگەیەی بە ASـی کەمتردا تێدەپەڕێت دەباتەوە. یان خێرایی بەستەرەکانی ناو هەر ASـێک ناژمێرێت.

Policy: the owner decides what “best” meansسیاسەت: خاوەنەکە بڕیار دەدات «باشترین» چییە

Inside one company, the best path is simply the fastest. Between companies, money and agreements matter. A small network buys transit from a bigger provider, which then carries its traffic to the whole Internet. Two networks of similar size often agree to swap their own customers’ traffic for free — often at an exchange point. Nobody carries other people’s traffic without being paid.

لە ناو یەک کۆمپانیادا باشترین ڕێڕەو تەنیا خێراترینەکەیە. لە نێوان کۆمپانیاکاندا پارە و ڕێککەوتن گرنگن. بچووک گواستنەوە دەکڕێت لە دابینکەرێکی گەورەتر کە پاشان هاتوچۆکەی بۆ هەموو دەبات. دوو هاوقەبارە زۆرجار ڕێک دەکەون هاتوچۆی کڕیارەکانی خۆیان بە بێبەرانبەری ئاڵوگۆڕ بکەن — زۆرجار لە خاڵێکی ئاڵوگۆڕی ئینتەرنێتدا. کەس هاتوچۆی خەڵکی تر بەبێ پارە ناگوازێتەوە.

A big provider (AS 64510) at the top and two operators, A (AS 64500) and B (AS 64501), below it. Each operator has a transit link up to the provider and pays for it. Between A and B there is a direct link for free exchange, carrying only A’s and B’s own customers. Note: A sends traffic for B’s customers over the free link even if another path is shorter; BGP lets each network say what “best” means for it.دابینکەرێکی گەورە (AS 64510) لە سەرەوە و دوو کۆمپانیا، A (AS 64500) و B (AS 64501)، لە خوارەوەی. هەر کۆمپانیایەک بەستەرێکی گواستنەوەی بۆ دابینکەرەکە هەیە و پارەی بۆ دەدات. لە نێوان A و Bـدا بەستەرێکی ڕاستەوخۆ بۆ ئاڵوگۆڕی بێبەرانبەر هەیە کە تەنیا کڕیارەکانی خودی A و B هەڵدەگرێت. تێبینی: A هاتوچۆی کڕیارەکانی B بە بەستەرە بێبەرانبەرەکەدا دەنێرێت تەنانەت ئەگەر ڕێڕەوێکی تر کورتتر بێت؛ BGP ڕێگە بە هەر ڕایەڵەیەک دەدات بڵێت «باشترین» بۆ ئەو چییە.
Transit is bought; direct exchange is free; policy chooses between them.گواستنەوە دەکڕدرێت؛ ئاڵوگۆڕی ڕاستەوخۆ بێبەرانبەرە؛ سیاسەت لە نێوانیاندا هەڵدەبژێرێت.CêIT

So BGP chooses by policy first. The administrator can say “prefer this neighbour”, “never send these routes to that neighbour” or “do not carry traffic for others”. Only when the policies are equal does BGP fall back to the shortest AS_PATH and a few more tie-breakers. That is how ISPs “manage and optimise traffic” with BGP: not by measuring speed, but by choosing which agreements to use.

بۆیە سەرەتا بەپێی سیاسەت هەڵدەبژێرێت. بەڕێوەبەر دەتوانێت بڵێت «ئەم پێ باشترە»، «هەرگیز ئەم ڕێگانە بۆ ئەو مەنێرە» یان «هاتوچۆی خەڵکی تر مەگوازەرەوە». تەنیا کاتێک سیاسەتەکان وەک یەکن دەگەڕێتەوە بۆ کورتترین ⁦AS_PATH⁩ و چەند پێوەرێکی تری یەکلاکەرەوە. بەم شێوەیە بە «هاتوچۆ بەڕێوە دەبەن و باشتری دەکەن»: نەک بە پێوانی خێرایی، بەڵکو بە هەڵبژاردنی ئەوەی کام ڕێککەوتن بەکار بهێنن.

eBGP between ASes, iBGP inside oneeBGP لە نێوان ASـەکان، iBGP لە ناو یەکێکیاندا

When two BGP routers are in different ASes, the session is external BGP (eBGP). That is the main job of BGP, and the neighbours are usually directly connected. A large AS often has several border routers; to share the outside routes among them, it also runs BGP inside: internal BGP (iBGP) between routers with the same AS number. iBGP does not replace OSPF — the interior protocol still finds the paths between the routers.

کاتێک دوو لە ASـی جیاوازدان، پەیوەندییەکە دەرەکییە ⁦(eBGP)⁩. ئەوە کاری سەرەکیی و زۆربەی کات ڕاستەوخۆ بەستراون. ASـێکی گەورە زۆرجار چەند سنووری هەیە؛ بۆ ئەوەی ڕێگە دەرەکییەکان لە نێوانیاندا هاوبەش بکات، لە ناوەوەش بەکار دەهێنێت: ناوخۆیی ⁦(iBGP)⁩ لە نێوان ئەو هەمان ژمارەی ASـیان هەیە. iBGP جێگەی ناگرێتەوە — ناوخۆییەکە هێشتا ڕێڕەوەکانی نێوان دەدۆزێتەوە.

AS 65001, one company, drawn as a large box with three routers R1, R2 and R3. Solid lines join R1–R2 and R3–R2 (OSPF inside). Dashed blue iBGP lines join every pair of routers. R1 has an eBGP link to AS 65002 on the left; R3 has an eBGP link to AS 65003 on the right. Two cards: eBGP — different AS numbers, AD 20, usually directly connected; iBGP — the same AS number, AD 200, every pair or route reflectors.AS 65001، یەک کۆمپانیا، وەک چوارگۆشەیەکی گەورە بە سێ ڕێدۆز: R1، R2 و R3. هێڵی تەواو R1–R2 و R3–R2 دەبەستێتەوە (OSPF لە ناوەوە). هێڵی شینی پچڕپچڕی iBGP هەموو جووتێک ڕێدۆز دەبەستێتەوە. R1 بەستەرێکی eBGPـی بۆ AS 65002 لە چەپ هەیە؛ R3 بەستەرێکی eBGPـی بۆ AS 65003 لە ڕاست هەیە. دوو کارت: eBGP — ژمارەی ASـی جیاواز، AD 20، زۆربەی کات ڕاستەوخۆ بەستراو؛ iBGP — هەمان ژمارەی AS، AD 200، هەموو جووتێک یان route reflector.
Different AS numbers: eBGP. The same AS number: iBGP.ژمارەی ASـی جیاواز: eBGP. هەمان ژمارەی ⁦AS: iBGP⁩.CêIT

Two rules follow. A route learned from one iBGP neighbour is not passed to another iBGP neighbour (inside one AS the AS_PATH cannot catch loops), so iBGP routers must all peer with each other, or use route reflectors. And Cisco trusts eBGP routes with an administrative distance of 20, iBGP routes with 200.

دوو یاسا لێیەوە دێن. ڕێگەیەک کە لە iBGPـەوە فێر بوو نادرێتە تری iBGP (لە ناو یەک ASـدا ⁦AS_PATH⁩ ناتوانێت بگرێت)، بۆیە iBGP دەبێت هەموویان لەگەڵ یەکتریدا ببنە ، یان route reflector بەکار بهێنن. هەروەها Cisco متمانە بە ڕێگەکانی eBGP دەکات بە مەودای بەڕێوەبەریـی ⁦20⁩ و بە ڕێگەکانی iBGP بە ⁦200⁩.

OSPF and BGP comparedبەراوردی OSPF و BGP

A common question is how BGP differs from OSPF. They do different jobs, so the right comparison is “inside” against “between”:

پرسیارێکی باو ئەوەیە کە چ جیاوازییەکی لەگەڵ هەیە. دوو کاری جیاواز دەکەن، بۆیە بەراوردی دروست «ناوەوە» بەرانبەر «نێوان»ـە:

OSPF works inside an AS; BGP works between ASes. لە ناو ASـدا کار دەکات؛ لە نێوان ASـەکاندا.
FeatureتایبەتمەندیOSPFBGP
Whereلە کوێInside one AS (an IGP)لە ناو یەک AS ()Between ASes (the EGP); also inside very large networksلە نێوان ASـەکان ()؛ هەروەها لە ناو زۆر گەورەدا
Kindجۆر: every router has the map: هەموو نەخشەکەی هەیە: each route carries its AS_PATH: هەر ڕێگەیەک ⁦AS_PATH⁩ـی خۆی هەڵدەگرێت
Best pathباشترین ڕێڕەوLowest cost (from bandwidth)کەمترین تێچوو (لە )Policy first, then the shortest AS_PATHسەرەتا سیاسەت، پاشان کورتترین ⁦AS_PATH⁩
NeighboursFound automatically with hellosبە خۆکاری بە سڵاو دەدۆزرێنەوەTyped by hand; TCP port 179بە دەست دەنووسرێن؛ ⁦179⁩
SizeقەبارەOne organisation’s routers یەک دامەزراوەAbout 1.09 million IPv4 routes on the whole Internetنزیکەی ⁦1.09⁩ ملیۆن ڕێگەی لە هەموو
After a changeدوای گۆڕانکاریConverges in seconds لە چەند چرکەیەکدا ڕوو دەداتSlower, built for stabilityهێواشترە، بۆ جێگیری دروست کراوە
Bar chart of the global BGP table on 7 November 2026 (CIDR Report): 1,090,028 IPv4 prefixes, 264,768 IPv6 prefixes, and 4 routes in your two-AS lab. 79,851 ASes announce IPv4 routes.هێڵکارییەکی ستوونی بۆ خشتەی جیهانیی BGP لە 7ی تشرینی دووەمی 2026 (CIDR Report): 1,090,028 پێشگری IPv4، 264,768 پێشگری IPv6 و 4 ڕێگە لە تاقیکردنەوە دوو ASـییەکەتدا. 79,851 AS ڕێگەی IPv4 ڕادەگەیەنن.
The size that matters is the number of routes, not of routers.ئەو قەبارەیەی گرنگە ژمارەی ڕێگەکانە، نەک ژمارەی .CêIT

So BGP is not “for big networks” and OSPF “for small ones”: OSPF and IS-IS also run inside the largest ISPs. And BGP does not hold “millions of routers” — it holds the routes to every public network, about 1.09 million IPv4 prefixes in November 2026, a number that still grows every week.

کەواتە «بۆ گەورە» نییە و «بۆ بچووکەکان»: و ⁦IS-IS⁩ لە ناو گەورەترین کار دەکەن. هەروەها «ملیۆنان » هەڵناگرێت — ڕێگەکانی هەموو گشتی هەڵدەگرێت، نزیکەی ⁦1.09⁩ ملیۆن لە تشرینی دووەمی ⁦2026⁩دا، ژمارەیەک کە هێشتا هەموو هەفتەیەک زیاد دەکات.

Lab 1: two operators, two autonomous systemsتاقیکردنەوەی 1: دوو کۆمپانیا، دوو سیستەمی سەربەخۆ

Build this in Packet Tracer. Operator A is AS 65001 with the LAN 192.168.1.0/24; operator B is AS 65002 with 192.168.3.0/24. Their routers, R1 and R2, are 2911 routers with an HWIC-2T card: each LAN is on Gi0/0, and Se0/0/0 joins them over a serial link, 192.168.2.0/24; R1 is the DCE end. The serial link belongs to no AS’s customers, so we do not announce it.

ئەمە لە Packet Tracerـدا دروست بکە. کۆمپانیای A ئەوە ⁦AS 65001⁩ـە بە ⁦192.168.1.0/24⁩؛ کۆمپانیای B ئەوە ⁦AS 65002⁩ـە بە ⁦192.168.3.0/24⁩. ، ⁦R1⁩ و ⁦R2⁩، ⁦2911⁩ن بە کارتی ⁦HWIC-2T⁩: هەر لەسەر ⁦Gi0/0⁩ـە و ⁦Se0/0/0⁩ بە بەستەرێکی زنجیرەیی، ⁦192.168.2.0/24⁩، بەیەکیان دەبەستێت؛ ⁦R1⁩ سەری . بەستەرە زنجیرەییەکە هی کڕیاری هیچ ASـێک نییە، بۆیە ڕایناگەیەنین.

Lab topology. Left box, Operator A — AS 65001: PC1 192.168.1.2 on a switch, joined to R1 Gi0/0 192.168.1.1 (LAN 192.168.1.0/24). Right box, Operator B — AS 65002: PC2 192.168.3.2 on a switch, joined to R2 Gi0/0 192.168.3.1 (LAN 192.168.3.0/24). R1 Se0/0/0 .1 (DCE) and R2 Se0/0/0 .2 are joined by a serial link, 192.168.2.0/24. PC1’s gateway is 192.168.1.1, PC2’s is 192.168.3.1.تۆپۆلۆجیی تاقیکردنەوەکە. چوارگۆشەی چەپ، کۆمپانیای A — AS 65001: PC1 ‏192.168.1.2 لەسەر سویچێک، بەستراو بە R1 Gi0/0 ‏192.168.1.1 (ڕایەڵەی ناوچەیی 192.168.1.0/24). چوارگۆشەی ڕاست، کۆمپانیای B — AS 65002: PC2 ‏192.168.3.2 لەسەر سویچێک، بەستراو بە R2 Gi0/0 ‏192.168.3.1 (ڕایەڵەی ناوچەیی 192.168.3.0/24). R1 Se0/0/0 .1 (DCE) و R2 Se0/0/0 .2 بە بەستەرێکی زنجیرەیی بەستراون، 192.168.2.0/24. دەروازەی بنەڕەتیی PC1 ‏192.168.1.1ـە و هی PC2 ‏192.168.3.1.
Lab 1: two ASes joined by one serial link.تاقیکردنەوەی 1: دوو AS بە یەک بەستەری زنجیرەیی بەستراون.CêIT

First give the interfaces their addresses and switch them on, as in your first router, and put clock rate 64000 on R1’s serial interface (the DCE end). Check that R1 can ping 192.168.2.2. BGP can only start when this link works.

سەرەتا ناونیشان بدە بە و هەڵیان بکە، وەک لە یەکەم ڕێدۆزەکەت. پاشان clock rate 64000 لەسەر زنجیرەییەکەی ⁦R1⁩ دابنێ (سەری DCE). بپشکنە کە ⁦R1⁩ دەتوانێت بۆ ⁦192.168.2.2⁩ بکات. تەنیا کاتێک دەست پێ دەکات کە ئەم بەستەرە کار بکات.

Lab 1: three commands on each routerتاقیکردنەوەی 1: سێ فەرمان لەسەر هەر ڕێدۆزێک

BGP needs only three commands: router bgp <your AS> starts BGP in router configuration mode, neighbor <address> remote-as <its AS> names one neighbour by the address of its interface on the shared link and its AS number, and network … mask … says which of your networks to announce.

تەنیا پێویستی بە سێ هەیە: router bgp <your AS> لە باری ڕێکخستنی دەست پێ دەکات، neighbor <address> remote-as <its AS> ناو دەبات بە ناونیشانی لەسەر بەستەرە هاوبەشەکە و ژمارەی ASـەکەی؛ network … mask …ـیش دەڵێت کام خۆت ڕابگەیەنیت.

R1 — operator A, AS 65001⁦R1⁩ — کۆمپانیای A، ⁦AS 65001⁩TEXT
R1>enable
R1#configure terminal
R1(config)#router bgp 65001
R1(config-router)#neighbor 192.168.2.2 remote-as 65002
R1(config-router)#network 192.168.1.0 mask 255.255.255.0
R1(config-router)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 3

This router is in AS 65001.

ئەم لە ⁦AS 65001⁩دایە.

Lineدێڕی 4

The neighbour is R2’s serial address, and R2 is in AS 65002.

ناونیشانی زنجیرەیی ⁦R2⁩ـیە و ⁦R2⁩ لە ⁦AS 65002⁩دایە.

Lineدێڕی 5

Announce the LAN of operator A.

کۆمپانیای A ڕابگەیەنە.

R2 — operator B, AS 65002 (the mirror image)⁦R2⁩ — کۆمپانیای B، ⁦AS 65002⁩ (وێنەی ئاوێنەیی)TEXT
R2(config)#router bgp 65002
R2(config-router)#neighbor 192.168.2.1 remote-as 65001
%BGP-5-ADJCHANGE: neighbor 192.168.2.1 Up
R2(config-router)#network 192.168.3.0 mask 255.255.255.0
R2(config-router)#end
R2#copy running-config startup-config
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 3

As soon as both sides are configured, the TCP session to port 179 comes up and IOS logs it.

هەر کە هەردوولا ڕێکخران، پەیوەندیی بۆ ⁦179⁩ دەکرێتەوە و IOS تۆماری دەکات.

The network command in BGPفەرمانی network لە BGPـدا

In RIP, OSPF and EIGRP, network switches the protocol on for your interfaces in a range. In BGP it means something else: “announce exactly this prefix”. BGP announces it only if the same prefix, with the same mask, is already in the routing table — here as a connected route. It never looks for neighbours on interfaces.

لە ، و ، network بۆ ئەو هەڵدەکات کە دەکەونە ناو ئەو . لە واتایەکی تری هەیە: «ڕێک ئەم ڕابگەیەنە». تەنیا ئەو کاتە ڕایدەگەیەنێت کە هەمان ، بە هەمان ماسک، پێشتر لە هەبێت — لێرەدا وەک . هەرگیز لەسەر بەدوای ناگەڕێت.

Two panels. Left, in RIP, OSPF and EIGRP: network 192.168.1.0 means “run the protocol on my interfaces inside this range” — hellos go out of them, neighbours are found and their networks advertised. Right, in BGP: network 192.168.1.0 mask 255.255.255.0 means “announce exactly this prefix to my BGP neighbours”; it must already be in the routing table with the same mask and it finds no neighbours. A routing-table line C 192.168.1.0/24 matches. Note: no mask means the old class mask, so 10.0.0.0 means /8 and does not match a 10.0.0.0/24 LAN.دوو بەش. چەپ، لە RIP، OSPF و EIGRPـدا: network 192.168.1.0 واتە «پرۆتۆکۆڵەکە لەسەر ئەو نێوبەستانەم کار پێ بکە کە دەکەونە ناو ئەم ڕایەڵەوە» — سڵاو لێیانەوە دەردەچێت، ڕێدۆزە دراوسێکان دەدۆزرێنەوە و ڕایەڵەکانیان ڕادەگەیەنرێن. ڕاست، لە BGPـدا: network 192.168.1.0 mask 255.255.255.0 واتە «ڕێک ئەم پێشگرە بۆ ڕێدۆزە دراوسێکانی BGPـی من ڕابگەیەنە»؛ دەبێت پێشتر بە هەمان ماسک لە خشتەی ڕێدۆزیدا هەبێت و هیچ ڕێدۆزێکی دراوسێ نادۆزێتەوە. دێڕی C 192.168.1.0/24 لە خشتەکەدا دەگونجێت. تێبینی: بێ ماسک واتە ماسکی پۆلە کۆنەکان، بۆیە 10.0.0.0 واتە /8 و لەگەڵ ڕایەڵەیەکی ناوچەیی 10.0.0.0/24دا ناگونجێت.
Same word, different meaning.هەمان وشە، واتای جیاواز.CêIT

Many lab examples write network 192.168.1.0 without mask. Then IOS uses the old class mask (/24 for 192.x, /16 for 172.16.x, /8 for 10.x). That happens to fit these labs, but a subnet such as 10.1.1.0/24 would never be announced. Always write the mask — it costs one word and removes the guessing.

زۆر نموونەی تاقیکردنەوە network 192.168.1.0 بەبێ mask دەنووسن. ئەو کاتە IOS ماسکی پۆلە کۆنەکان بەکار دەهێنێت (⁦/24⁩ بۆ ⁦192.x⁩، /⁦16⁩ بۆ ⁦172.16.x⁩، /8 بۆ ⁦10.x⁩). ئەمە ڕێکەوت لەگەڵ ئەم تاقیکردنەوانەدا دەگونجێت، بەڵام وەک ⁦10.1.1.0/24⁩ هەرگیز ڕاناگەیەنرێت. هەمیشە ماسکەکە بنووسە — یەک وشە دەکات و گومان لادەبات.

Lab 1: check the neighbours, the table and the routesتاقیکردنەوەی 1: ڕێدۆزە دراوسێکان، خشتەکە و ڕێگەکان بپشکنە

show ip bgp summary is the first check. Its last line has one row per neighbour. A number in the last column means the session is up (Established) and tells you how many prefixes came from that neighbour. A word such as Idle or Active means the session is not up.

show ip bgp summary یەکەم پشکنینە. دوا بەشەکەی بۆ هەر دێڕێکی هەیە. ژمارەیەک لە دوا ستوونەکەدا واتە پەیوەندییەکە کراوەیە (Established) و پێت دەڵێت چەند لەو هاتووە. وشەیەکی وەک Idle یان Active واتە پەیوەندییەکە نەکراوەتەوە.

R1: one neighbour, Established, 1 prefix received (the memory lines are left out)⁦R1⁩: یەک ڕێدۆزی دراوسێ، Established، 1 پێشگر وەرگیراوە (دێڕەکانی بیرگە لابراون)TEXT
R1#show ip bgp summary
BGP router identifier 192.168.2.1, local AS number 65001
BGP table version is 3, main routing table version 3

Neighbor        V           AS MsgRcvd MsgSent   TblVer  InQ OutQ Up/Down  State/PfxRcd
192.168.2.2     4        65002       6       7        3    0    0 00:03:12        1
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

The router ID is the highest interface address, because R1 has no loopback.

بەرزترین ناونیشانی ، چونکە ⁦R1⁩ نییە.

Lineدێڕی 6

AS 65002, up for 3 minutes 12 seconds, 1 prefix received.

⁦AS 65002⁩، 3 خولەک و ⁦12⁩ چرکە کراوەیە، 1 وەرگیراوە.

R1’s BGP table and routing table (both legends shortened)خشتەی BGP و خشتەی ڕێدۆزیی ⁦R1⁩ (ڕوونکردنەوەی هەردووکیان کورت کراوەتەوە)TEXT
R1#show ip bgp
BGP table version is 3, local router ID is 192.168.2.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.168.1.0      0.0.0.0                  0         32768 i
*> 192.168.3.0      192.168.2.2              0             0 65002 i

R1#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/0
L        192.168.1.1/32 is directly connected, GigabitEthernet0/0
      192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.2.0/24 is directly connected, Serial0/0/0
L        192.168.2.1/32 is directly connected, Serial0/0/0
B     192.168.3.0/24 [20/0] via 192.168.2.2, 00:03:05
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 8

Path 65002 i: the route came from AS 65002, where it started (i = announced with a network command).

ڕێڕەوی 65002 i: ڕێگەکە لە ⁦AS 65002⁩ـەوە هاتووە، کە لەوێ دەستی پێ کردووە (i = بە network ڕاگەیەنراوە).

Lineدێڕی 16-21

C and L lines: R1’s own networks and its own addresses (/32), as in every IOS 15 routing table.

دێڕەکانی C و L: خودی ⁦R1⁩ و ناونیشانەکانی خۆی ⁦(/32)⁩، وەک لە هەموو ⁦IOS 15⁩ـدا.

Lineدێڕی 22

B = learned by BGP; [20/0] = eBGP’s administrative distance 20 and metric 0.

B = لە ڕێی فێر بووە؛ [20/0] = eBGP ‏⁦20⁩ و 0.

Now PC1 can ping PC2. Packet Tracer’s 2911 shows the same lines; the older Router-PT and 2811 models run IOS 12, so their routing tables have no L lines and their summary has a narrower AS column.

ئێستا ⁦PC1⁩ دەتوانێت بۆ ⁦PC2⁩ بکات. ⁦2911⁩ـی Packet Tracer هەمان دێڕەکان پیشان دەدات؛ ⁦Router-PT⁩ و ⁦2811⁩ـی کۆنتر ⁦IOS 12⁩ بەکار دەهێنن، بۆیە دێڕی Lـی تێدا نییە و ستوونی ASـی کورتەکەیان تەسکترە.

Lab 2: three autonomous systems in a rowتاقیکردنەوەی 2: سێ سیستەمی سەربەخۆ بە ڕیز

In the second lab the middle router belongs to its own AS and has two eBGP neighbours, so traffic between the outer ASes crosses it. All the addresses are private. Take care with the second link: 172.17.0.0/16 is private, but a slip such as 172.14.0.0 lands in public address space, outside the private block 172.16.0.0/12. Address the interfaces as in Lab 1 (clock rate 64000 on R1’s Se0/0/0 and R2’s Se0/0/1, the DCE ends). Every network gets its mask.

لە تاقیکردنەوەی دووەمدا ناوەڕاستەکە هی ASـێکی خۆیەتی و دوو eBGPـی هەیە، بۆیە هاتوچۆی نێوان دوو ASـە دەرەکییەکە پێیدا تێدەپەڕێت. هەموو ناونیشانەکان تایبەتن. ئاگاداری بەستەری دووەم بە: ⁦172.17.0.0/16⁩ تایبەتە، بەڵام هەڵەیەکی وەک ⁦172.14.0.0⁩ دەکەوێتە ناو ناونیشانە گشتییەکانەوە، لە دەرەوەی بلۆکی تایبەتی ⁦172.16.0.0/12⁩. ناونیشانی وەک تاقیکردنەوەی 1 دابنێ (clock rate 64000 لەسەر ⁦Se0/0/0⁩ـی ⁦R1⁩ و ⁦Se0/0/1⁩ـی ⁦R2⁩، کە سەرەکانی ). هەموو networkـێک ماسکەکەی وەردەگرێت.

Three boxes in a row: AS 65001 with R1 and PC1 (10.0.0.2/8, R1 Gi0/0 10.0.0.1); AS 65002 with R2 in the middle; AS 65003 with R3 and PC2 (192.168.40.2/24, R3 Gi0/0 192.168.40.1). Serial links: R1 Se0/0/0 172.16.0.1 (DCE) to R2 Se0/0/0 172.16.0.2 (172.16.0.0/16); R2 Se0/0/1 172.17.0.1 (DCE) to R3 Se0/0/0 172.17.0.2 (172.17.0.0/16). Note: R2 has two eBGP neighbours and carries traffic between AS 65001 and AS 65003.سێ چوارگۆشە بە ڕیز: AS 65001 بە R1 و PC1 (10.0.0.2/8، R1 Gi0/0 10.0.0.1)؛ AS 65002 بە R2 لە ناوەڕاست؛ AS 65003 بە R3 و PC2 (192.168.40.2/24، R3 Gi0/0 192.168.40.1). بەستەرە زنجیرەییەکان: R1 Se0/0/0 172.16.0.1 (DCE) بۆ R2 Se0/0/0 172.16.0.2 (172.16.0.0/16)؛ R2 Se0/0/1 172.17.0.1 (DCE) بۆ R3 Se0/0/0 172.17.0.2 (172.17.0.0/16). تێبینی: R2 دوو ڕێدۆزی دراوسێی eBGPـی هەیە و هاتوچۆ لە نێوان AS 65001 و AS 65003 دەگوازێتەوە.
Lab 2: R2 joins AS 65001 and AS 65003.تاقیکردنەوەی ⁦2: R2 AS 65001⁩ و ⁦AS 65003⁩ دەبەستێتەوە.CêIT
The three routers (then end and copy running-config startup-config on each)سێ ڕێدۆزەکە (پاشان end و copy running-config startup-config لەسەر هەریەکەیان)TEXT
R1(config)#router bgp 65001
R1(config-router)#neighbor 172.16.0.2 remote-as 65002
R1(config-router)#network 10.0.0.0 mask 255.0.0.0
R1(config-router)#network 172.16.0.0 mask 255.255.0.0

R2(config)#router bgp 65002
R2(config-router)#neighbor 172.16.0.1 remote-as 65001
R2(config-router)#neighbor 172.17.0.2 remote-as 65003
R2(config-router)#network 172.16.0.0 mask 255.255.0.0
R2(config-router)#network 172.17.0.0 mask 255.255.0.0

R3(config)#router bgp 65003
R3(config-router)#neighbor 172.17.0.1 remote-as 65002
R3(config-router)#network 192.168.40.0 mask 255.255.255.0
R3 learns both networks of AS 65001’s side through R2 (legend shortened)⁦R3⁩ هەردوو ڕایەڵەکەی لای ⁦AS 65001⁩ لە ڕێی ⁦R2⁩ـەوە فێر دەبێت (ڕوونکردنەوەکە کورت کراوەتەوە)TEXT
R3#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area

Gateway of last resort is not set

B     10.0.0.0/8 [20/0] via 172.17.0.1, 00:02:41
B     172.16.0.0/16 [20/0] via 172.17.0.1, 00:02:41
      172.17.0.0/16 is variably subnetted, 2 subnets, 2 masks
C        172.17.0.0/16 is directly connected, Serial0/0/0
L        172.17.0.2/32 is directly connected, Serial0/0/0
      192.168.40.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.40.0/24 is directly connected, GigabitEthernet0/0
L        192.168.40.1/32 is directly connected, GigabitEthernet0/0

In R3’s BGP table, 10.0.0.0 has the path 65002 65001 i: two ASes away, learned from AS 65002, started in AS 65001.

لە خشتەی ⁦R3⁩ـدا، ⁦10.0.0.0⁩ ڕێڕەوی 65002 65001 iـی هەیە: دوو AS دوورە، لە ⁦AS 65002⁩ـەوە فێر بووە و لە ⁦AS 65001⁩ـدا دەستی پێ کردووە.

When BGP believes a lie: hijacks and RPKIکاتێک BGP درۆیەک باوەڕ دەکات: ڕفاندن و RPKI

BGP was built on trust: a router believes what its neighbours announce. If an AS announces addresses that are not its own — by a typing mistake or on purpose — other networks may send the owner’s traffic to it. This is a BGP hijack. A route leak is a related mistake: a network passes routes to neighbours that should never have received them, and traffic takes a wrong path.

لەسەر متمانە دروست کراوە: باوەڕ بەوە دەکات کە ڕایدەگەیەنن. ئەگەر ASـێک ناونیشانێک ڕابگەیەنێت کە هی خۆی نییە — بە هەڵەی نووسین یان بە ئەنقەست — تر لەوانەیە هاتوچۆی خاوەنەکە بۆ ئەو بنێرن. ئەمە ـە. هەڵەیەکی نزیک لەمە ئەوەیە کە ڕێگەکان بۆ ئەو دراوسێیانە بڵاو بکاتەوە کە نەدەبوو وەریان بگرن و هاتوچۆ ڕێڕەوێکی هەڵە بگرێت (route leak).

A famous case: on 24 February 2008 Pakistan Telecom announced 208.65.153.0/24, part of YouTube’s 208.65.152.0/22. Being more specific, it won by longest prefix match, and for about two hours much of the world’s YouTube traffic went to Pakistan.

نموونەیەکی بەناوبانگ: لە ⁦24⁩ی شوباتی ⁦2008⁩دا Pakistan Telecom ‏⁦208.65.153.0/24⁩ـی ڕاگەیاند کە بەشێکە لە ⁦208.65.152.0/22⁩ـی YouTube. چونکە وردتر بوو، بە گونجانی درێژترین پێشگر بردییەوە و نزیکەی دوو کاتژمێر زۆربەی هاتوچۆی YouTubeـی جیهان چوو بۆ پاکستان.

Two panels. Left, without origin validation: AS 64500, the real owner of 203.0.113.0/24, and AS 64511, which falsely claims the same prefix, both announce it to a router far away; with two origins, traffic may go to the thief. Right, with RPKI origin validation: a signed record (ROA) says only AS 64500 may announce the prefix; the router marks AS 64500’s route Valid and AS 64511’s route Invalid, drops the Invalid one, and packets keep going to the real owner.دوو بەش. چەپ، بەبێ پشکنینی سەرچاوە: AS 64500، خاوەنی ڕاستەقینەی 203.0.113.0/24 و AS 64511 کە بە درۆ بانگەشەی هەمان پێشگر دەکات، هەردووکیان بۆ ڕێدۆزێکی دوور ڕایدەگەیەنن؛ بە دوو سەرچاوە، لەوانەیە هاتوچۆ بچێت بۆ دزەکە. ڕاست، بە پشکنینی سەرچاوەی RPKI: تۆمارێکی واژووکراو (ROA) دەڵێت تەنیا AS 64500 بۆی هەیە پێشگرەکە ڕابگەیەنێت؛ ڕێدۆزەکە ڕێگەکەی AS 64500 بە Valid و ڕێگەکەی AS 64511 بە Invalid دادەنێت، Invalidـەکە فڕێ دەدات و پاکێتەکان هەر بۆ خاوەنە ڕاستەقینەکە دەچن.
RPKI lets a router check who may announce a prefix.RPKI ڕێگە بە دەدات بپشکنێت کێ بۆی هەیە ڕابگەیەنێت.CêIT

The main defence today is RPKI. The owner of an address block publishes a ROA, a record signed with a digital signature through its registry, saying which AS may announce it. Routers that do route origin validation (RFC 6811) mark each route Valid, Invalid or NotFound and drop the Invalid ones. Filters on what customers may announce help too.

بەرگریی سەرەکیی ئەمڕۆ RPKIـە. خاوەنی کۆمەڵە ناونیشانێک ROA بڵاو دەکاتەوە، تۆمارێک کە لە ڕێی تۆمارگەکەیەوە بە واژووی دیجیتاڵی واژوو کراوە و دەڵێت کام AS بۆی هەیە ڕایبگەیەنێت. ئەو پشکنینی سەرچاوەی ڕێگە دەکەن ( ⁦6811⁩) هەر ڕێگەیەک بە Valid، Invalid یان NotFound دادەنێن و Invalidـەکان فڕێ دەدەن. فلتەرکردنی ئەوەی کڕیاران بۆیان هەیە ڕایبگەیەنن یارمەتیش دەدات.

Common mistakesهەڵە باوەکان

Exercisesڕاهێنانەکان

ExerciseڕاهێنانLab 3: four ASes in a chainتاقیکردنەوەی 3: چوار AS وەک زنجیرە

Build this lab: four routers in a row, each in its own AS (65001–65004), with LANs 192.168.1.0/24 (R1) and 192.168.4.0/24 (R4) and the links 192.168.2.0/24, 192.168.3.0/24 and 192.168.5.0/24. Write the BGP configuration of every router so that PC1 can ping PC2, and say which AS_PATH R4 shows for 192.168.1.0.

ئەم تاقیکردنەوەیە دروست بکە: چوار بە ڕیز، هەریەکە لە ASـی خۆیدا ⁦(65001–65004)⁩، بە ⁦192.168.1.0/24 (R1)⁩ و ⁦192.168.4.0/24 (R4)⁩ و بەستەرەکانی ⁦192.168.2.0/24⁩، ⁦192.168.3.0/24⁩ و ⁦192.168.5.0/24⁩. هەموو بنووسە بۆ ئەوەی ⁦PC1⁩ بتوانێت بۆ ⁦PC2⁩ بکات و بڵێ ⁦R4⁩ چ ⁦AS_PATH⁩ـێک بۆ ⁦192.168.1.0⁩ پیشان دەدات.

Four boxes in a row, AS 65001 to AS 65004, with routers R1 to R4. PC1 192.168.1.2 on LAN 192.168.1.0/24 at the left of R1, PC2 192.168.4.2 on LAN 192.168.4.0/24 at the right of R4. Links: R1–R2 192.168.2.0/24, R2–R3 192.168.3.0/24, R3–R4 192.168.5.0/24. Example: R2 has 192.168.2.2 on its left link and 192.168.3.1 on its right link.چوار چوارگۆشە بە ڕیز، AS 65001 تا AS 65004، بە ڕێدۆزەکانی R1 تا R4. PC1 ‏192.168.1.2 لەسەر ڕایەڵەی ناوچەیی 192.168.1.0/24 لە چەپی R1، PC2 ‏192.168.4.2 لەسەر ڕایەڵەی ناوچەیی 192.168.4.0/24 لە ڕاستی R4. بەستەرەکان: R1–R2 192.168.2.0/24، R2–R3 192.168.3.0/24، R3–R4 192.168.5.0/24. نموونە: R2 لەسەر بەستەری چەپ 192.168.2.2ـی هەیە و لەسەر بەستەری ڕاست 192.168.3.1.
Four ASes, four routers, one chain.چوار AS، چوار ، یەک زنجیرە.CêIT
Show answerوەڵامەکە پیشان بدە
Answer (then copy running-config startup-config on every router)وەڵام (پاشان copy running-config startup-config لەسەر هەموو ڕێدۆزێک)TEXT
R1(config)#router bgp 65001
R1(config-router)#neighbor 192.168.2.2 remote-as 65002
R1(config-router)#network 192.168.1.0 mask 255.255.255.0

R2(config)#router bgp 65002
R2(config-router)#neighbor 192.168.2.1 remote-as 65001
R2(config-router)#neighbor 192.168.3.2 remote-as 65003
R2(config-router)#network 192.168.2.0 mask 255.255.255.0
R2(config-router)#network 192.168.3.0 mask 255.255.255.0

R3(config)#router bgp 65003
R3(config-router)#neighbor 192.168.3.1 remote-as 65002
R3(config-router)#neighbor 192.168.5.2 remote-as 65004
R3(config-router)#network 192.168.3.0 mask 255.255.255.0
R3(config-router)#network 192.168.5.0 mask 255.255.255.0

R4(config)#router bgp 65004
R4(config-router)#neighbor 192.168.5.1 remote-as 65003
R4(config-router)#network 192.168.5.0 mask 255.255.255.0
R4(config-router)#network 192.168.4.0 mask 255.255.255.0

R4 shows 65003 65002 65001 i for 192.168.1.0: it came from AS 65003, which got it from AS 65002, which got it from AS 65001, where it started.

⁦R4⁩ بۆ ⁦192.168.1.0⁩ 65003 65002 65001 i پیشان دەدات: لە ⁦AS 65003⁩ـەوە هاتووە، کە لە ⁦AS 65002⁩ـەوە وەریگرتووە، کە لە ⁦AS 65001⁩ـەوە وەریگرتووە، کە لەوێ دەستی پێ کردووە.

ExerciseڕاهێنانOSPF or BGP?OSPF یان BGP؟

For each job, choose OSPF or BGP and say why: (a) the routers of one university campus; (b) the link between that university and its two Internet providers; (c) routes between two mobile operators; (d) a three-router lab with one company.

بۆ هەر کارێک یان هەڵبژێرە و بڵێ بۆچی: ⁦(a)⁩ کەمپەسی یەک زانکۆ؛ ⁦(b)⁩ بەستەری نێوان ئەو زانکۆیە و دوو ؛ ⁦(c)⁩ ڕێگەکانی نێوان دوو کۆمپانیای مۆبایل؛ ⁦(d)⁩ تاقیکردنەوەیەکی سێ بە یەک کۆمپانیا.

Show answerوەڵامەکە پیشان بدە
  • (a) OSPF — inside one AS.
  • (b) BGP — between the university’s AS and the providers’ ASes.
  • (c) BGP — two different organisations, two ASes.
  • (d) OSPF — one company, one AS.
  • ⁦(a)⁩ — لە ناو یەک ASـدا.
  • ⁦(b)⁩ — لە نێوان ASـی زانکۆکە و ASـی دابینکەرەکان.
  • ⁦(c)⁩ — دوو دامەزراوەی جیاواز، دوو AS.
  • ⁦(d)⁩ — یەک کۆمپانیا، یەک AS.
ExerciseڕاهێنانPrivate, public or documentation?تایبەت، گشتی یان بەڵگەنامەکردن؟

Classify these AS numbers: 65010, 64500, 3356, 4200000005, 65535.

ئەم ژمارانەی AS پۆل بکە: ⁦65010⁩، ⁦64500⁩، ⁦3356⁩، ⁦4200000005⁩، ⁦65535⁩.

Show answerوەڵامەکە پیشان بدە
  • 65010 — private (64512–65534).
  • 64500 — documentation (64496–64511).
  • 3356 — public, registered to a real network.
  • 4200000005 — private 32-bit (4200000000–4294967294).
  • 65535 — reserved: never use it.
  • ⁦65010⁩ — تایبەت ⁦(64512–65534)⁩.
  • ⁦64500⁩ — بەڵگەنامەکردن ⁦(64496–64511)⁩.
  • ⁦3356⁩ — گشتی، بۆ ڕاستەقینە تۆمار کراوە.
  • ⁦4200000005⁩ — تایبەتی ⁦32⁩ ⁦(4200000000–4294967294)⁩.
  • ⁦65535⁩ — پارێزراوە: هەرگیز بەکاری مەهێنە.
ExerciseڕاهێنانRead the summaryکورتەکە بخوێنەرەوە

R2 shows 192.168.2.1 4 65001 0 0 1 0 0 never Idle. Give two likely causes and the command you would check first.

⁦R2⁩ ئەمە پیشان دەدات: 192.168.2.1 4 65001 0 0 1 0 0 never Idle. دوو هۆکاری گونجاو بڵێ و ئەو یەکەمجار دەیپشکنیت.

Show answerوەڵامەکە پیشان بدە

The session has never come up. Likely causes: the serial link is down (no clock on the DCE end, a missing no shutdown), or R1 has no matching neighbor 192.168.2.2 remote-as 65002. Check show ip interface brief and ping 192.168.2.1 first, then R1’s BGP lines.

پەیوەندییەکە هەرگیز نەکراوەتەوە. هۆکاری گونجاو: بەستەرە زنجیرەییەکە کوژاوەیە (کاتژمێر لەسەر سەری نییە، no shutdown لەبیر چووە)، یان ⁦R1⁩ neighbor 192.168.2.2 remote-as 65002ـی گونجاوی نییە. سەرەتا show ip interface brief و ping 192.168.2.1 بپشکنە، پاشان دێڕەکانی ⁦R1⁩.

Summaryکورتە

  • An autonomous system is a set of networks under one organisation with one routing policy; each has an AS number. Labs use private ASNs (64512–65534); books use 64496–64511.
  • BGP-4 (RFC 4271) is the routing protocol between ASes: neighbours configured by hand, TCP port 179, messages OPEN, UPDATE, KEEPALIVE, NOTIFICATION.
  • BGP is path vector: the AS_PATH stops loops and measures length; policy decides first.
  • eBGP joins different ASes (AD 20); iBGP shares outside routes inside one AS (AD 200).
  • Configure: router bgp 65001, neighbor <address> remote-as <AS>, network <prefix> mask <mask>; check: show ip bgp summary, show ip bgp, B routes in show ip route.
  • The Internet table held about 1.09 million IPv4 routes in November 2026; RPKI origin validation protects against hijacks.
  • کۆمەڵێک لە ژێر یەک دامەزراوە بە یەک سیاسەتی ؛ هەریەکەیان ژمارەیەکی ASـی هەیە. تاقیکردنەوەکان ASNـی تایبەت بەکار دەهێنن ⁦(64512–65534)⁩؛ کتێبەکان ⁦64496–64511⁩.
  • ⁦BGP-4⁩ ( ⁦4271⁩) نێوان ASـەکانە: بە دەست ڕێک دەخرێن، ⁦179⁩، پەیامەکانی OPEN، UPDATE، KEEPALIVE، NOTIFICATION.
  • ـە: ⁦AS_PATH⁩ ڕادەگرێت و درێژی دەپێوێت؛ سیاسەت سەرەتا بڕیار دەدات.
  • eBGP ASـی جیاواز دەبەستێتەوە ⁦(AD 20)⁩؛ iBGP ڕێگە دەرەکییەکان لە ناو یەک ASـدا هاوبەش دەکات ⁦(AD 200)⁩.
  • ڕێکخستن: router bgp 65001، neighbor <address> remote-as <AS>، network <prefix> mask <mask>؛ پشکنین: show ip bgp summary، show ip bgp، ڕێگەکانی B لە show ip route.
  • خشتەی لە تشرینی دووەمی ⁦2026⁩دا نزیکەی ⁦1.09⁩ ملیۆن ڕێگەی بوو؛ پشکنینی سەرچاوەی RPKI لە دەمانپارێزێت.

Next chapter: services that every network needs — DHCP on a Cisco router.

بەشی داهاتوو: ئەو خزمەتگوزارییانەی هەموو پێویستی پێیانە — DHCP لەسەر ڕێدۆزێکی Cisco.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

DHCP on a Cisco Router and DHCP RelayDHCP لەسەر ڕێدۆزێکی Cisco و گوازەرەوەی DHCP

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.

Appearanceڕووکار

Modeدۆخ
Styleشێواز
Coloursڕەنگەکان

Saved on this device only.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.