🌐 NAT (Network Address Translation)

 

🌐 NAT (Network Address Translation)


🧠 Top 5 Key Points

  1. Translates Private IPs to Public IPs:
    NAT converts internal (private) IP addresses into a single or multiple public IPs so that devices inside a LAN can access the Internet.

  2. Conserves Public IP Addresses:
    NAT allows multiple internal hosts to share one public IP, saving global address space.

  3. Improves Security:
    Internal IPs remain hidden from the outside world, reducing attack exposure.

  4. Types of NAT:

    • Static NAT: One-to-one mapping (internal ↔ public).

    • Dynamic NAT: Many-to-many mapping (pool of public IPs).

    • PAT (NAT Overload): Many-to-one mapping (most common).

  5. Configured on Routers:
    NAT runs on routers at the boundary between private and public networks, translating IPs for outbound/inbound traffic.


⚙️ Technical Summary

FeatureDescription
OSI LayerNetwork Layer (Layer 3)
Main FunctionTranslate IP addresses
TypesStatic, Dynamic, PAT
Common Commandip nat inside / ip nat outside
Use CaseLAN-to-Internet communication

🧰 Packet Tracer Lab – NAT Configuration


🎯 Goal:

Use PAT (NAT Overload) to allow multiple internal hosts to share one public IP for Internet access.


🖥️ Network Topology

[PC1]---[Switch]---[Router]---[Cloud/Internet Router]

IP Plan

DeviceInterfaceIP AddressDescription
Router (R1)G0/0192.168.10.1Inside (LAN)
G0/1200.0.0.1Outside (Public)
PC1NIC192.168.10.10Inside Host
PC2NIC192.168.10.20Inside Host
ISP RouterG0/0200.0.0.2Public (Next Hop)

🪜 Step-by-Step Configuration

🔹 1. Configure Router Interfaces

enable conf t interface g0/0 ip address 192.168.10.1 255.255.255.0 ip nat inside no shutdown exit interface g0/1 ip address 200.0.0.1 255.255.255.0 ip nat outside no shutdown exit

🔹 2. Create Access List for Inside Network

access-list 1 permit 192.168.10.0 0.0.0.255

🔹 3. Configure NAT Overload

ip nat inside source list 1 interface g0/1 overload

🔹 4. Configure Default Route

(To reach the internet via ISP)

ip route 0.0.0.0 0.0.0.0 200.0.0.2

🔹 5. Verify NAT Configuration

show ip nat translations show ip nat statistics

💡 Testing NAT

  1. On PC1 and PC2, set:

    IP Address: 192.168.10.10 / 192.168.10.20 Subnet Mask: 255.255.255.0 Default Gateway: 192.168.10.1
  2. Ping from PC1 or PC2 → 200.0.0.2
    ✅ Should succeed.

  3. On Router (R1), run:

    show ip nat translations

    You’ll see private IPs mapped to 200.0.0.1 (public IP).


🧠 Learning Summary

ConceptDescription
NAT FunctionTranslates private IPs to public
PATMany-to-one mapping (most used)
Inside InterfaceConnected to LAN
Outside InterfaceConnected to Internet
Verificationshow ip nat translations

💬 Teaching Tip

“NAT is like a receptionist — many employees (private IPs) talk to outsiders (public IPs) through one phone number (public IP), but the receptionist knows who’s who internally.”

Comments

Post a Comment

Popular posts from this blog

🖥️ Private IP vs Public IP Address

🧠 Introduction to CCNA Networking