Chapterبەش 5 · Lectureوانە 5.4

Access Control Lists: Filtering TrafficACLـەکان: فلتەرکردنی هاتوچۆ

What an ACL is and how a router reads it (top down, first match, the invisible deny any); wildcard masks with host and any; standard and extended ACLs and their numbers; applying ACLs inbound or outbound; where to place them; a standard and an extended lab on a school router with show access-lists counters; named ACLs and editing with sequence numbers; protecting VTY lines with access-class; ACLs that select traffic for NAT; ACLs versus stateful firewalls; common mistakes and exercises.

چییە و چۆن دەیخوێنێتەوە (لە سەرەوە بۆ خوارەوە، یەکەم گونجان، deny anyـی نەبینراو)؛ لەگەڵ host و any؛ و و ژمارەکانیان؛ جێبەجێکردنی ACL بە in یان out؛ لە کوێ دابنرێن؛ تاقیکردنەوەیەکی ستاندارد و یەکێکی درێژکراوە لەسەر قوتابخانەیەک لەگەڵ ژمێرەرەکانی ⁦show access-lists⁩؛ ACLـی ناودار و دەستکاری بە ؛ پاراستنی بە ⁦access-class⁩؛ ACL کە هاتوچۆ بۆ NAT هەڵدەبژێرێت؛ ACL بەرانبەر دۆخدار؛ هەڵە باوەکان و ڕاهێنانەکان.

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

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

  • Explain how a router processes an ACL: top-down order, first match and the implicit deny.
  • Write standard and extended ACL lines with wildcard masks, host, any, protocols and ports.
  • Apply ACLs to interfaces in the right direction and place standard and extended ACLs sensibly.
  • Verify ACLs with show access-lists and show ip interface, and edit named and numbered ACLs with sequence numbers.
  • Protect VTY lines with access-class and tell filtering ACLs from selecting ACLs and from stateful firewalls.
  • ڕوون بکەیتەوە چۆن جێبەجێ دەکات: ڕیزبەندیی سەرەوە بۆ خوارەوە، یەکەم گونجان و deny anyـی نەبینراو.
  • دێڕی و بنووسیت بە ، host، any، و .
  • بە ئاڕاستەی دروست لەسەر جێبەجێ بکەیت و و بە ژیرانە دابنێیت.
  • بە ⁦show access-lists⁩ و show ip interface بپشکنیت و ACLـی ناودار و ژمارەکراو بە دەستکاری بکەیت.
  • بە ⁦access-class⁩ بپارێزیت و ACLـی فلتەرکەر لە ACLـی هەڵبژێرەر و لە دۆخدار جیا بکەیتەوە.

A router forwards everything — unless you tell it not toڕێدۆز هەموو شتێک دەنێرێت — مەگەر پێی بڵێیت نا

A router’s job is to forward: if it has a route, the packet goes on. In this school, router R1 joins three LANs — staff, students and servers. The policy says students may open the web server but must never reach the exam server. R1 cannot keep that rule by itself: it has routes to every LAN, so it forwards every packet. An access control list (ACL) is how you give it rules.

کاری ناردنە: ئەگەر ڕێگەی هەبێت، بەردەوام دەبێت. لەم قوتابخانەیەدا ⁦R1⁩ سێ بەیەکەوە دەبەستێت — کارمەندان، قوتابیان و . سیاسەتەکە دەڵێت قوتابیان دەتوانن بکەنەوە بەڵام هەرگیز نابێت بگەنە تاقیکردنەوە. ⁦R1⁩ بە تەنیا ناتوانێت ئەو یاسایە بپارێزێت: ڕێگەی بۆ هەموو هەیە، بۆیە هەموو دەنێرێت. ئەو ڕێگایەیە کە یاسای پێ دەدەیت.

Router R1 in the middle. Left: Staff LAN 192.168.10.0/24 on G0/0/0 with the admin PC .5 and a PC .7; Students LAN 192.168.20.0/24 on G0/0/1 with PCs .25 and .30. Right: Server LAN 192.168.30.0/24 on G0/0/2 with WEB .10 and EXAM .20. Below: the school’s policy — students may open the web server, but must never reach the exam server; without an ACL, R1 forwards every packet it has a route for.ڕێدۆزی R1 لە ناوەڕاست. چەپ: ڕایەڵەی ناوچەیی کارمەندان 192.168.10.0/24 لەسەر G0/0/0 لەگەڵ PCـی بەڕێوەبەر .5 و PCـێک .7؛ ڕایەڵەی ناوچەیی قوتابیان 192.168.20.0/24 لەسەر G0/0/1 لەگەڵ PCـەکانی .25 و .30. ڕاست: ڕایەڵەی ناوچەیی ڕاژەکارەکان 192.168.30.0/24 لەسەر G0/0/2 لەگەڵ WEB .10 و EXAM .20. لە خوارەوە: سیاسەتی قوتابخانەکە — قوتابیان دەتوانن ڕاژەکاری وێبەکە بکەنەوە، بەڵام هەرگیز نابێت بگەنە ڕاژەکاری تاقیکردنەوە؛ بەبێ ACL، R1 هەموو پاکێتێک دەنێرێت کە ڕێگەی بۆی هەبێت.
The school network used in every example of this lesson. قوتابخانەکە کە لە هەموو نموونەکانی ئەم وانەیەدا بەکار دێت.CêIT

What an ACL isACL چییە

Definitionپێناسە

Access control list: an ordered list of permit and deny statements that a router checks against each packet one by one, from the top, until one matches; an invisible 'deny any' ends every list. ACLs filter traffic on interfaces (ip access-group … in|out) and pick traffic for NAT.

Access control list: لیستێکی ڕیزکراوی ڕستەکانی permit و denyـە کە یەک بە یەک لەگەڵ هەر بەراوردیان دەکات، لە سەرەوە بۆ خوارەوە، تا یەکێکیان دەگونجێت؛ ⁦'deny any'⁩ـیەکی نەبینراو کۆتایی بە هەموو لیستێک دەهێنێت (). ACLـەکان هاتوچۆ لەسەر فلتەر دەکەن (ip access-group … in|out) و هاتوچۆ بۆ هەڵدەبژێرن.

An ACL is an ordered list of permit and deny statements. Each line — an access control entry (ACE) — has a sequence number, an action and a description of the packets it matches. On an interface it works as a packet filter; elsewhere it only selects traffic, as you saw when access-list 1 picked the hosts for NAT (Dynamic NAT). The same idea is the heart of every firewall.

لیستێکی ڕیزکراوی ڕستەکانی permit و denyـە. هەر دێڕێک — تۆمارێکی ⁦(ACE)⁩ — ، بڕیارێک و وەسفی ئەو هەیە کە دەیانگرێتەوە. لەسەر وەک کار دەکات؛ لە شوێنی تر تەنیا هاتوچۆ هەڵدەبژێرێت، وەک بینیت کاتێک access-list 1 بۆ NAT هەڵبژارد (وەرگێڕانی بزۆکی ناونیشانی ڕایەڵە). هەمان بیرۆکە دڵی هەموو ئاگرەدیوارێکە.

