Chapterبەش 5 · Lectureوانە 5.2
NAT and PAT: Sharing Public Addressesوەرگێڕانی ناونیشانی ڕایەڵە و وەرگێڕانی ناونیشانی پۆرت: هاوبەشکردنی ناونیشانی گشتی
Why NAT exists (IPv4 shortage, private addresses), what it does to a packet, the four Cisco address names, static NAT for servers, the word pool and dynamic NAT, port numbers and PAT with its translation table, the three kinds compared, port forwarding, carrier-grade NAT and NAT64, what NAT breaks, why NAT is not a firewall, and IPv6 without NAT.
بۆچی هەیە (کەمیی ، )، چی بە دەکات، چوار ناوەکەی ناونیشانی Cisco، بۆ ، وشەی pool و ، ژمارەی و بە خشتەی وەرگێڕانەکەی، بەراوردی سێ جۆرەکە، ، و NAT64، ئەوەی تێکی دەدات، بۆچی نییە و بەبێ .
What you will learnچی فێر دەبیت
- Explain why NAT exists and what it changes in outgoing packets and their replies.
- Use the four names inside local, inside global, outside local and outside global correctly.
- Compare static NAT, dynamic NAT and PAT and choose the right one for servers and for many users.
- Read a PAT translation table and explain port forwarding and carrier-grade NAT.
- Explain what NAT breaks, why it is not a firewall, and why IPv6 does not need it.
- ڕوون بکەیتەوە بۆچی هەیە و چی لە دەرچوو و وەڵامەکانیاندا دەگۆڕێت.
- چوار ناوەکە — ، ، و — بە دروستی بەکار بهێنیت.
- ، و بەراورد بکەیت و دروستەکەیان بۆ و بۆ بەکارهێنەری زۆر هەڵبژێریت.
- خشتەی وەرگێڕانی بخوێنیتەوە و و ڕوون بکەیتەوە.
- ڕوون بکەیتەوە چی تێک دەدات، بۆچی نییە و بۆچی پێویستی پێی نییە.
Why NAT existsبۆچی وەرگێڕانی ناونیشانی ڕایەڵە هەیە
IPv4 has addresses — about 4.3 billion. When IPv4 was designed nobody imagined billions of phones, and today the free addresses are gone (IPv4 ran out). A home has a phone, a laptop and a TV, yet the ISP gives it one public address. Asking for a public address for every device would be expensive and wasteful — and there are simply not enough.
ناونیشانی هەیە — نزیکەی 4.3 ملیار. کاتێک دیزاین کرا، کەس بیری لە ملیارەها مۆبایل نەدەکردەوە و ئەمڕۆ ناونیشانە ئازادەکان تەواو بوون (IPv4 تەواو بوو). ماڵێک مۆبایل، و تیڤی هەیە، کەچی یەک پێ دەدات. داواکردنی بۆ هەموو ئامێرێک گران و بەفیڕۆدان دەبێت — و بە سادەیی بەس نییە.
So inside the home the router gives every device a private address (10.x, 172.16–31.x or 192.168.x — RFC 1918), which millions of homes reuse at the same time. Private addresses are never routed on the Internet. To go out, each packet needs the router’s public address instead: that swap is network address translation (NAT). The idea is introduced in IP and MAC addresses.
بۆیە لە ناو ماڵەوە ناونیشانێکی IPـی تایبەت دەداتە هەموو ئامێرێک (10.x، 172.16–31.x یان 192.168.x — 1918) کە ملیۆنان ماڵ لە هەمان کاتدا بەکاری دەهێننەوە. هەرگیز لەسەر ڕێگەیان پێ نادرێت. بۆ چوونە دەرەوە، هەر لە جیاتی ئەوە پێویستی بە ناونیشانە گشتییەکەی هەیە: ئەو گۆڕینەوەیە ـە. بیرۆکەکە لە ناونیشانی IP و MAC ناسێنراوە.
What NAT does to a packetوەرگێڕانی ناونیشانی ڕایەڵە چی بە پاکێتێک دەکات
NAT is a service in the router. When a packet goes out, the router replaces the private source address with its public one and writes the pair in a translation table. When the reply comes back, it looks the pair up and replaces the public destination address with the private one. The two hosts never notice.
خزمەتگوزارییەکی ناو . کاتێک دەچێتە دەرەوە، ناونیشانی سەرچاوەی تایبەت بە ناونیشانە گشتییەکەی خۆی دەگۆڕێت و جووتەکە لە خشتەی وەرگێڕاندا دەنووسێت. کاتێک وەڵامەکە دەگەڕێتەوە، جووتەکە دەدۆزێتەوە و ناونیشانی مەبەستی گشتی بە تایبەتەکە دەگۆڕێت. دوو هەرگیز هەست پێ ناکەن.


