0% found this document useful (0 votes)
5 views7 pages

DHCP &nat

The document explains Network Address Translation (NAT), detailing its types (Static, Dynamic, and PAT) and its role in enabling private networks to access the Internet. It also covers the configuration of routers and DHCP for dynamic IP address assignment in a corporate office setting, highlighting the setup process and key features of DHCP. Additionally, it includes examples of IP address ranges and commands for verifying network configurations.

Uploaded by

mdfoisal552211
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views7 pages

DHCP &nat

The document explains Network Address Translation (NAT), detailing its types (Static, Dynamic, and PAT) and its role in enabling private networks to access the Internet. It also covers the configuration of routers and DHCP for dynamic IP address assignment in a corporate office setting, highlighting the setup process and key features of DHCP. Additionally, it includes examples of IP address ranges and commands for verifying network configurations.

Uploaded by

mdfoisal552211
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

NAT (Network Address Translation)

NAT translates private IP addresses into public IPs, allowing multiple devices to access the
Internet through a single public address.

Types of NAT:

●​ Static NAT: Maps a private IP to a specific public IP.


●​ Dynamic NAT: Uses a pool of public IPs for private IP translations.
●​ PAT (Port Address Translation): Maps multiple private IPs to a single public IP using
ports.

Internet Connectivity for Private Networks

●​ Application: Small offices, homes, or enterprises often use private IP addresses (e.g.,
192.168.x.x or 10.x.x.x). NAT allows these devices to access the Internet by translating
private IPs to a single or pool of public IPs.
●​ Example: A home router translates private IP addresses of devices (laptops, phones,
smart TVs) to a public IP assigned by the Internet Service Provider (ISP).
Range of IP Addresses in 200.100.50.0/24

●​ Total IPs in the Subnet: 232−24=2562^{32-24} = 256232−24=256 IPs.


●​ Usable IPs: Subtract 2 (1 for the network address and 1 for the broadcast address):
○​ Usable IPs: 256−2=254256 - 2 = 254256−2=254.
●​ IP Address Range:
○​ Network Address: 200.100.50.0
○​ First Usable Address: 200.100.50.1
○​ Last Usable Address: 200.100.50.254
○​ Broadcast Address: 200.100.50.255

Configuration:

Router 0 :
GigabitEthernet0/1: Ip: 200.100.50.1
Mask: 255.255.255.0
GigabitEthernet0/0: IP: 192.168.20.1
Mask: 255.255.255.0

Router 1 :
GigabitEthernet0/0: Ip: 200.100.50.2
Mask: 255.255.255.0
GigabitEthernet0/1: IP: 8.8.8.1
Mask: 255.255.255.0

Server: Desktop—> IP Add


IP: 8.8.8.8
Mask: 255.255.255.0
Default Gateway: 8.8.8.1
DNS Server: 0.0.0.0

PC0:
IP : 192.168.20.10
Mask:255.255.255.0
Default gateway: 192.168.20.1
DNS Server: 0.0.0.0

PC1:
IP : 192.168.20.20
Mask:255.255.255.0
Default gateway: 192.168.20.1
DNS Server: 0.0.0.0

As there are two routers:


Router 0:
(router config)# router ospf 30
router(config-router)# router-id 1.1.1.1
router(config-router)# network 192.168.20.0 0.0.0.255 area 0
router(config-router)# network 200.100.50.0 0.0.0.3 area 0
router(config-router)# exit
router(config-router)#do wr

Router 1:
(router config)# router ospf 30
router(config-router)# router-id 2.2.2.2
router(config-router)# network 8.8.8.0 0.0.0.255 area 0
router(config-router)# network 200.100.50.0 0.0.0.3 area 0
router(config-router)# exit
router(config-router)#do wr

Go to PC0 and Prompt—>

ping 8.8.8.8
You will get responses

tracert 8.8.8.8

For translation:

Router 0:
(router config)# end
router#sh ip nat translations

There would be no responses

—-------> need to do translations

Router 0:
router # conf t
router(config)# ip nat inside source static 192.168.20.10 200.100.50.1
router(config)# interface GigabitEthernet0/0
router(config-if)# ip nat inside
router(config-if)# ex

router(config)# interface GigabitEthernet0/1


router(config-if)# ip nat outside
router(config-if)# ex

router(config)# do wr

router# sh ip nat translations

Then again go to PC 0 to ping


PC 0:----> command prompt
tracert 8.8.8.8
Ping 8.8.8.8

Then again go to Router 0 :


router# sh ip nat translations

We will get some translations


DHCP Dynamic Host Configuration Protocol

Introduction

DHCP is a protocol that automates the assignment of IP addresses, subnet masks, default gateways, and
DNS servers to devices on a network. It simplifies network administration and ensures that devices
receive valid IP configurations.

Key Features

●​ Dynamic IP Allocation: Automatically assigns IP addresses to devices.


●​ Centralized Management: Administered from a central server.
●​ Reduced Errors: Minimizes configuration errors associated with manual IP assignment.

DHCP in a Corporate Office Network

1.​ Situation:
○​ A corporate office has 500 employees, each using devices such as laptops, smartphones,
and IP phones.
○​ The IT team needs to assign IP addresses to all devices dynamically, as employees
frequently change workstations or connect new devices to the network.
Router:
CLI:

router# en
router# config t
router (config)# hostname dhcp-server
dhcp-server(config)# int f0/0
dhcp-server(config)# ip add 192.168.1.1 255.255.255.0
dhcp-server(config)#no sh

dhcp-server(config)# int f0/1


dhcp-server(config)#ip add 192.168.2.1 255.255.255.0
dhcp-server(config)# no sh
dhcp-server(config)# exit

dhcp-server(config)# do sh ip int br

Now we will create two pools that is why we need to exclude two ips

dhcp-server(config)# ip dhcp excluded-address 192.168.1.1


dhcp-server(config)#ip dhcp excluded-address 192.168.2.1

Creating the Pool


dhcp-server(config)#ip dhcp pool 192.168.1.1 [this is the name]

dhcp-server(dhcp-config)# network 192.168.1.1 255.255.255.0


dhcp-server(dhcp-config)# default-router 192.168.1.1
dhcp-server(dhcp-config)# dns-server 8.8.8.8
dhcp-server(dhcp-config)#exit

dhcp-server(config)#ip dhcp pool 192.168.2.1 [this is the name]

dhcp-server(dhcp-config)# network 192.168.2.0 255.255.255.0


dhcp-server(dhcp-config)# default-router 192.168.2.1
dhcp-server(dhcp-config)# dns-server 8.8.8.8

PC0 → desktop→ IP add→ DHCP then we can see the ip addresses are assigned automatically

If we need to check connection

PC 3 → command prompt
ping 192.168.1.2
If any packets drops its because of ARP → Address Resolution Protocol (ARP) is a communication
protocol that connects a device's IP address to its MAC address
So it will receive packets

Router:
dhcp-server: sh run | sec dhcp

You will get the details of DHCP

You might also like