A card titled Standard IP access list 10 with three lines: 10 deny host 192.168.20.25; 20 permit 192.168.20.0 0.0.0.255; 30 permit host 192.168.10.5; below a dashed line, an invisible deny any that is always last. An arrow on the left points from top to bottom. Captions: sequence number, action, what to match; each line is an access control entry (ACE).کارتێک بە ناونیشانی Standard IP access list 10 و سێ دێڕ: 10 deny host 192.168.20.25؛ 20 permit 192.168.20.0 0.0.0.255؛ 30 permit host 192.168.10.5؛ لە ژێر هێڵێکی پچڕپچڕ، deny anyـیەکی نەبینراو کە هەمیشە دوایینە. تیرێک لە چەپ لە سەرەوە بۆ خوارەوە ئاماژە دەکات. ڕوونکردنەوە: ژمارەی زنجیرە، بڕیار، ئەوەی دەبێت بگونجێت؛ هەر دێڕێک تۆمارێکی کۆنترۆڵی دەستڕاگەیشتنە (ACE).
An ACL as the router stores it. وەک هەڵیدەگرێت.CêIT
The guard with a printed listپاسەوانەکە و لیستە چاپکراوەکە

Think of the guard at the school gate holding a printed list. For each visitor he reads from the top: “Line 1: no visitors from Ranya Street. Line 2: parents may enter.” The first line that fits decides, and he stops reading. If no line fits, he says no.

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

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

A real guard remembers faces and can open a bag. An ACL remembers nothing and looks only at the packet’s headers (addresses, protocol, ports), never at its contents.

پاسەوانی ڕاستەقینە ڕووخسارەکان لە بیر دەگرێت و دەتوانێت جانتایەک بکاتەوە. هیچ شتێک لە بیر ناگرێت و تەنیا سەیری سەرپەڕەکانی دەکات (ناونیشانەکان، ، )، هەرگیز ناوەڕۆکەکەی نابینێت.

Top down, first match winsلە سەرەوە بۆ خوارەوە، یەکەم گونجان دەیباتەوە

For every packet, the router compares the lines in order, from the top. As soon as one line matches, its action (permit or deny) is applied and the rest of the list is not read. So the order of the lines is part of the rule: a broad line placed early hides every specific line below it.

بۆ هەر ، دێڕەکان بە ڕیز، لە سەرەوە بەراورد دەکات. هەر کە دێڕێک گونجا، بڕیارەکەی (permit یان deny) جێبەجێ دەکرێت و ئەوانی تری لیستەکە ناخوێندرێنەوە. بۆیە ڕیزبەندیی دێڕەکان بەشێکە لە یاساکە: دێڕێکی فراوان کە زوو دابنرێت هەموو دێڕێکی تایبەتی ژێر خۆی دەشارێتەوە.

Seven frames. ACL 10 has line 10 deny host 192.168.20.25, line 20 permit 192.168.20.0 0.0.0.255 and the invisible deny any. A packet from 192.168.20.25 matches line 10 and is dropped. A packet from 192.168.20.30 does not match line 10, matches line 20 and is forwarded. A packet from a staff PC, 192.168.10.7, matches neither line, reaches the invisible deny any and is dropped. Last frame: top down, first match wins; no match at all means denied.
Seven frames. ACL 10 has line 10 deny host 192.168.20.25, line 20 permit 192.168.20.0 0.0.0.255 and the invisible deny any. A packet from 192.168.20.25 matches line 10 and is dropped. A packet from 192.168.20.30 does not match line 10, matches line 20 and is forwarded. A packet from a staff PC, 192.168.10.7, matches neither line, reaches the invisible deny any and is dropped. Last frame: top down, first match wins; no match at all means denied.
Three packets meet the same list.سێ بە هەمان لیست دەگەن.CêIT

The invisible last line: deny anyدوایین دێڕی نەبینراو: deny any

Every ACL ends with a line you never typed and never see in show access-lists: deny any (in an extended ACL, deny ip any any). A packet that matches nothing is dropped. This is the deny-by-default rule of security. It has two big consequences: an ACL needs at least one permit, or it blocks everything; and if only one host should be blocked, the list must end with permit any.

هەموو بە دێڕێک کۆتایی دێت کە هەرگیز نەتنووسیوە و هەرگیز لە show access-listsـدا نایبینیت: deny any (لە ، deny ip any any). کە لەگەڵ هیچ شتێک نەگونجێت فڕێ دەدرێت. ئەمە یاسای ڕێگری وەک بنەڕەتـی ئاسایشە. دوو دەرئەنجامی گەورەی هەیە: پێویستی بە لانیکەم یەک permit هەیە، ئەگەر نا هەموو شتێک ڕادەگرێت؛ و ئەگەر تەنیا یەک دەبێت ڕابگیرێت، لیستەکە دەبێت بە permit any کۆتایی بێت.

Two cards. Left, orange, only deny lines: deny host 192.168.20.25, then the invisible deny any — a cross: everything is blocked, even the other students. Right, green, deny then permit any: deny host 192.168.20.25, permit any, then the invisible deny any — a tick: only .25 is blocked; everyone else passes.دوو کارت. چەپ، پرتەقاڵی، تەنیا دێڕی deny: deny host 192.168.20.25، پاشان deny anyـی نەبینراو — خاچ: هەموو شتێک ڕادەگیرێت، تەنانەت قوتابیانی تریش. ڕاست، سەوز، deny پاشان permit any: deny host 192.168.20.25، permit any، پاشان deny anyـی نەبینراو — نیشانەی ڕاست: تەنیا .25 ڕادەگیرێت؛ هەموو کەسێکی تر تێدەپەڕێت.
Forget the permit and the list blocks everyone.permitـەکە لەبیر بکە و لیستەکە هەموو کەسێک ڕادەگرێت.CêIT

Matching addresses with wildcard masksگونجاندنی ناونیشانەکان بە ماسکە پێچەوانەکان

ACLs describe groups of addresses with a wildcard mask, the same tool you used for OSPF network statements (Configuring OSPF). A 0 bit means “this bit must match”, a 1 bit means “ignore it”. The quick way: wildcard = 255.255.255.255 minus the subnet mask. Two shortcuts save typing: host 192.168.20.25 means 192.168.20.25 0.0.0.0 (exactly one address) and any means 0.0.0.0 255.255.255.255 (every address).

کۆمەڵە ناونیشان بە ماسکی پێچەوانە وەسف دەکەن، هەمان ئامرازی کە بۆ ڕستەکانی networkـی OSPF بەکارت هێنا (ڕێکخستنی OSPF). 0 واتە «ئەم دەبێت وەک یەک بێت»، 1 واتە «گرنگی پێ مەدە». ڕێگای خێرا: = ⁦255.255.255.255⁩ لابردنی . دوو کورتکراوە نووسین کەم دەکەنەوە: host 192.168.20.25 واتە 192.168.20.25 0.0.0.0 (ڕێک یەک ناونیشان) و any واتە 0.0.0.0 255.255.255.255 (هەموو ناونیشانێک).