A job done by the . On the way out it swaps the of home or office devices for its one , and it swaps them back for the replies. So many devices share one public address.
کارێکە کە دەیکات: ئامێرەکانی ماڵ یان نووسینگە لە کاتی دەرچووندا بە تاکە خۆی دەگۆڕێت و بۆ وەڵامەکان دەیانگەڕێنێتەوە، بۆیە چەندین ئامێر یەک ناونیشانی گشتی بەکار دەهێنن.
Why IPv4 needed NAT, how the router swaps addresses in its translation table, and how overload (PAT) and dynamic NAT differ.
بۆچی پێویستی بە بوو، چۆن ناونیشانەکان لە خشتەی وەرگێڕاندا دەگۆڕێتەوە؛ هەروەها و چ جیاوازییەکیان هەیە.
Watch 0:25–3:26: the problem (too few IPv4 addresses) and how NAT swaps the addresses in its table.
لە 0:25 تا 3:26 سەیر بکە: کێشەکە (کەمیی ناونیشانەکانی ) و چۆن ناونیشانەکان لە خشتەکەیدا دەگۆڕێتەوە.
Inside, outside, local, globalناوەوە، دەرەوە، ناوخۆیی، گشتی
Cisco uses four names. Inside and outside are the two sides of the router (ip nat inside and ip nat outside on its interfaces). Local means “as seen from the inside network”, global “as seen from the outside”. So the PC’s private address is its inside local address, and the public address that stands for it is its inside global address.
Cisco چوار ناو بەکار دەهێنێت. ناوەوە و دەرەوە دوو لای (ip nat inside و ip nat outside لەسەر ). ناوخۆیی واتە «وەک لە ناوەوە دەبینرێت»، گشتی «وەک لە دەرەوە دەبینرێت». کەواتە ناونیشانە تایبەتەکەی PC ـە و ئەو ناونیشانە گشتییەی جێگەی دەگرێتەوە ـە.
The server has two names too: its outside global address is its real address; its outside local address is how it looks from inside. In ordinary NAT the router does not change it, so both are the same — here 198.51.100.20.
دوو ناوی هەیە: ناونیشانە ڕاستەقینەکەیەتی؛ ئەوەیە کە لە ناوەوە چۆن دەبینرێت. لە ئاساییدا نایگۆڕێت، بۆیە هەردووکیان وەک یەکن — لێرەدا 198.51.100.20.
Three kinds of NATسێ جۆری وەرگێڕانی ناونیشانی ڕایەڵە
There are three kinds. Static NAT maps one private address to one public address, permanently. Dynamic NAT lends public addresses from a pool, one per active host. PAT (port address translation, also called NAT overload) lets many hosts share one public address by also changing port numbers. PAT is the best fit for most networks, so it is by far the most common.
سێ جۆر هەیە. یەک بە یەک دەبەستێتەوە، بە هەمیشەیی. لە قەرز دەدات، یەکێک بۆ هەر چالاک. (PAT، پێی دەگوترێت NAT overloadیش) ڕێگە دەدات زۆر یەک بەهاوبەشی بەکار بهێنن بە گۆڕینی ژمارەی . بۆ زۆربەی باشترین گونجاوە، بۆیە زۆر لە هەمووان باوترە.
Why IPv4 needed NAT, how the router swaps addresses in its translation table, and how overload (PAT) and dynamic NAT differ.
بۆچی پێویستی بە بوو، چۆن ناونیشانەکان لە خشتەی وەرگێڕاندا دەگۆڕێتەوە؛ هەروەها و چ جیاوازییەکیان هەیە.
Watch 3:26–7:03: overload (PAT) and dynamic NAT with an address pool; stops before the static example, which uses port numbers like port forwarding.
لە 3:26 تا 7:03 سەیر بکە: و بە ؛ پێش نموونەی جێگیر ڕادەوەستێت، چونکە ئەو نموونەیە وەک ژمارەی بەکار دەهێنێت.
Static NAT: a fixed pair for a serverوەرگێڕانی جێگیری ناونیشانی ڕایەڵە: جووتێکی جێگیر بۆ ڕاژەکارێک
Static NAT needs one public address for every private address it maps, so it cannot share addresses. That is exactly why it is still used: a fixed pair lets people outside start connections to a server inside — a web server, a mail server, a camera. 192.168.1.10 is always 203.0.113.10, day and night.
بۆ هەر کە دەیبەستێتەوە پێویستی بە یەک هەیە، بۆیە ناتوانێت ناونیشان هاوبەش بکات. هەر ئەمەشە هۆی ئەوەی هێشتا بەکار دێت: جووتێکی جێگیر ڕێگە دەدات خەڵکی دەرەوە پەیوەندی بۆ لە ناوەوە دەست پێ بکەن — ، ، کامێرایەک. 192.168.1.10 هەمیشە 203.0.113.10ـە، شەو و ڕۆژ.
The word poolوشەی pool
Dynamic NAT uses a pool. In everyday English a pool is a swimming pool; in networking it means a shared set of resources — here, a limited set of public addresses that several devices use in turn. (DHCP pools are the same idea: a set of addresses to lend.)
بەکار دەهێنێت. لە ئینگلیزیی ڕۆژانەدا pool واتە حەوزی مەلەکردن؛ لە بواری واتە کۆمەڵێک سەرچاوەی هاوبەش — لێرەدا کۆمەڵێکی سنووردار لە کە چەند ئامێرێک بە نۆبە بەکاری دەهێنن. ( هەمان بیرۆکەن: کۆمەڵێک ناونیشان بۆ قەرزدان.)
Everyone shares a swimming pool: strong swimmers, weak swimmers and people who cannot swim at all. Nobody owns a lane; you use one while you swim and leave it for the next person. The public addresses of a NAT pool are the lanes, and the inside hosts are the swimmers.
هەمووان حەوزی مەلەکردن بەهاوبەشی بەکار دەهێنن: مەلەوانی باش، مەلەوانی لاواز و کەسێک کە هەر مەلە نازانێت. کەس خاوەنی ڕێڕەوێک نییە؛ تا مەلە دەکەیت بەکاری دەهێنیت و بۆ کەسی دواتری بەجێ دەهێڵیت. ڕێڕەوەکانن و ناوەوە مەلەوانەکان.
Where the analogy stops workingسنووری ئەم نموونەیە
In a real pool many people can share one lane; in dynamic NAT one public address serves only one inside host at a time. Sharing one address among many is what PAT adds.
لە حەوزی ڕاستەقینەدا زۆر کەس دەتوانن یەک ڕێڕەو هاوبەش بکەن؛ لە یەک لە یەک کاتدا تەنیا خزمەتی یەک ناوەوە دەکات. هاوبەشکردنی یەک ناونیشان لە نێوان زۆر کەسدا ئەوەیە کە زیادی دەکات.
Dynamic NAT: first come, first servedوەرگێڕانی بزۆکی ناونیشانی ڕایەڵە: کێ پێشتر بێت
Dynamic NAT lends a whole public address from the pool to the first inside host that needs one, and keeps it in the table until the translation ends. Take five computers and a pool of three public addresses: only three computers can be online at once; the fourth and fifth must wait until an address is free.
تەواو لە بە قەرز دەداتە یەکەم ناوەوە کە پێویستی پێیەتی و تا وەرگێڕانەکە کۆتایی دێت لە خشتەکەدا دەیهێڵێتەوە. پێنج و بە سێ وەربگرە: تەنیا سێ دەتوانن لە یەک کاتدا لەسەر هێڵ بن؛ چوارەم و پێنجەم دەبێت چاوەڕێ بکەن تا ناونیشانێک ئازاد دەبێت.


