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 و هەڵە باوەکان.
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.
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 یەک یەکەیە بە یەک ژمارە. ناوە کوردییەکەشی هەمان شت دەڵێت: سیستەمێک کە سەربەخۆیە.
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 بیتی) دەناسرێتەوە. ڕایەڵەیەکە لە دەیان هەزار سیستەمی سەربەخۆ کە بە بەیەکەوە بەستراون.
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 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 دەکەنەوە، بۆیە هەموو پەیامێک بە دڵنیایی و بە ڕیز دەگات.
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ـێکی تر ژمارەی خۆی دەخاتە پێشەوەی لیستەکە. هەردووکیان ڕێگان بۆ هەڵبژاردنی باشترین ڕێڕەو لە بۆ تر؛ تەنیا زانیاریی جیاواز هەڵدەگرن.


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.
لە ناو یەک کۆمپانیادا باشترین ڕێڕەو تەنیا خێراترینەکەیە. لە نێوان کۆمپانیاکاندا پارە و ڕێککەوتن گرنگن. بچووک گواستنەوە دەکڕێت لە دابینکەرێکی گەورەتر کە پاشان هاتوچۆکەی بۆ هەموو دەبات. دوو هاوقەبارە زۆرجار ڕێک دەکەون هاتوچۆی کڕیارەکانی خۆیان بە بێبەرانبەری ئاڵوگۆڕ بکەن — زۆرجار لە خاڵێکی ئاڵوگۆڕی ئینتەرنێتدا. کەس هاتوچۆی خەڵکی تر بەبێ پارە ناگوازێتەوە.
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 جێگەی ناگرێتەوە — ناوخۆییەکە هێشتا ڕێڕەوەکانی نێوان دەدۆزێتەوە.
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”:
پرسیارێکی باو ئەوەیە کە چ جیاوازییەکی لەگەڵ هەیە. دوو کاری جیاواز دەکەن، بۆیە بەراوردی دروست «ناوەوە» بەرانبەر «نێوان»ـە:
| Featureتایبەتمەندی | OSPF | BGP |
|---|---|---|
| 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 |
| Neighbours | Found 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هێواشترە، بۆ جێگیری دروست کراوە |
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ـێک نییە، بۆیە ڕایناگەیەنین.
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>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(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-configExplain 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 بۆ ئەو هەڵدەکات کە دەکەونە ناو ئەو . لە واتایەکی تری هەیە: «ڕێک ئەم ڕابگەیەنە». تەنیا ئەو کاتە ڕایدەگەیەنێت کە هەمان ، بە هەمان ماسک، پێشتر لە هەبێت — لێرەدا وەک . هەرگیز لەسەر بەدوای ناگەڕێت.
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#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 1Explain 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#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:05Explain 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ـێک ماسکەکەی وەردەگرێت.
end and copy running-config startup-config on each)سێ ڕێدۆزەکە (پاشان end و copy running-config startup-config لەسەر هەریەکەیان)TEXTR1(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.0R3#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/0In 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ـی جیهان چوو بۆ پاکستان.
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ڕاهێنانەکان
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 پیشان دەدات.
Show answerوەڵامەکە پیشان بدە
copy running-config startup-config on every router)وەڵام (پاشان copy running-config startup-config لەسەر هەموو ڕێدۆزێک)TEXTR1(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.0R4 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ـەوە وەریگرتووە، کە لەوێ دەستی پێ کردووە.
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.
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 — پارێزراوە: هەرگیز بەکاری مەهێنە.
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 inshow 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زاراوە سەرەکییەکان
DHCP on a Cisco Router and DHCP RelayDHCP لەسەر ڕێدۆزێکی Cisco و گوازەرەوەی DHCP
Related lecturesوانە پەیوەندیدارەکان
- LANs, MANs, WANs and the Internetڕایەڵەی ناوچەیی، ڕایەڵەی شاری، ڕایەڵەی فراوان و ئینتەرنێت
- Distance Vector and Link State: Bellman-Ford and Dijkstraمەودای ئاڕاستە و بارودۆخی بەستەر: بێڵمان-فۆرد و دایکسترا
- OSPF: Cost, Router IDs and Link-State AdvertisementsOSPF: تێچوو، ناسێنەرەکانی ڕێدۆز و LSAـەکان
- EIGRP: Cisco’s Advanced Distance-Vector ProtocolEIGRP: مەودای ئاڕاستەی پێشکەوتووی Cisco
- How a Packet Finds Its Way: Gateways and Routing Tablesپاکێت چۆن ڕێگای خۆی دەدۆزێتەوە: دەروازەی بنەڕەتی و خشتەکانی ڕێدۆزی
- Your First Router: Interfaces and Addressesیەکەم ڕێدۆز: نێوبەستەکان و ناونیشانەکان
- Encryption, Hashing and Digital Signaturesشفرەکردن، هاشکردن و واژووە دیجیتاڵییەکان
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- RFC 4271: A Border Gateway Protocol 4 (BGP-4) — inter-AS routing, TCP port 179, AS_PATH, message types (2006)
- RFC 6996: Autonomous System (AS) Reservation for Private Use (64512–65534, 4200000000–4294967294)
- RFC 5398: AS Number Reservation for Documentation Use (64496–64511, 65536–65551)
- RFC 6793: BGP Support for Four-Octet Autonomous System (AS) Number Space
- CIDR Report, 7 November 2026 (IPv4 table 1,090,028 prefixes; 79,851 ASes)
- CIDR Report for IPv6, 7 November 2026 (264,768 prefixes)
- Cisco: BGP Case Studies — eBGP and iBGP, TCP 179, the network command, iBGP full mesh, AS-path loop prevention (updated 8 June 2023)
- Cisco IOS BGP Configuration Guide: Configuring a Basic BGP Network (router ID, keepalive 60 s, hold time 180 s)
- Cisco IP Routing: BGP Command Reference — show ip bgp, show ip bgp summary field descriptions
- RFC 7938: Use of BGP for Routing in Large-Scale Data Centers
- RFC 6811: BGP Prefix Origin Validation (Valid, Invalid, NotFound)
- RIPE NCC: YouTube Hijacking — A RIPE NCC RIS case study (24 February 2008)
- Hurricane Electric BGP Toolkit: AS14907 (Wikimedia Foundation)
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.