A table. One host .25: 192.168.20.25 0.0.0.0, short form host 192.168.20.25. A /24 network: 192.168.20.0 0.0.0.255. A /26, .0 to .63: 192.168.20.0 0.0.0.63. A /27, .64 to .95: 192.168.20.64 0.0.0.31. Every address: 0.0.0.0 255.255.255.255, short form any. Below: wildcard = 255.255.255.255 minus the subnet mask; /26 is 255.255.255.192, so the wildcard is 0.0.0.63 = …00111111.خشتەیەک. یەک میوانگر، .25: 192.168.20.25 0.0.0.0، شێوەی کورت host 192.168.20.25. ڕایەڵەیەکی /24: 192.168.20.0 0.0.0.255. /26، .0 تا .63: 192.168.20.0 0.0.0.63. /27، .64 تا .95: 192.168.20.64 0.0.0.31. هەموو ناونیشانێک: 0.0.0.0 255.255.255.255، شێوەی کورت any. لە خوارەوە: ماسکی پێچەوانە = 255.255.255.255 لابردنی ماسکی ژێرڕایەڵە؛ /26 دەکاتە 255.255.255.192، بۆیە ماسکە پێچەوانەکە 0.0.0.63ـە = …00111111.
From mask to wildcard.لە ماسکەوە بۆ .CêIT

Standard and extended ACLsACLـی ستاندارد و ACLـی درێژکراوە

IOS has two kinds of IPv4 ACL. A standard ACL checks only the source address. An extended ACL can check the protocol, the source and destination addresses and the source and destination ports. The number you choose tells IOS which kind you mean; a name works for both (later in this lesson).

IOS دوو جۆر ACLـی ⁦IPv4⁩ـی هەیە. تەنیا ناونیشانی سەرچاوە دەپشکنێت. دەتوانێت ، ناونیشانی سەرچاوە و مەبەست و سەرچاوە و مەبەست بپشکنێت. ئەو ژمارەیەی هەڵیدەبژێریت بە IOS دەڵێت مەبەستت کام جۆرە؛ ناو بۆ هەردووکیان کار دەکات (دواتر لەم وانەیەدا).

The two kinds of numbered IPv4 ACL (the higher ranges were added in IOS 12.0.1).دوو جۆری ACLـی ژمارەکراوی ⁦IPv4⁩ (ژمارە بەرزەکان لە ⁦IOS 12.0.1⁩ـدا زیاد کران).
KindجۆرNumbersژمارەکانChecksدەپشکنێتPlace itلە کوێ دایبنێیت
Standardستاندارد1–99, 1300–1999source address onlyتەنیا ناونیشانی سەرچاوەclose to the destinationنزیک مەبەست
Extendedدرێژکراوە100–199, 2000–2699protocol, source, destination, ports، سەرچاوە، مەبەست، close to the sourceنزیک سەرچاوە
One packet split into five fields: protocol tcp, source address 192.168.20.25, destination address 192.168.30.20, source port 49200, destination port 443. The source address is green. Green card: standard ACL (1–99, 1300–1999), the source address only — access-list 10 deny host 192.168.20.25. Orange card: extended ACL (100–199, 2000–2699), all five fields — access-list 110 deny tcp host 192.168.20.25 host 192.168.30.20 eq 443.یەک پاکێت کە کراوە بە پێنج خانە: پرۆتۆکۆڵ tcp، ناونیشانی سەرچاوە 192.168.20.25، ناونیشانی مەبەست 192.168.30.20، پۆرتی سەرچاوە 49200، پۆرتی مەبەست 443. ناونیشانی سەرچاوە سەوزە. کارتی سەوز: ACLـی ستاندارد (1–99، 1300–1999)، تەنیا ناونیشانی سەرچاوە — access-list 10 deny host 192.168.20.25. کارتی پرتەقاڵی: ACLـی درێژکراوە (100–199، 2000–2699)، هەر پێنج خانەکە — access-list 110 deny tcp host 192.168.20.25 host 192.168.30.20 eq 443.
Standard sees one field; extended sees five.ستاندارد یەک خانە دەبینێت؛ درێژکراوە پێنج.CêIT

Applying an ACL: interface and directionجێبەجێکردنی ACL: نێوبەستە و ئاڕاستە

An ACL does nothing until you apply it to an interface, in a direction, with ip access-group <number or name> in|out in interface mode. Inbound (in) ACLs check packets as they arrive, before the routing decision; outbound (out) ACLs check packets that have been routed and are about to leave. Each interface takes one ACL per direction per protocol: at most one IPv4 ACL in, one IPv4 ACL out (and the same again for IPv6).

هیچ شتێک ناکات تا لەسەر ، لە ئاڕاستەیەکدا، جێبەجێی دەکەیت بە ip access-group <number or name> in|out لە باری . ACLـی هاتنەژوورەوە (in) لە کاتی گەیشتنیاندا دەپشکنێت، پێش بڕیاری ؛ ACLـی دەرچوون (out) ئەو دەپشکنێت کە بۆ کراوە و خەریکە دەردەچن. هەر بۆ هەر ئاڕاستەیەک و هەر یەک ACL وەردەگرێت: زۆرترین یەک ACLـی ⁦IPv4⁩ بۆ in، یەک بۆ out (و هەمان شت دووپاتە بۆ ⁦IPv6⁩).

R1 between G0/0/1 (students) on the left and G0/0/2 (servers) on the right; arrows go from left to right through R1. A badge ‘in on G0/0/1’: checked before routing, a denied packet is dropped early. A badge ‘out on G0/0/2’: checked after routing, just before it leaves. Below: interface g0/0/1 → ip access-group 110 in; at most one IPv4 ACL per interface per direction: one in, one out.R1 لە نێوان G0/0/1 (قوتابیان) لە چەپ و G0/0/2 (ڕاژەکارەکان) لە ڕاست؛ تیرەکان لە چەپەوە بۆ ڕاست بە R1دا دەڕۆن. نیشانەی ‘in لەسەر G0/0/1’: پێش ڕێدۆزی دەپشکنرێت، پاکێتێکی ڕێگرتوو زوو فڕێ دەدرێت. نیشانەی ‘out لەسەر G0/0/2’: دوای ڕێدۆزی دەپشکنرێت، ڕێک پێش ئەوەی دەربچێت. لە خوارەوە: interface g0/0/1 پاشان ip access-group 110 in؛ لە هەر نێوبەستەیەکدا بۆ هەر ئاڕاستەیەک زۆرترین یەک ACLـی IPv4: یەک in، یەک out.
In = arriving at the router; out = leaving it.in = گەیشتن بە ؛ out = دەرچوون لێی.CêIT

Where to put an ACLACL لە کوێ دابنرێت

The classic Cisco guideline: put extended ACLs as close to the source as possible — they can name the exact destination, so unwanted traffic is dropped before it uses any links. Put standard ACLs as close to the destination as possible — they see only the source, so near the source they would block that source from everything.

ڕێنمایی کلاسیکی ⁦Cisco: ACL⁩ـی درێژکراوە تا بتوانرێت نزیک سەرچاوە دابنێ — دەتوانێت مەبەستی ڕێک ناو ببات، بۆیە هاتوچۆی نەخوازراو پێش ئەوەی هیچ بەستەرێک بەکار بهێنێت فڕێ دەدرێت. ACLـی ستاندارد تا بتوانرێت نزیک مەبەست دابنێ — تەنیا سەرچاوە دەبینێت، بۆیە لە نزیک سەرچاوە ئەو سەرچاوەیە لە هەموو شتێک دادەبڕێت.

