Jeremy’s IT Lab lecture video:

Day 44 - NAT (1)


Commands


NAT Info

Private IPv4 Addresses (RFC 1918)

IPv4 doesn’t provide enough addresses for all devices that need them in the modern world.

  • That’s why RFC 1918 was created as a short term solution for the problem. It specifies three IPv4 ranges as private address ranges (meant for local usage), and they are:
    1. 10.0.0.0/8 (10.0.0.0 to 10.255.255.255)
    2. 172.16.0.0/12 (172.16.0.0 to 172.31.255.255)
    3. 192.168.0.0/16 (192.168.0.0 to 192.168.255.255)
  • Private IP addresses cannot be used over the internet.
  • These addresses can be used freely in your local networks. They do not have to be globally unique.

Network Address Translation (NAT) General Information

Network Address Translation (NAT) is a protocol that is used to modify the source and/or destination IP addresses of packets.

  • There are many reasons to use NAT, but the most common reason is to allow hosts with private IP addresses to communicate with other hosts over the internet.
  • Source NAT is the NAT type that you’ll have to understand and know how to configure for the CCNA.
Source NAT demonstration

Source NAT types, and what will be discussed in this lecture/note

  • In this lecture/note, we’ll be focusing on Source Static NAT and how to set it up.
  • Meanwhile, Dynamic Source NAT and Dynamic Source PAT will be discussed in the next lecture/note. (Day 45 - NAT (2))

NAT Address Types

There are four address types used in NAT, they are:

  1. Inside Local
    • The IP address of the inside host, from the perspective of the local network
  2. Inside Global
    • The IP address of the inside host, from the perspective of the global network
  3. Outside Local
    • The IP address of the outside host, from the perspective of the local network
  4. Outside Global
    • The IP address of the outside host, from the perspective of the global network

Good way to remember the types

  • Inside/Outside refers to the location of the host
  • Local/Global refers to the perspective

Note on: Outside Local and Outside Global addresses

  • For the CCNA, the Outside Local and Outside Global addresses will be the same and will not change.
  • Unless Destination NAT is used, the two addresses will be the same. (This is outside the scope of the CCNA certificate)

Static NAT

Static NAT involves statically configuring one-to-one mappings of private IP addresses to public IP addresses.

  • When traffic from the internal host is sent to the outside network, the router will translate the source address.
  • Also, this one-to-one mapping also allows external hosts to access the internal host via the Inside Global address.

Static NAT Configuration

  • show ip nat translations
    • Shows information about IP addresses that have been translated through NAT.
    • Includes the following information:
      • Protocol used in the connection
      • Inside Local address
      • Inside Global address
      • Outside Local address
      • Outside Global address
  • show ip nat statistics
    • Shows statistics about the current NAT process
    • Includes the following information:
      • Total active translations (static, dynamic, extended)
      • Peak translations (highest amount of translations in one time)
      • Outside interfaces
      • Inside interfaces
      • Etc.
  • clear ip nat translation *
    • Clears all dynamic NAT translations in the NAT translation table
    • (One type of dynamic translations is IP address translations with a port included)
  • ip nat inside
    • Defines the ‘inside’ interface(s) connected to the internal network
  • ip nat outside
    • Defines the ‘outside’ interface(s) connected to the external network
  • ip nat inside source static INSIDE-LOCAL-IP INSIDE-GLOBAL-IP
    • Configures a one-to-one (Static NAT) IP address mapping

Jeremy’s IT Lab előadásvideó:

44. Nap - NAT (1)


Parancsok


NAT Információk

Privát IPv4 Címek (RFC 1918)

Az IPv4 címtér véges, és nem biztosít elegendő egyedi címet a modern világ összes hálózatra kapcsolódó eszköze számára.

  • Ezért hozták létre az RFC 1918 szabványt átmeneti megoldásként. Ez a dokumentum három IPv4 címtartományt határoz meg privát (helyi felhasználásra szánt) címtartományként:
    1. 10.0.0.0/8 (10.0.0.010.255.255.255)
    2. 172.16.0.0/12 (172.16.0.0172.31.255.255)
    3. 192.168.0.0/16 (192.168.0.0192.168.255.255)
  • A privát IP címek nem továbbíthatók (nem forgalomirányíthatók) az interneten.
  • Ezek a címtartományok bárki által szabadon és díjmentesen felhasználhatók a helyi magánhálózatokban; nem szükséges globálisan egyedinek lenniük.