With 100 computers and three public addresses, 97 would be waiting and the network would feel very slow. On a Cisco router a dynamic translation that is not cleared stays for 24 hours by default, so the wait can be long. Dynamic NAT is therefore a poor choice when hosts are many — PAT solves it.
بە 100 و سێ ، 97 چاوەڕێ دەکەن و زۆر هێواش هەست پێ دەکرێت. لەسەر Cisco وەرگێڕانێکی بزۆک کە پاک نەکرێتەوە بە بنەڕەت 24 کاتژمێر دەمێنێتەوە، بۆیە چاوەڕوانییەکە دەکرێت درێژ بێت. کەواتە هەڵبژاردنێکی خراپە کاتێک زۆرن — چارەسەری دەکات.
Many programs, one address: port numbersزۆر بەرنامە، یەک ناونیشان: ژمارەی پۆرت
At home your laptop has one IP address on its Wi-Fi interface, yet the browser, WhatsApp, Telegram and a game all talk at the same time and their replies never mix. The reason is the port number of the transport layer (layer 4): every program’s connection has its own port, and the replies come back to that port. Ports are taught in Port numbers and sockets.
لە ماڵەوە لەسەر یەک هەیە، کەچی ، WhatsApp، Telegram و یارییەک هەموویان لە هەمان کاتدا قسە دەکەن و وەڵامەکانیان هەرگیز تێکەڵ نابن. هۆکارەکەی ژمارەی ـی (چینی 4): پەیوەندیی هەر بەرنامەیەک خۆی هەیە و وەڵامەکان بۆ ئەو دەگەڕێنەوە. لە ژمارەی پۆرت و سۆکێتەکانـدا فێر کراون.
One IP address per interface, to be exact: a laptop with Wi-Fi and Ethernet both connected has two. PAT uses the same port idea one level up — for the whole home instead of one computer.
بە وردی، یەک بۆ هەر : کە هەم و هەم بەستراوە دوو ناونیشانی هەیە. هەمان بیرۆکەی یەک ئاست بەرزتر بەکار دەهێنێت — بۆ هەموو ماڵەکە لە جیاتی یەک .
PAT: one public address for the whole homeوەرگێڕانی ناونیشانی پۆرت: یەک ناونیشانی گشتی بۆ هەموو ماڵەکە
Two computers at home open the same website at the same moment. The ISP gave the router one public address. How does each reply find the right computer? With PAT the router changes the source port as well as the address and keeps both in its table. Each connection gets its own public port, so the replies never mix.
دوو لە ماڵەوە لە هەمان ساتدا هەمان دەکەنەوە. یەک داوەتە . هەر وەڵامێک چۆن دروستەکە دەدۆزێتەوە؟ بە ـی سەرچاوەش لەگەڵ ناونیشانەکە دەگۆڕێت و هەردووکیان لە خشتەکەیدا دەهێڵێتەوە. هەر پەیوەندییەک گشتیی خۆی وەردەگرێت، بۆیە وەڵامەکان هەرگیز تێکەڵ نابن.