A chain: Students 192.168.20.0/24 — R1 — R2 — R3 — EXAM server 192.168.30.20. ACL 110 in sits on R1 next to the students; ACL 10 out sits on R3 next to the exam server. Orange card: extended near the source — it can name the destination, so it blocks only student to exam, and the packet dies at R1 without wasting the links to R2 and R3. Green card: standard near the destination — it sees only the source; at R1 it would cut the students off from everything; at R3, facing the exam server, it blocks only what it should.زنجیرەیەک: قوتابیان 192.168.20.0/24 — R1 — R2 — R3 — ڕاژەکاری تاقیکردنەوە 192.168.30.20. ACL 110 in لەسەر R1 لە نزیک قوتابیانە؛ ACL 10 out لەسەر R3 لە نزیک ڕاژەکاری تاقیکردنەوەیە. کارتی پرتەقاڵی: درێژکراوە نزیک سەرچاوە — دەتوانێت مەبەستەکە ناو ببات، بۆیە تەنیا قوتابی ← تاقیکردنەوە ڕادەگرێت و پاکێتەکە لە R1 دەمرێت بەبێ بەفیڕۆدانی بەستەرەکانی R2 و R3. کارتی سەوز: ستاندارد نزیک مەبەست — تەنیا سەرچاوە دەبینێت؛ لە R1ـدا قوتابیان لە هەموو شتێک دادەبڕێت؛ لە R3، بەرەو ڕاژەکاری تاقیکردنەوە، تەنیا ئەوە ڕادەگرێت کە پێویستە.
Extended near the source, standard near the destination.درێژکراوە نزیک سەرچاوە، ستاندارد نزیک مەبەست.CêIT

Lab 1: a standard ACLتاقیکردنەوەی 1: ACLـی ستاندارد

PC 192.168.20.25 has been misusing the servers, so it must be kept away from the server LAN, while every other device keeps working. A standard ACL can do it, placed near the destination: outbound on G0/0/2, the server interface. The remark line is a comment for the next administrator.

PCـی ⁦192.168.20.25⁩ بە خراپی بەکار دەهێنێت، بۆیە دەبێت لە دوور بخرێتەوە، لە کاتێکدا هەموو ئامێرەکانی تر بەردەوام کار دەکەن. ستاندارد دەتوانێت ئەوە بکات، لە نزیک مەبەست دابنرێت: out لەسەر ⁦G0/0/2⁩، . دێڕی remark تێبینییەکە بۆ بەڕێوەبەری داهاتوو.

ACL 10: written in global configuration, applied in interface mode⁦ACL 10⁩: لە باری ڕێکخستنی گشتیدا دەنووسرێت، لە باری نێوبەستەدا جێبەجێ دەکرێتTEXT
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#access-list 10 remark Keep PC 192.168.20.25 away from the server LAN
R1(config)#access-list 10 deny host 192.168.20.25
R1(config)#access-list 10 permit any
R1(config)#interface g0/0/2
R1(config-if)#ip access-group 10 out
R1(config-if)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 4

The specific line first.

دێڕە تایبەتەکە یەکەم.

Lineدێڕی 5

Without this line the invisible deny any would block everyone else too.

بەبێ ئەم دێڕە deny anyـی نەبینراو هەموو کەسێکی تریش ڕادەگرێت.

Lineدێڕی 7

Outbound on the server interface: close to the destination.

out لەسەر : نزیک مەبەست.

The school network with a badge ‘10 out’ on the link from R1 to the server LAN and a cross under it. Below: access-list 10 deny host 192.168.20.25; access-list 10 permit any; interface g0/0/2 → ip access-group 10 out. Right: 192.168.20.25 to the servers is dropped; everyone else to the servers is forwarded.ڕایەڵەی قوتابخانەکە لەگەڵ نیشانەی ‘10 out’ لەسەر بەستەری R1 بۆ ڕایەڵەی ناوچەیی ڕاژەکارەکان و خاچێک لە ژێریدا. لە خوارەوە: access-list 10 deny host 192.168.20.25؛ access-list 10 permit any؛ interface g0/0/2 پاشان ip access-group 10 out. ڕاست: 192.168.20.25 بۆ ڕاژەکارەکان فڕێ دەدرێت؛ هەموو کەسێکی تر بۆ ڕاژەکارەکان دەنێردرێت.
Lab 1: one host kept away from the servers.تاقیکردنەوەی 1: یەک لە دوور دەخرێتەوە.CêIT

Checking an ACL: counters and the interfaceپشکنینی ACL: ژمێرەرەکان و نێوبەستەکە

Ping a server from PC .25 and from PC .30, then look on R1. show access-lists prints every list with its sequence numbers and a match counter per line — the fastest proof that traffic really hits the line you expect. The invisible deny any has no counter. show ip interface g0/0/2 tells you which ACL is applied in which direction. clear access-list counters sets the counters back to zero before a new test.

لە PCـی .25 و PCـی .30ـەوە بۆ بکە، پاشان لەسەر ⁦R1⁩ سەیر بکە. show access-lists هەموو لیستێک لەگەڵ و ژمێرەرێکی گونجان بۆ هەر دێڕێک چاپ دەکات — خێراترین بەڵگە کە هاتوچۆ بەڕاستی بەو دێڕە دەگات کە چاوەڕێی دەکەیت. deny anyـی نەبینراو ژمێرەری نییە. show ip interface g0/0/2 پێت دەڵێت کام ACL بە کام ئاڕاستە جێبەجێ کراوە. clear access-list counters پێش تاقیکردنەوەیەکی نوێ ژمێرەرەکان دەگەڕێنێتەوە بۆ سفر.

The counters after a few pings (Packet Tracer shows the same lines with slightly different spacing and wording)ژمێرەرەکان دوای چەند پینگێک (Packet Tracer هەمان دێڕەکان بە ڕیزکردن و دەربڕینێکی کەمێک جیاواز پیشان دەدات)TEXT
R1#show access-lists
Standard IP access list 10
    10 deny   192.168.20.25 (8 matches)
    20 permit any (27 matches)
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 3

IOS writes a single host without the word host.

IOS تاک بەبێ وشەی host دەنووسێت.

The interface view (excerpt: the lines about ACLs)دیمەنی نێوبەستەکە (بەشێک: ئەو دێڕانەی لەبارەی ACLـن)TEXT
R1#show ip interface g0/0/2
GigabitEthernet0/0/2 is up, line protocol is up
  Internet address is 192.168.30.1/24
  Outgoing access list is 10
  Inbound  access list is not set

On PC .25 the ping fails: R1 drops each echo request and, by default, answers with an ICMP destination unreachable — administratively prohibited message, so the PC reports the destination as unreachable instead of waiting for a timeout. From PC .30 the ping succeeds.

لەسەر PCـی .25 شکست دەهێنێت: ⁦R1⁩ هەر echoـێک فڕێ دەدات و بە شێوەی بنەڕەت بە پەیامی ⁦destination unreachable — administratively prohibited⁩ وەڵام دەداتەوە، بۆیە PCـەکە ڕادەگەیەنێت کە مەبەستەکە ناگاتێ لە جیاتی چاوەڕوانیی تەواوبوونی کات. لە PCـی .30ـەوە سەرکەوتوو دەبێت.

Writing an extended ACL lineنووسینی دێڕێکی ACLـی درێژکراوە

An extended line reads like a sentence: number – action – protocol – source – destination – (port). The protocol is ip (any IP packet), tcp, udp or icmp. Each address takes a wildcard, or host / any. A port test follows the address it belongs to, with an operator: eq (equal), neq, lt, gt or range. IOS shows well-known ports by name, for example port 80 as www.

