DHCP &nat
DHCP &nat
NAT translates private IP addresses into public IPs, allowing multiple devices to access the
Internet through a single public address.
Types of NAT:
● 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
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
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
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
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
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)# do wr
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
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)# do sh ip int br
Now we will create two pools that is why we need to exclude two ips
PC0 → desktop→ IP add→ DHCP then we can see the ip addresses are assigned automatically
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