Cisco keeps the original source port when it is free and picks another free port only when two inside hosts collide — as with port 51000 above. Which free port it takes depends on the IOS release; these lessons show the next one up. A port is 16 bits, so one public address can carry tens of thousands of connections at once (at most 65,535 per protocol). That is why PAT is the best kind and the most common: every home router and almost every company uses it. Its formal name is NAPT, network address port translation (RFC 3022); translating addresses alone is basic NAT.
Cisco سەرچاوەی ڕەسەن دەهێڵێتەوە کاتێک ئازادە و تەنیا کاتێک دوو ناوەوە پێکدا دەدەن ئازادی تر هەڵدەبژێرێت — وەک 51000 لە سەرەوە. کام ئازاد وەردەگرێت بەپێی وەشانی IOS دەگۆڕێت؛ ئەم وانانە دواتر پیشان دەدەن. 16 ، بۆیە یەک دەتوانێت دەیان هەزار پەیوەندی لە یەک کاتدا هەڵبگرێت (زۆرترین 65,535 بۆ هەر ). بۆیە باشترین جۆرە و باوترینە: هەموو ماڵەوە و نزیکەی هەموو کۆمپانیایەک بەکاری دەهێنن. ناوە فەرمییەکەی NAPTـە، network address port translation ( 3022)؛ وەرگێڕانی تەنیا ناونیشان basic NATـە.
The three kinds side by sideسێ جۆرەکە لە تەنیشت یەکتری
| Featureتایبەتمەندی | Static NAT | Dynamic NAT | PAT (overload) |
|---|---|---|---|
| Mappingبەستنەوە | one-to-one, fixedیەک بە یەک، جێگیر | one-to-one, from a poolیەک بە یەک، لە | many-to-one, with portsزۆر بە یەک، بە |
| Public addresses neededناونیشانی گشتیی پێویست | one per inside hostیەک بۆ هەر ناوەوە | one per host online at onceیەک بۆ هەر کە لە یەک کاتدا لەسەر هێڵە | one for everybodyیەک بۆ هەمووان |
| Who can start a connectionکێ دەتوانێت پەیوەندی دەست پێ بکات | inside and outsideناوەوە و دەرەوە | inside onlyتەنیا ناوەوە | inside only (unless a port is forwarded)تەنیا ناوەوە (مەگەر پێشڕۆ کرابێت) |
| Typical useبەکارهێنانی باو | publishing serversبڵاوکردنەوەی | rare todayئەمڕۆ کەمە | homes, offices, mobile networksماڵ، نووسینگە، |
The configuration of all three on a Cisco router — ip nat inside, ip nat outside, pools and overload — is the next lesson: Configuring NAT.
ڕێکخستنی هەر سێکیان لەسەر Cisco — ip nat inside، ip nat outside، و overload — وانەی داهاتووە: ڕێکخستنی وەرگێڕانی ناونیشانی ڕایەڵە.
Port forwarding: letting a connection inپێشڕۆکردنی پۆرت: ڕێگەدان بە پەیوەندییەک بێتە ژوورەوە
PAT creates table entries only for connections that start inside. To run a web server at home behind one public address, you add a port-forwarding rule: “whatever arrives on public port 80, send to 192.168.100.2 port 7575”. It is a static PAT entry for incoming traffic. Pictures labelled “PAT” often show exactly this, but it is a different use from the outgoing PAT above.
تەنیا بۆ ئەو پەیوەندییانە تۆمار لە خشتەکەدا دروست دەکات کە لە ناوەوە دەست پێ دەکەن. بۆ کارپێکردنی لە ماڵەوە لە پشت یەک ، یاسایەکی زیاد دەکەیت: «هەرچی لەسەر گشتیی 80 دێت، بینێرە بۆ 192.168.100.2 7575». ئەمە تۆمارێکی جێگیری بۆ هاتوچۆی هاتوو. وێنەکانی بە ناوی «PAT» زۆرجار ڕێک ئەمە پیشان دەدەن، بەڵام بەکارهێنانێکی جیاوازە لە دەرچووەکەی سەرەوە.
Every forwarded port opens a door from the Internet to one inside device, so forward only what you need, keep that device updated and prefer encrypted services such as HTTPS and SSH. On a Cisco router such a rule is a static entry with ports; static NAT both ways shows how it is configured.
هەر پێشڕۆکراو دەرگایەک لە بۆ یەک ئامێری ناوەوە دەکاتەوە، بۆیە تەنیا ئەوەی پێویستە پێشڕۆ بکە، ئەو ئامێرە نوێ بکەرەوە و خزمەتگوزارییە پارێزراوەکانی وەک و SSH هەڵبژێرە. لەسەر Cisco ئەم یاسایە تۆمارێکی جێگیرە لەگەڵ ؛ وەرگێڕانی جێگیری ناونیشانی ڕایەڵە لە هەردوو ئاڕاستەدا پیشان دەدات چۆن ڕێک دەخرێت.
Carrier-grade NAT: translated twiceNATـی ئاستی دابینکەر: دوو جار وەرگێڕان
Many ISPs, mobile operators above all, no longer have a public address for every customer. They give the customer’s router an address from the shared address space 100.64.0.0/10 (RFC 6598, 2012) and translate a second time in their own network: carrier-grade NAT. Your packet is translated twice — at home and at the ISP. Browsing works; port forwarding at home cannot work, because the ISP’s NAT has no rule for you. The details are in Carrier-grade NAT.
زۆر ، بەتایبەتی کۆمپانیاکانی مۆبایل، چیتر بۆ هەموو کڕیارێک نییە. ناونیشانێک لە بلۆکی ناونیشانی هاوبەشی 100.64.0.0/10 ( 6598، 2012) دەدەنە کڕیارەکە و لە خۆیاندا جارێکی تر وەردەگێڕن: . دوو جار وەردەگێڕدرێت — لە ماڵەوە و لە . گەڕان کار دەکات؛ لە ماڵەوە ناتوانێت کار بکات، چونکە هیچ یاسایەکی بۆ تۆ نییە. وردەکارییەکان لە NATـی ئاستی دابینکەرـدان.
Where a phone has only IPv6, the operator may translate between IPv6 and IPv4 instead: NAT64 (tunnels and NAT64).
لە شوێنێکدا مۆبایلێک تەنیا هەبێت، کۆمپانیاکە لەوانەیە لە جیاتی ئەوە لە نێوان و وەربگێڕێت: NAT64 (تونێل و NAT64).
What NAT breaksوەرگێڕانی ناونیشانی ڕایەڵە چی تێک دەدات
NAT saves addresses, but it has a price (RFC 3022 lists them). The Internet was designed end to end: every host could reach every other. Behind NAT that is no longer true:
ناونیشان پاشەکەوت دەکات، بەڵام نرخێکی هەیە ( 3022 ڕیزیان دەکات). بۆ سەرەوە تا سەر دیزاین کرابوو: هەموو دەیتوانی بگاتە هەموو ئەوانی تر. لە پشت ئەمە چیتر ڕاست نییە:
- Incoming connections fail unless a static mapping or a forwarded port exists — a problem for home servers, some games and video calls.
- Protocols that write addresses inside their data (active FTP, SIP for voice calls) need special help in the router.
- Some security protocols that protect the IP header (IPsec AH) cannot pass at all.
- Tracing a user is harder: logs on a server show only the shared public address, so the ISP must keep translation logs.
- پەیوەندیی هاتوو سەرناکەوێت مەگەر بەستنەوەیەکی جێگیر یان پێشڕۆکراو هەبێت — کێشەیەک بۆ ماڵەوە، هەندێک یاری و پەیوەندیی ڤیدیۆیی.
- کە ناونیشان لە ناو دراوەکانیاندا دەنووسن (FTPـی چالاک، SIP بۆ پەیوەندیی دەنگی) پێویستیان بە یارمەتیی تایبەت لە هەیە.
- هەندێک ئاسایش کە سەرپەڕەی IP دەپارێزن (IPsec AH) هەرگیز ناتوانن تێپەڕن.
- بەدواداچوونی بەکارهێنەرێک قورسترە: تۆمارەکانی تەنیا هاوبەشەکە پیشان دەدەن، بۆیە دەبێت تۆماری وەرگێڕانەکان بهێڵێتەوە.
NAT is not a firewallوەرگێڕانی ناونیشانی ڕایەڵە ئاگرەدیوار نییە
Because outsiders cannot see the private addresses and unsolicited packets find no table entry, NAT hides the inside network as a side effect. That is not protection: NAT checks nothing, a forwarded port lets anything through, and malware inside can still connect out. Protection comes from a stateful firewall, which home routers run next to NAT — see Firewalls.
چونکە خەڵکی دەرەوە ناتوانن ببینن و داوانەکراو هیچ تۆمارێک لە خشتەکەدا نادۆزنەوە، وەک ئەنجامێکی ناڕاستەوخۆ ناوەوە دەشارێتەوە. ئەوە پاراستن نییە: هیچ شتێک ناپشکنێت، پێشڕۆکراو ڕێگە بە هەموو شتێک دەدات و لە ناوەوە هێشتا دەتوانێت پەیوەندی بە دەرەوە بکات. پاراستن لە دۆخدارـەوە دێت کە ماڵەوە لە تەنیشت کاری پێ دەکەن — ئاگرەدیوارەکان ببینە.
IPv6: no NAT neededIPv6: پێویست بە وەرگێڕانی ناونیشانی ڕایەڵە نییە
IPv6 has addresses — about 340 undecillion, 340 followed by 36 digits. Every device can have its own global address, so private addresses and NAT are no longer needed and connections work end to end again. Homes still keep a firewall (No NAT, but still a firewall).
ناونیشانی هەیە — نزیکەی 340 ئاندیسیلیۆن، 340 و 36 ژمارەی تر لە دوایدا. هەموو ئامێرێک دەتوانێت ناونیشانێکی جیهانیی خۆی هەبێت، بۆیە چیتر پێویست بە و ناکات و پەیوەندییەکان جارێکی تر لە سەرەوە تا سەر کار دەکەن. ماڵەکان هێشتا دەهێڵنەوە (بێ وەرگێڕانی ناونیشانی ڕایەڵە، بەڵام هێشتا ئاگرەدیوار).
Common mistakesهەڵە باوەکان
Exercisesڕاهێنانەکان
At home two computers open the same social-media site at the same moment. The ISP gave the router one public address. How does the data from the Internet return to the right computer?
لە ماڵەوە دوو لە هەمان ساتدا هەمان دەکەنەوە. یەک داوەتە . دراوەکان لە چۆن دەگەڕێنەوە بۆ دروستەکە؟
Show answerوەڵامەکە پیشان بدە
With PAT. The router gives computer 1’s connection one public port and computer 2’s connection a different one, and keeps both in its translation table. A reply comes back to the public address and one of those ports; the table says which computer and which private port it belongs to, so the data never mixes.
بە . گشتی دەداتە پەیوەندیی یەکەم و جیاواز دەداتە پەیوەندیی دووەم و هەردووکیان لە خشتەی وەرگێڕانەکەیدا دەهێڵێتەوە. وەڵامێک بۆ ناونیشانە گشتییەکە و یەکێک لەو دەگەڕێتەوە؛ خشتەکە دەڵێت هی کام و کام تایبەتە، بۆیە دراوەکان هەرگیز تێکەڵ نابن.
R1’s public address is 203.0.113.5. 192.168.1.20 opens a connection from port 50500, then 192.168.1.21 also from port 50500, then 192.168.1.22 from port 50700, all to 198.51.100.20:443. Write the inside local and inside global address:port of each, taking the next free port on a collision as in the picture above.
ناونیشانی گشتیی R1 203.0.113.5ـە. 192.168.1.20 پەیوەندییەک لە 50500ـەوە دەکاتەوە، پاشان 192.168.1.21یش لە 50500ـەوە، پاشان 192.168.1.22 لە 50700ـەوە، هەموویان بۆ 198.51.100.20:443. و هەریەکەیان بە شێوەی address:port بنووسە؛ لە کاتی پێکدادان ئازادی دواتر وەربگرە، وەک وێنەکەی سەرەوە.
Show answerوەڵامەکە پیشان بدە
| Inside local | Inside global |
|---|---|
| 192.168.1.20:50500 | 203.0.113.5:50500 |
| 192.168.1.21:50500 | 203.0.113.5:50501 |
| 192.168.1.22:50700 | 203.0.113.5:50700 |
The second host’s port 50500 is already in use on the public side, so it gets the next free port; the third keeps its own.
50500ـی دووەم لە لای گشتیدا پێشتر بەکار دێت، بۆیە ئازادی دواتر وەردەگرێت؛ سێیەم خۆی دەهێڵێتەوە.
A school has 100 computers and three public addresses. Compare dynamic NAT and PAT for this school.
قوتابخانەیەک 100 و سێ هەیە. و بۆ ئەم قوتابخانەیە بەراورد بکە.
Show answerوەڵامەکە پیشان بدە
Dynamic NAT: only 3 computers can be online at once and 97 wait, maybe for hours. PAT: all 100 share even one public address, told apart by ports, and the other two addresses stay free for servers or a second router.
: تەنیا 3 دەتوانن لە یەک کاتدا لەسەر هێڵ بن و 97 چاوەڕێ دەکەن، لەوانەیە بۆ چەند کاتژمێرێک. : هەر 100ـەکە تەنانەت یەک هاوبەش دەکەن، بە لە یەکتری جیا دەکرێنەوە و دوو ناونیشانەکەی تر بۆ یان دووەم ئازاد دەمێننەوە.
Shilan’s laptop 10.0.0.15 visits a server 198.51.100.80. Her router translates her to 203.0.113.40. Give the inside local, inside global, outside local and outside global addresses.
شیلان 10.0.0.15 سەردانی 198.51.100.80 دەکات. وەریدەگێڕێت بۆ 203.0.113.40. ، ، و بڵێ.
Show answerوەڵامەکە پیشان بدە
- Inside local 10.0.0.15; inside global 203.0.113.40.
- Outside local and outside global are both 198.51.100.80, because the server’s address is not translated.
- 10.0.0.15؛ 203.0.113.40.
- و هەردووکیان 198.51.100.80ـن، چونکە ناونیشانی وەرناگێڕدرێت.
Summaryکورتە
- IPv4 has only about 4.3 billion addresses; homes and companies use private addresses inside and NAT to share public ones.
- NAT rewrites the source on the way out and the destination on the way back, using a translation table.
- Inside local = private address seen inside; inside global = public address seen outside; outside local/global = the outside host’s address.
- Static = fixed pair for servers; dynamic = one pool address per active host; PAT = one address for many hosts, told apart by ports (the most common).
- Port forwarding is a static PAT rule for incoming connections; carrier-grade NAT (100.64.0.0/10) translates a second time at the ISP.
- NAT is not a firewall, it breaks end-to-end connections, and IPv6 removes the need for it.
- تەنیا نزیکەی 4.3 ملیار ناونیشانی هەیە؛ ماڵ و کۆمپانیاکان لە ناوەوە و بۆ هاوبەشکردنی گشتییەکان بەکار دەهێنن.
- لە دەرچووندا سەرچاوە و لە گەڕانەوەدا مەبەست دەگۆڕێت، بە خشتەیەکی وەرگێڕان.
- = ناونیشانی تایبەت لە ناوەوە؛ = ناونیشانی گشتی لە دەرەوە؛ / = ناونیشانی دەرەوە.
- جێگیر = جووتی جێگیر بۆ ؛ بزۆک = یەک ناونیشانی بۆ هەر چالاک؛ = یەک ناونیشان بۆ زۆر ، بە جیا دەکرێنەوە (باوترین).
- یاسایەکی جێگیری بۆ پەیوەندیی هاتوو؛ (100.64.0.0/10) لە جارێکی تر وەردەگێڕێت.
- نییە، پەیوەندیی سەرەوە تا سەر تێک دەدات و پێویستی پێی نامێنێت.
Next: configure all three on a Cisco router — Configuring NAT.
دواتر: هەر سێکیان لەسەر Cisco ڕێک بخە — ڕێکخستنی وەرگێڕانی ناونیشانی ڕایەڵە.
Lesson complete!وانەکە تەواو بوو!
Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.
Key termsزاراوە سەرەکییەکان
Configuring Static NAT, Dynamic NAT and PATڕێکخستنی وەرگێڕانی جێگیری ناونیشانی ڕایەڵە، وەرگێڕانی بزۆکی ناونیشانی ڕایەڵە و وەرگێڕانی ناونیشانی پۆرت
Related lecturesوانە پەیوەندیدارەکان
- Configuring Static NAT, Dynamic NAT and PATڕێکخستنی وەرگێڕانی جێگیری ناونیشانی ڕایەڵە، وەرگێڕانی بزۆکی ناونیشانی ڕایەڵە و وەرگێڕانی ناونیشانی پۆرت
- IPv6 in Practice: SLAAC, Neighbour Discovery and Dual StackIPv6 لە کرداردا: SLAAC، دۆزینەوەی دراوسێ و ستاکی دووانە
- IP Addresses and MAC Addressesناونیشانەکانی IP و ناونیشانەکانی MAC
- Network Defences: Firewalls, Segmentation, Monitoring and SIEMبەرگرییەکانی ڕایەڵە: ئاگرەدیوار، بەشبەشکردنی ڕایەڵە، چاودێریی ئاسایش و SIEM
- DHCP on a Cisco Router and DHCP RelayDHCP لەسەر ڕێدۆزێکی Cisco و گوازەرەوەی DHCP
- Access Control Lists: Filtering TrafficACLـەکان: فلتەرکردنی هاتوچۆ
References and further readingسەرچاوەکان و خوێندنەوەی زیاتر
- RFC 3022: Traditional IP Network Address Translator (Basic NAT and NAPT; loss of end-to-end significance)
- RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space (100.64.0.0/10 for carrier-grade NAT, April 2012)
- Cisco: Use Local and Global NAT Terms (inside local, inside global, outside local, outside global; updated 9 December 2022)
- RFC 1918: Address Allocation for Private Internets
- RFC 5737: IPv4 Address Blocks Reserved for Documentation
- Cisco Press: Enterprise Networking, Security, and Automation Companion Guide (CCNAv7) — NAT for IPv4
This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.