دێڕێکی درێژکراوە وەک ڕستەیەک دەخوێندرێتەوە: ژمارە – بڕیار – – سەرچاوە – مەبەست – (). ip (هەر IP)، tcp، udp یان icmpـە. هەر ناونیشانێک یان host / any وەردەگرێت. پشکنینی دوای ئەو ناونیشانە دێت کە پێیەوە پەیوەستە، لەگەڵ : eq (یەکسان)، neq، lt، gt یان range. IOS ناسراوەکان بە ناو پیشان دەدات، بۆ نموونە ⁦80⁩ وەک www.

The line access-list 110 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 80 split into: number 100–199; action; protocol; source + wildcard; destination; destination port. Notes: protocols ip (everything), tcp, udp, icmp; port operators eq, neq, lt, gt, range; ports go after the address they belong to, here the destination, port 80 (www). Read: allow TCP from any student to the web server’s port 80.دێڕی access-list 110 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 80 کراوە بە: ژمارە 100–199؛ بڕیار؛ پرۆتۆکۆڵ؛ سەرچاوە + ماسکی پێچەوانە؛ مەبەست؛ پۆرتی مەبەست. تێبینی: پرۆتۆکۆڵەکان ip (هەموو شتێک)، tcp، udp، icmp؛ کارپێکەرەکانی پۆرت eq، neq، lt، gt، range؛ پۆرتەکان لە دوای ئەو ناونیشانە دێن کە پێیەوە پەیوەستن، لێرەدا مەبەستەکە، پۆرتی 80 (www). بیخوێنەوە: ڕێگە بە TCP بدە لە هەر قوتابییەکەوە بۆ پۆرتی 80ـی ڕاژەکاری وێبەکە.
The parts of an extended line.بەشەکانی دێڕێکی درێژکراوە.CêIT

Lab 2: an extended ACL near the sourceتاقیکردنەوەی 2: ACLـێکی درێژکراوە نزیک سەرچاوە

Now the real policy: students may use the web server (HTTP 80 and HTTPS 443) and may ping the servers, but nothing else may go from the student LAN to the server LAN; everything else (for example to the staff LAN) stays allowed. An extended ACL, inbound on the student interface G0/0/1:

ئێستا سیاسەتە ڕاستەقینەکە: قوتابیان دەتوانن بەکار بهێنن (⁦HTTP 80⁩ و ⁦HTTPS 443⁩) و دەتوانن بۆ بکەن، بەڵام هیچ شتێکی تر نابێت لە قوتابیانەوە بڕوات بۆ ؛ هەموو شتێکی تر (بۆ نموونە بۆ کارمەندان) ڕێگەپێدراو دەمێنێتەوە. درێژکراوە، بە in لەسەر قوتابیان ⁦G0/0/1⁩:

ACL 110 on R1⁦ACL 110⁩ لەسەر ⁦R1⁩TEXT
R1(config)#access-list 110 remark Students: web and ping to the server LAN only
R1(config)#access-list 110 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 80
R1(config)#access-list 110 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 443
R1(config)#access-list 110 permit icmp 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255
R1(config)#access-list 110 deny ip 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255
R1(config)#access-list 110 permit ip any any
R1(config)#interface g0/0/1
R1(config-if)#ip access-group 110 in
R1(config-if)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2-4

The allowed traffic, most specific first.

هاتوچۆی ڕێگەپێدراو، تایبەتترین یەکەم.

Lineدێڕی 5

Everything else from students to the server LAN — including the exam server — is denied.

هەموو شتێکی تر لە قوتابیانەوە بۆ — لەگەڵ تاقیکردنەوە — ڕێگری لێ دەکرێت.

Lineدێڕی 6

Without this line the students could reach nothing else (implicit deny).

بەبێ ئەم دێڕە قوتابیان ناگەنە هیچ شتێکی تر (deny anyـی نەبینراو).

Lineدێڕی 8

Inbound on the students’ interface: close to the source.

in لەسەر قوتابیان: نزیک سەرچاوە.

The school network with a badge ‘110 in’ on the students’ link to R1. Results: tick, student to WEB, tcp 80 / 443; tick, student to any server, ping; cross, student to EXAM, anything else; tick, student to the staff LAN.ڕایەڵەی قوتابخانەکە لەگەڵ نیشانەی ‘110 in’ لەسەر بەستەری قوتابیان بۆ R1. ئەنجامەکان: ڕاست، قوتابی ← WEB، tcp 80 / 443؛ ڕاست، قوتابی ← هەر ڕاژەکارێک، پینگ؛ خاچ، قوتابی ← EXAM، هەر شتێکی تر؛ ڕاست، قوتابی ← ڕایەڵەی ناوچەیی کارمەندان.
Lab 2: the school’s policy in five lines.تاقیکردنەوەی 2: سیاسەتی قوتابخانەکە لە پێنج دێڕدا.CêIT
After a test: port 80 is shown as www; remarks are not listedدوای تاقیکردنەوەیەک: پۆرتی ⁦80⁩ وەک www پیشان دەدرێت؛ remarkـەکان ڕیز ناکرێنTEXT
R1#show access-lists 110
Extended IP access list 110
    10 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq www (25 matches)
    20 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 443 (12 matches)
    30 permit icmp 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255 (8 matches)
    40 deny ip 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255 (3 matches)
    50 permit ip any any (40 matches)

Named ACLsACLـی ناودار

Numbers are hard to remember. A named ACL does the same job with a name you choose, and it has its own sub-mode where each line is typed without repeating access-list 110: the prompt changes to (config-std-nacl)# for standard and (config-ext-nacl)# for extended lists. Here is Lab 2 as a named list:

ژمارەکان بە ئاسانی لە بیر نامێنن. ناودار هەمان کار بە ناوێک دەکات کە خۆت هەڵیدەبژێریت و باری لاوەکیی خۆی هەیە کە هەر دێڕێک تێیدا بەبێ دووپاتەکردنەوەی access-list 110 دەنووسرێت: بۆ لیستی ستاندارد دەبێت بە (config-std-nacl)# و بۆ درێژکراوە بە (config-ext-nacl)#. ئەمە تاقیکردنەوەی 2یە وەک لیستێکی ناودار:

The same policy as a named extended ACLهەمان سیاسەت وەک ACLـێکی درێژکراوەی ناودارTEXT
R1(config)#ip access-list extended STUDENTS-IN
R1(config-ext-nacl)#remark Students: web and ping to the server LAN only
R1(config-ext-nacl)#permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 80
R1(config-ext-nacl)#permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 443
R1(config-ext-nacl)#permit icmp 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255
R1(config-ext-nacl)#deny ip 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255
R1(config-ext-nacl)#permit ip any any
R1(config-ext-nacl)#exit
R1(config)#interface g0/0/1
R1(config-if)#no ip access-group 110 in
R1(config-if)#ip access-group STUDENTS-IN in
R1(config-if)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 1

standard or extended, then the name (capitals make it easy to spot in the configuration).

standard یان extended، پاشان ناوەکە (پیتی گەورە دۆزینەوەی لە ئاسان دەکات).

Lineدێڕی 10-11

Swap the old numbered list for the named one: still one IPv4 ACL per direction.

لیستە ژمارەکراوە کۆنەکە بە ناودارەکە بگۆڕەوە: هێشتا یەک ACLـی ⁦IPv4⁩ بۆ هەر ئاڕاستەیەک.

The capstone project protects its servers with a named extended ACL: Step 8: an ACL in front of the servers.