Network Address Translation (NAT) Általános Információk

A Network Address Translation (NAT) egy olyan technológia, amellyel a csomagok forrás (source) és/vagy cél (destination) IP címét módosítják (fordítják) áthaladás közben.

  • A NAT-nak számos felhasználási módja van, de a leggyakoribb cél az, hogy a privát IP címmel rendelkező belső hostok kommunikálhassanak az interneten található külső hostokkal.
  • A Source NAT a legfontosabb NAT típus, amelyet a CCNA vizsgára érteni és konfigurálni kell.
Source NAT folyamat bemutatása

Source NAT típusok és az anyag felépítése

  • Ebben a leckében/jegyzetben a Source Static NAT működésére és konfigurálására fókuszálunk.
  • A Dynamic Source NAT és a Dynamic Source PAT a következő tananyagban kerül bemutatásra (45. Nap - NAT (2)).

NAT Címtípusok (NAT Address Types)

A NAT terminológiában 4 címtípust különböztetünk meg:

  1. Inside Local
    • A belső (inside) host IP címe a helyi (local) belső hálózat szemszögéből (jellemzően privát IP).
  2. Inside Global
    • A belső (inside) host IP címe a globális (global) külső hálózat / internet szemszögéből (a lefordított nyilvános IP).
  3. Outside Local
    • A külső (outside) host IP címe a helyi (local) belső hálózat szemszögéből.
  4. Outside Global
    • A külső (outside) host IP címe a globális (global) külső hálózat szemszögéből.

Egyszerű megjegyzési szabály

  • Az Inside / Outside a host fizikai/logikai elhelyezkedésére utal.
  • A Local / Global a nézőpontra (szemszögre) utal.

Megjegyzés: Outside Local és Outside Global címek

  • A CCNA szintjén az Outside Local és Outside Global címek mindig megegyeznek, és nem változnak meg.
  • Csak akkor térnének el, ha Destination NAT-ot alkalmaznánk (ez a CCNA tananyagon kívül esik).

Static NAT (Statikus NAT)

A Static NAT egy állandó, egy-az-egyhez (one-to-one) leképezést hoz létre egy privát IP cím és egy nyilvános IP cím között.

  • Amikor a belső host forgalmat küld a külső hálózat felé, a router a forrás (source) címet lefordítja a megadott nyilvános címre.
  • Ez az egy-az-egyhez kapcsolat azt is lehetővé teszi, hogy külső hostok közvetlenül elérjék a belső szervert/eszközt az Inside Global címen keresztül.

Static NAT Konfiguráció

  • show ip nat translations
    • Megjeleníti a NAT táblázatban jelenleg aktív összes címfordítási bejegyzést.
    • A következő oszlopokat tartalmazza:
      • Protokoll (ha meg van adva)
      • Inside Local cím
      • Inside Global cím
      • Outside Local cím
      • Outside Global cím
  • show ip nat statistics
    • Részletes statisztikát nyújt a futó NAT folyamatról:
      • Aktív fordítások száma (static, dynamic, extended)
      • Csúcs fordítási szám (peak translations)
      • Outside interfészek listája
      • Inside interfészek listája
      • Stb.
  • clear ip nat translation *
    • Törli az összes dinamikus NAT bejegyzést a táblázatból.
    • (A statikus fordításokat nem törli, csak a dinamikusan létrejötteket).
  • ip nat inside
    • Kijelöli az interfészt mint a belső (inside) hálózathoz tartozó interfészt.
  • ip nat outside
    • Kijelöli az interfészt mint a külső (outside) hálózathoz tartozó interfészt.
  • ip nat inside source static INSIDE-LOCAL-IP INSIDE-GLOBAL-IP
    • Létrehozza a fix egy-az-egyhez statikus NAT kapcsolatot a megadott belső és külső IP cím között.