---
description: Day 44
---

# NAT (Part 1)

RFC 1918 specifies the following IPv4 address ranges as private:

* `10.0.0.0/8` (10.0.0.0 to 10.255.255.255)
* `172.16.0.0/12` (172.16.0.0 - 172.31.255.255)
* `192.168.0.0/16` (192.168.0.0 - 192.168.255.255)

Private IP addresses can't be used over the internet.

**NAT** (Network Address Translation) is used to modify the source and/or the destination IP addresses of packets. One of the reasons to use NAT is to allow hosts with private addresses to communicate with other hosts over the internet.&#x20;

<figure><img src="https://3642595937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKsHxwINrQaKCeVpC90i9%2Fuploads%2FyZCbCZOs34KjzKomUP9h%2Fimage.png?alt=media&#x26;token=f3de7673-aa10-452c-b569-fe2f29c37933" alt="nat demo" width="563"><figcaption></figcaption></figure>

#### Static NAT

**Static NAT** involves statically configuring one-to-one mappings of private IP addresses to public IP addresses. It allows devices with private addresses to communicate over the internet. However, it doesn't help to preserve IP addresses. An inside local IP address is mapped to an inside global IP address.&#x20;

* An **inside local** address is the IP address of the inside host from the perspective of the local network - the IP address actually configured on the interface (usually a private address).&#x20;
* An **inside global** address is the IP address of the inside host from the perspective of outside hosts - the IP address of the inside host after NAT (usually a public address).&#x20;
* An **outside local** address is the IP address of the outside host from the perspective of the local network.
* An **outside global** address is the IP address of the outside host from the perspective of the outside network.

#### Configuration

To configure static NAT on Cisco IOS:

1. Define the inside and outside interfaces and from the interface config mode enter the command `ip nat` followed by `inside` - for the internal network, `outside` - for the external network.&#x20;
2. Configure the one-to-one IP address mappings - `ip nat inside source static` followed by the inside local and the inside global IP addresses.

To view the active NAT translations, use the command `show ip nat translations`. To clear the NAT translation table, use the command `clear ip nat translation *`. This deletes all entries for dynamic NAT translations. Static NAT entries remain the same. To view the NAT statistics, enter the command `show ip nat statistics`.

<figure><img src="https://3642595937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKsHxwINrQaKCeVpC90i9%2Fuploads%2FT6ppXmDJSQcXkYW3OvJg%2Fimage.png?alt=media&#x26;token=f56b83bf-3cdd-4309-8ac3-f7d01e1f42d6" alt="summary" width="563"><figcaption><p>Summary</p></figcaption></figure>

{% file src="https://3642595937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKsHxwINrQaKCeVpC90i9%2Fuploads%2F9TC8NdSblGKlcR5Go6rO%2FDay%2044%20Flashcards%20-%20NAT%20(Part%201).apkg?alt=media&token=c1ad825d-0ffa-4136-95de-da7f99b5ece8" %}

{% file src="https://3642595937-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FKsHxwINrQaKCeVpC90i9%2Fuploads%2FqoKnjc2LSg2OcXtJwT44%2FDay%2044%20Lab%20-%20Static%20NAT.pkt?alt=media&token=0d21ba23-52ce-46fb-b9d7-c0cac39fc49d" %}

{% embed url="https://youtu.be/vir6n_NVZFw" %}