پڕۆژەی کۆتایی بە ناودار دەپارێزێت: هەنگاوی ⁦8: ACL⁩ـێک لە بەردەم ڕاژەکارەکان.

Editing an ACL with sequence numbersدەستکاریکردنی ACL بە ژمارەکانی زنجیرە

Lines get sequence numbers 10, 20, 30… and a new line without a number goes to the end. To put a line in the middle, give it a number in between; to remove one line, type no and its number. This works for named lists and also for numbered ones opened with ip access-list extended 110. (Later the exam app on EXAM, TCP 8443, must be opened during exams, and pings are no longer needed.)

دێڕەکان ⁦10⁩، ⁦20⁩، ⁦30⁩… وەردەگرن و دێڕێکی نوێ بەبێ ژمارە دەچێتە کۆتایی. بۆ دانانی دێڕێک لە ناوەڕاستدا، ژمارەیەکی نێوانی پێ بدە؛ بۆ لابردنی یەک دێڕ، no و ژمارەکەی بنووسە. ئەمە بۆ لیستە ناودارەکان کار دەکات و بۆ ژمارەکراوەکانیش کاتێک بە ip access-list extended 110 دەکرێنەوە. (دواتر ئەپی تاقیکردنەوە لەسەر EXAM، ⁦TCP 8443⁩، دەبێت لە کاتی تاقیکردنەوەکاندا بکرێتەوە و ئیتر پێویست بە نییە.)

Insert line 35, delete line 30دێڕی ⁦35⁩ زیاد بکە، دێڕی ⁦30⁩ بسڕەوەTEXT
R1(config)#ip access-list extended STUDENTS-IN
R1(config-ext-nacl)#35 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.20 eq 8443
R1(config-ext-nacl)#no 30
R1(config-ext-nacl)#end
R1#show access-lists STUDENTS-IN
Extended IP access list STUDENTS-IN
    10 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq www
    20 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 443
    35 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.20 eq 8443
    40 deny ip 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255
    50 permit ip any any
Two copies of the list. Before: 10 permit tcp … eq www, 20 permit tcp … eq 443, 30 permit icmp …, 40 deny ip …, 50 permit ip any any. After ‘35 …’ and ‘no 30’: line 30 is struck through and a new line 35 permit tcp … host 192.168.30.20 eq 8443 is highlighted between 30 and 40.دوو وێنەی لیستەکە. پێش: 10 permit tcp … eq www، 20 permit tcp … eq 443، 30 permit icmp …، 40 deny ip …، 50 permit ip any any. دوای ‘35 …’ و ‘no 30’: دێڕی 30 هێڵی بەسەردا هاتووە و دێڕێکی نوێی 35 permit tcp … host 192.168.30.20 eq 8443 لە نێوان 30 و 40دا ڕەنگکراوە.
Numbers leave room between lines.ژمارەکان لە نێوان دێڕەکاندا شوێن بەجێ دەهێڵن.CêIT

Protecting the VTY lines with access-classپاراستنی هێڵەکانی VTY بە ⁦access-class⁩

You already lock the VTY lines with SSH, a user name and a secret (Lock the VTY lines). An ACL adds a second lock: who may even try. On a line, the command is access-class, not ip access-group. Apply it to all VTY lines — a remote session can land on any of them.

پێشتر بە SSH، و نهێنییەک دادەخەیت (داخستنی هێڵەکانی VTY). قوفڵێکی دووەم زیاد دەکات: کێ تەنانەت دەتوانێت هەوڵ بدات. لەسەر هێڵێک access-classـە، نەک ip access-group. لەسەر هەموو جێبەجێی بکە — دانیشتنێکی دوور دەتوانێت لەسەر هەر کامیان بنیشێتەوە.

Only 192.168.10.5 may open an SSH session to R1 (a switch has line vty 0 15)تەنیا ⁦192.168.10.5⁩ دەتوانێت دانیشتنێکی SSH بۆ ⁦R1⁩ بکاتەوە (سویچ ⁦line vty 0 15⁩ـی هەیە)TEXT
R1(config)#access-list 5 remark Only the admin PC may log in remotely
R1(config)#access-list 5 permit host 192.168.10.5
R1(config)#line vty 0 4
R1(config-line)#access-class 5 in
R1(config-line)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
Explain the codeڕوونکردنەوەی کۆدەکە
Lineدێڕی 2

A standard ACL: only the source address matters here. The implicit deny refuses everyone else.

ستاندارد: لێرەدا تەنیا ناونیشانی سەرچاوە گرنگە. deny anyـی نەبینراو هەموو کەسێکی تر ڕەت دەکاتەوە.

Lineدێڕی 4

in = sessions coming into the router.

in = ئەو دانیشتنانەی دێنە ناو .

The admin PC 192.168.10.5 opens SSH to R1 and passes a guard box ‘line vty 0 4, access-class 5 in’; a student PC 192.168.20.25 tries SSH and is stopped with a cross. A card: access-list 5 permit host 192.168.10.5; everyone else: implicit deny. Note: access-class checks who may log in to the router; it does not filter traffic passing through. Use it together with SSH-only VTY lines.PCـی بەڕێوەبەر 192.168.10.5 SSH بۆ R1 دەکاتەوە و بە چوارگۆشەی پاسەوانی ‘line vty 0 4، access-class 5 in’دا تێدەپەڕێت؛ PCـێکی قوتابی 192.168.20.25 هەوڵی SSH دەدات و بە خاچێک ڕادەگیرێت. کارتێک: access-list 5 permit host 192.168.10.5؛ هەموو کەسێکی تر: deny any. تێبینی: access-class دەپشکنێت کێ دەتوانێت بچێتە ناو ڕێدۆزەکەوە؛ ئەو هاتوچۆیە فلتەر ناکات کە بە ڕێدۆزەکەدا تێدەپەڕێت. لەگەڵ هێڵەکانی VTY کە تەنیا SSH وەردەگرن بەکاری بهێنە.
access-class guards the router’s own door.⁦access-class⁩ دەرگای خودی دەپارێزێت.CêIT

ACLs that select instead of filterACLـی کە هەڵدەبژێرێت لە جیاتی فلتەرکردن

The same list syntax is used in many places where nothing is dropped. With NAT, ip nat inside source list 1 … uses ACL 1 only to decide who is translated: a permitted source is translated, a denied (or unmatched) source is simply forwarded untranslated (Dynamic NAT). Other IOS features — route filtering, QoS, debug filters — reuse ACLs the same way. Always ask: is this list applied to an interface, or referenced by a feature?

هەمان ڕێزمانی لیست لە زۆر شوێندا بەکار دێت کە هیچ شتێک فڕێ نادرێت. لەگەڵ NAT، ip nat inside source list 1 … ⁦ACL 1⁩ تەنیا بۆ بڕیاردان بەکار دەهێنێت کە کێ وەردەگێڕدرێت: سەرچاوەیەکی ڕێگەپێدراو وەردەگێڕدرێت، سەرچاوەیەکی ڕێگرتوو (یان نەگونجاو) تەنیا بەبێ وەرگێڕان دەنێردرێت (وەرگێڕانی بزۆکی ناونیشانی ڕایەڵە). تایبەتمەندییەکانی تری IOS — فلتەرکردنی ڕێگەکان، QoS، فلتەری debug — بە هەمان شێوە ACL بەکار دەهێننەوە. هەمیشە بپرسە: ئەم لیستە لەسەر جێبەجێ کراوە، یان تایبەتمەندییەک ئاماژەی پێ دەکات؟

Two cards. Filter, on an interface (ip access-group 10 out): permit → the packet is forwarded; deny → the packet is dropped; no match → implicit deny → dropped. Select, for NAT (ip nat inside source list 1 …): permit → the source is translated; deny → it is not translated, but still routed, not dropped; no match → not translated.دوو کارت. فلتەر، لەسەر نێوبەستەیەک (ip access-group 10 out): permit ← پاکێتەکە دەنێردرێت؛ deny ← پاکێتەکە فڕێ دەدرێت؛ گونجان نییە ← deny any ← فڕێ دەدرێت. هەڵبژاردن، بۆ NAT (ip nat inside source list 1 …): permit ← سەرچاوەکە وەردەگێڕدرێت؛ deny ← وەرناگێڕدرێت، بەڵام هێشتا دەنێردرێت، فڕێ نادرێت؛ گونجان نییە ← وەرناگێڕدرێت.
Same list, different meaning of deny.هەمان لیست، واتای جیاوازی deny.CêIT

ACLs and stateful firewallsACL و ئاگرەدیوارەکانی دۆخدار

A classic ACL is a stateless packet filter: it judges each packet alone and remembers nothing. That matters for replies. If an inbound ACL on the Internet-facing interface allows only what the company wants in, the replies to the staff’s own web requests are blocked too — unless a line lets them in, such as permit tcp any 192.168.10.0 0.0.0.255 established, which matches TCP segments with the ACK or RST flag set (packets that belong to a connection already under way). It is a rough tool: it works only for TCP, and a forged flag passes.

کلاسیکی بە شێوەیەکی دەکات: هەر بە تەنیا هەڵدەسەنگێنێت و هیچ شتێک لە بیر ناگرێت. ئەمە بۆ وەڵامەکان گرنگە. ئەگەر ACLـێکی in لەسەر ڕووەو تەنیا ڕێگە بەوە بدات کە کۆمپانیاکە دەیەوێت بێتە ژوورەوە، وەڵامی ئەو کارمەندان خۆیان بۆ دەینێرن ڕادەگیرێن — مەگەر دێڕێک ڕێگەیان پێ بدات، وەک permit tcp any 192.168.10.0 0.0.0.255 established، کە ئەو TCP دەگرێتەوە کە ئاڵای ACK یان RSTـیان لەسەرە (ئەو سەر بە پەیوەندییەکن کە پێشتر دەستی پێکردووە). ئامرازێکی زبرە: تەنیا بۆ TCP کار دەکات و ئاڵایەکی ساختە تێدەپەڕێت.

Two strips: PC — router — server, with a request going right and a reply coming back. Orange, ACL (stateless packet filter): the reply is a new packet; a line such as permit tcp any … established must let it in. Green, stateful firewall: it keeps a state table and lets in only replies to conversations started inside.دوو پارچە: PC — ڕێدۆز — ڕاژەکار، داواکارییەک بەرەو ڕاست دەڕوات و وەڵامێک دەگەڕێتەوە. پرتەقاڵی، ACL (فلتەرکردنی پاکێتی بێ‌دۆخ): وەڵامەکە پاکێتێکی نوێیە؛ دێڕێکی وەک permit tcp any … established دەبێت ڕێگەی پێ بدات. سەوز، ئاگرەدیواری دۆخدار: خشتەیەکی دۆخ ڕادەگرێت و تەنیا ڕێگە بەو وەڵامانە دەدات کە گفتوگۆکەیان لە ناوەوە دەستی پێکردووە.
Stateless versus stateful. بەرانبەر دۆخدار.CêIT

A stateful firewall keeps a table of the conversations started inside and lets in exactly their replies — for TCP, UDP and ICMP alike — and modern next-generation firewalls look much deeper (Kinds of firewall). ACLs remain the everyday tool on routers and switches: for simple filters between internal networks, for protecting the device itself, and for selecting traffic for other features.

دۆخدار خشتەیەک لە گفتوگۆکانی ناوەوە ڕادەگرێت و ڕێک ڕێگە بە وەڵامەکانیان دەدات — بۆ TCP، UDP و ICMP وەک یەک — و زۆر قووڵتر سەیر دەکەن (جۆرەکانی ئاگرەدیوار). ئامرازی ڕۆژانەی و دەمێننەوە: بۆ فلتەری سادە لە نێوان ناوخۆدا، بۆ پاراستنی خودی ئامێرەکە و بۆ هەڵبژاردنی هاتوچۆ بۆ تایبەتمەندییەکانی تر.

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

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

ExerciseڕاهێنانKeep the students out of the staff LANقوتابیان لە ڕایەڵەی ناوچەیی کارمەندان دوور بخەرەوە

Write a standard ACL that stops the whole student LAN from reaching the staff LAN but lets everything else through. Say where you apply it and why.

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

Show answerوەڵامەکە پیشان بدە
Outbound on the staff interface, close to the destinationout لەسەر نێوبەستەی کارمەندان، نزیک مەبەستTEXT
R1(config)#access-list 20 deny 192.168.20.0 0.0.0.255
R1(config)#access-list 20 permit any
R1(config)#interface g0/0/0
R1(config-if)#ip access-group 20 out
R1(config-if)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]

A standard ACL sees only the source, so it belongs near the destination: there it affects only traffic going to the staff LAN. Inbound on G0/0/1 it would cut the students off from the servers too.

تەنیا سەرچاوە دەبینێت، بۆیە شوێنی نزیک مەبەستە: لەوێ تەنیا کار لە هاتوچۆ بۆ کارمەندان دەکات. بە in لەسەر ⁦G0/0/1⁩ قوتابیان لە دادەبڕێت.

ExerciseڕاهێنانOnly the admin reaches EXAMتەنیا بەڕێوەبەر دەگاتە EXAM

Only the admin PC (192.168.10.5) may reach the exam server (192.168.30.20), by any protocol; nobody else may reach it; all other traffic is allowed. Write one extended ACL for R1 and choose the interface.

تەنیا PCـی بەڕێوەبەر ⁦(192.168.10.5)⁩ دەتوانێت بگاتە تاقیکردنەوە ⁦(192.168.30.20)⁩، بە هەر ؛ کەسی تر ناتوانێت بیگاتێ؛ هەموو هاتوچۆیەکی تر ڕێگەپێدراوە. یەک بۆ ⁦R1⁩ بنووسە و هەڵبژێرە.

Show answerوەڵامەکە پیشان بدە
One list, outbound towards the serversیەک لیست، out بەرەو ڕاژەکارەکانTEXT
R1(config)#access-list 120 permit ip host 192.168.10.5 host 192.168.30.20
R1(config)#access-list 120 deny ip any host 192.168.30.20
R1(config)#access-list 120 permit ip any any
R1(config)#interface g0/0/2
R1(config-if)#ip access-group 120 out
R1(config-if)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]

The traffic comes from two LANs, so “near the source” would need two lists. With one router, a single extended list outbound on G0/0/2 is simpler and still exact, because it names the destination.

هاتوچۆکە لە دوو دێت، بۆیە «نزیک سەرچاوە» پێویستی بە دوو لیست دەبێت. بە یەک ، یەک لیستی درێژکراوە بە out لەسەر ⁦G0/0/2⁩ سادەترە و هێشتا ورددە، چونکە مەبەستەکە ناو دەبات.

ExerciseڕاهێنانRead the countersژمێرەرەکان بخوێنەوە

Students say the web server does not load. show access-lists STUDENTS-IN shows 10 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq www (0 matches) and 40 deny ip 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255 (52 matches), and the list has no line 20. What is happening, and how do you fix it without retyping the list?

قوتابیان دەڵێن بار نابێت. show access-lists STUDENTS-IN 10 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq www (0 matches) و 40 deny ip 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255 (52 matches) پیشان دەدات و لیستەکە دێڕی ⁦20⁩ـی نییە. چی ڕوو دەدات و چۆن بەبێ دووپاتە نووسینەوەی لیستەکە چاکی دەکەیتەوە؟

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

The site uses HTTPS (TCP 443), not port 80: line 10 never matches and line 40 drops the requests. Insert the missing line with a sequence number:

ماڵپەڕەکە بەکار دەهێنێت ⁦(TCP 443)⁩، نەک ⁦80⁩: دێڕی ⁦10⁩ هەرگیز ناگونجێت و دێڕی ⁦40⁩ فڕێ دەدات. دێڕە ونەکە بە زیاد بکە:

Line 20 slides in before the denyدێڕی ⁦20⁩ پێش denyـەکە دادەنرێتTEXT
R1(config)#ip access-list extended STUDENTS-IN
R1(config-ext-nacl)#20 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 443
R1(config-ext-nacl)#end
R1#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
ExerciseڕاهێنانWildcardsماسکە پێچەوانەکان

Write the address and wildcard that match (a) 172.16.32.0/20, (b) only the host 10.1.1.9, (c) 192.168.20.128/25.

ناونیشان و بنووسە کە ئەمانە بگرنەوە: ⁦(a) 172.16.32.0/20⁩، ⁦(b)⁩ تەنیا ⁦10.1.1.9⁩، ⁦(c) 192.168.20.128/25⁩.

Show answerوەڵامەکە پیشان بدە
  • (a) /20 = 255.255.240.0 → 172.16.32.0 0.0.15.255 (172.16.32.0 – 172.16.47.255).
  • (b) host 10.1.1.9 = 10.1.1.9 0.0.0.0.
  • (c) /25 = 255.255.255.128 → 192.168.20.128 0.0.0.127.
  • ⁦(a)⁩ /20 = 255.255.240.0، بۆیە 172.16.32.0 0.0.15.255 ⁦(172.16.32.0 – 172.16.47.255)⁩.
  • ⁦(b)⁩ host 10.1.1.9 هەمان 10.1.1.9 0.0.0.0ـە.
  • ⁦(c)⁩ /25 = 255.255.255.128، بۆیە 192.168.20.128 0.0.0.127.
ExerciseڕاهێنانFind the order mistakeهەڵەی ڕیزبەندی بدۆزەرەوە

A colleague wrote access-list 15 permit 192.168.20.0 0.0.0.255, then access-list 15 deny host 192.168.20.25, then access-list 15 permit any. What happens when the second line is typed, what does PC .25 experience, and what is the corrected order?

هاوکارێک نووسیویەتی access-list 15 permit 192.168.20.0 0.0.0.255، پاشان access-list 15 deny host 192.168.20.25، پاشان access-list 15 permit any. کاتێک دێڕی دووەم دەنووسرێت چی ڕوو دەدات، PCـی .25 چی دەبینێت و ڕیزبەندیی ڕاستکراوە چییە؟

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

On a real router IOS refuses the second line at once: % Access rule can't be configured at higher sequence num as it is part of the existing rule at sequence num 10. ACL 15 keeps only the two permit lines, so PC .25 is permitted. Put the host line first: deny host 192.168.20.25, then permit any (the /24 line is then not needed). With a numbered list in global mode, remove it with no access-list 15 and type it again, or edit it with ip access-list standard 15 and sequence numbers.

لەسەر ڕاستەقینە IOS دەستبەجێ دێڕی دووەم ڕەت دەکاتەوە: % Access rule can't be configured at higher sequence num as it is part of the existing rule at sequence num 10. ⁦ACL 15⁩ تەنیا دوو دێڕە permitـەکە دەهێڵێتەوە، بۆیە ڕێگە بە PCـی .25 دەدرێت. دێڕی یەکەم دابنێ: deny host 192.168.20.25، پاشان permit any (ئیتر دێڕی /24 پێویست نییە). لە لیستێکی ژمارەکراو لە ، بە no access-list 15 لای ببە و دووپاتە بینووسەوە، یان بە ip access-list standard 15 و دەستکاری بکە.

Summaryپوختە

  • An ACL is an ordered list of permit/deny lines, checked top down; the first match decides; an invisible deny any ends every list, so a list needs at least one permit.
  • Standard (1–99, 1300–1999): source only, near the destination. Extended (100–199, 2000–2699): protocol, addresses and ports, near the source. Names work for both.
  • Addresses use wildcard masks: 0 = match, 1 = ignore; host and any are shortcuts.
  • Apply with ip access-group … in|out: one IPv4 ACL per interface per direction; VTY lines use access-class … in.
  • Verify with show access-lists (match counters) and show ip interface; edit with sequence numbers, never with no access-list N ….
  • ACLs also select traffic (NAT); they are stateless — stateful firewalls track conversations.
  • لیستێکی ڕیزکراوی دێڕەکانی ⁦permit/deny⁩ـە، لە سەرەوە بۆ خوارەوە دەپشکنرێت؛ یەکەم گونجان بڕیار دەدات؛ deny anyـیەکی نەبینراو کۆتایی بە هەموو لیستێک دەهێنێت، بۆیە لیست پێویستی بە لانیکەم یەک permit هەیە.
  • ستاندارد (⁦1–99⁩، ⁦1300–1999⁩): تەنیا سەرچاوە، نزیک مەبەست. درێژکراوە (⁦100–199⁩، ⁦2000–2699⁩): ، ناونیشانەکان و ، نزیک سەرچاوە. ناو بۆ هەردووکیان کار دەکات.
  • ناونیشانەکان بەکار دەهێنن: 0 = گونجان، 1 = گرنگ نییە؛ host و any کورتکراوەن.
  • بە ip access-group … in|out جێبەجێی بکە: یەک ACLـی ⁦IPv4⁩ بۆ هەر و هەر ئاڕاستەیەک؛ access-class … in بەکار دەهێنن.
  • بە show access-lists (ژمێرەری گونجان) و show ip interface بپشکنە؛ بە دەستکاری بکە، هەرگیز بە no access-list N ….
  • هاتوچۆش هەڵدەبژێرن ⁦(NAT)⁩؛ — دۆخدار بەدواداچوون بۆ گفتوگۆکان دەکەن.

When an ACL blocks more than you meant, troubleshooting starts with show access-lists and a ping — that is the next lesson, Troubleshooting with IOS.

کاتێک زیاتر لەوەی مەبەستت بوو ڕادەگرێت، بە show access-lists و دەست پێ دەکات — ئەوە وانەی داهاتووە، چارەسەرکردنی کێشە بە IOS.

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

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

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

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

Troubleshooting with IOS: show, ping, traceroute and debugچارەسەرکردنی کێشە بە ⁦IOS: show⁩، پینگ، بەدواداچوونی ڕێگە و debug

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.تەنیا لەسەر ئەم ئامێرە پاشەکەوت دەکرێت.