0% found this document useful (0 votes)
23 views6 pages

Basic DHCP and NAT Configuration Guide

This document outlines a lab session focused on configuring DHCP and NAT on Cisco routers. It includes detailed tasks for setting up basic router configurations, establishing a DHCP server, and implementing static and dynamic NAT, including NAT overload. The document also provides specific commands and verification steps to ensure successful configuration and connectivity between devices.

Uploaded by

tranb9485
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)
23 views6 pages

Basic DHCP and NAT Configuration Guide

This document outlines a lab session focused on configuring DHCP and NAT on Cisco routers. It includes detailed tasks for setting up basic router configurations, establishing a DHCP server, and implementing static and dynamic NAT, including NAT overload. The document also provides specific commands and verification steps to ensure successful configuration and connectivity between devices.

Uploaded by

tranb9485
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

Session4: Basic DHCP and NAT Configuration

Topology Diagram

Addressing Table

Device Interface IP Address Subnet Mask

S0/0/0 [Link] [Link]


R1 Fa0/0 [Link] [Link]
Fa0/1 [Link] [Link]
S0/0/0 [Link] [Link]
R2 S0/0/1 [Link] [Link]
Fa0/0 [Link] [Link]
ISP S0/0/1 [Link] [Link]

Learning Objectives
Upon completion of this lab, you will be able to:
 Prepare the network
 Perform basic router configurations
 Configure a Cisco IOS DHCP server
 Configure static and default routing
 Configure static NAT
 Configure dynamic NAT with a pool of addresses

All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 1 of 6
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration

 Configure NAT overload

Scenario
In this lab, you will configure the DHCP and NAT IP services. One router is the DHCP server. The other
router forwards DHCP requests to the server. You will also configure both static and dynamic NAT
configurations, including NAT overload. When you have completed the configurations, verify the
connectivity between the inside and outside addresses.

Task 1: Perform Basic Router Configurations


Configure the R1, R2, and ISP routers according to the following guidelines:
 Configure the device hostname.
 Disable DNS lookup.
 Configure a privileged EXEC mode password.
 Configure a message-of-the-day banner.
 Configure a password for the console connections.
 Configure a password for all vty connections.
 Configure IP addresses on all routers. The PCs receive IP addressing from DHCP later in the
activity.
 Enable OSPF with process ID 1 on R1 and R2. Do not advertise the [Link]/27 network.
For all devices:
enable
conf t
no ip domain-lookup
enable secret class
banner motd $Authorized Access Only!$
!
line con 0
logging synchronous
password cisco
login
!
line vty 0 4
password cisco
login
end
copy run start

R1:
hostname R1
int fa0/0
ip address [Link] [Link]
no shut
int fa0/1
ip address [Link] [Link]
no shut
int s0/0/0
ip address [Link] [Link]
clock rate 125000
no shut
!

All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 2 of 6
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration

router ospf 1
network [Link] [Link] area 0
network [Link] [Link] area 0
network [Link] [Link] area 0

R2:
hostname R2
int fa0/0
ip address [Link] [Link]
no shut
int s0/0/0
ip address [Link] [Link]
no shut
int s0/0/1
ip address [Link] [Link]
clock rate 125000
no shut
!
router ospf 1
network [Link] [Link] area 0

ISP:
hostname ISP
int s0/0/1
ip address [Link] [Link]
no shut
!

Task 2: Configure a Cisco IOS DHCP Server

Step 1: Exclude statically assigned addresses.


The DHCP server assumes that all IP addresses in a DHCP address pool subnet are available for
assigning to DHCP clients. You must specify the IP addresses that the DHCP server should not assign to
clients. These IP address are usually static addresses reserved for the router interface, switch
management IP address, servers, and local network printer. The ip dhcp excluded-address command
prevents the router from assigning IP addresses within the configured range. The following commands
exclude the first 10 IP addresses from each pool for the LANs attached to R1. These addresses will not
be assigned to any DHCP clients.
R1(config)#ip dhcp excluded-address [Link] [Link]
R1(config)#ip dhcp excluded-address [Link] [Link]

Step 2: Configure the pool.


Create the DHCP pool using the ip dhcp pool command and name it R1Fa0.
R1(config)#ip dhcp pool R1Fa0

Specify the subnet to use when assigning IP addresses. DHCP pools automatically associate with an
interface based on the network statement. The router now acts as a DHCP server, handing out addresses
in the [Link]/24 subnet starting with [Link].
R1(dhcp-config)#network [Link] [Link]

Configure the default router and domain name server for the network. Clients receive these settings via
DHCP, along with an IP address.

All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 3 of 6
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration

R1(dhcp-config)#dns-server [Link]
R1(dhcp-config)#default-router [Link]

Note: There is not a DNS server at [Link]. You are configuring the command for practice only.
R1(config)#ip dhcp pool R1Fa1
R1(dhcp-config)#network [Link] [Link]
R1(dhcp-config)#dns-server [Link]
R1(dhcp-config)#default-router [Link]

Step 3: Verify the DHCP configuration.


You can verify the DHCP server configuration in several different ways. The most basic way is to
configure a host on the subnet to receive an IP address via DHCP. You can then issue commands on the
router to get more information. The show ip dhcp binding command provides information on all currently
assigned DHCP addresses. For instance, the following output shows that the IP address [Link]
has been assigned to MAC address 3031.632e.3537.6563. The IP lease expires on September 14, 2007
at 7:33 pm.
R1#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address
[Link] 0007.EC66.8752 -- Automatic
[Link] 00E0.F724.8EDA -- Automatic

Task 3: Configure Static and Default Routing


ISP uses static routing to reach all networks beyond R2. However, R2 translates private addresses into
public addresses before sending traffic to ISP. Therefore, ISP must be configured with the public
addresses that are part of the NAT configuration on R2. Enter the following static route on ISP:
ISP(config)#ip route [Link] [Link] serial 0/0/1

This static route includes all addresses assigned to R2 for public use.
Configure a default route on R2 and propagate the route in OSPF.
R2(config)#ip route [Link] [Link] [Link]
R2(config)#router ospf 1
R2(config-router)#default-information originate

Allow a few seconds for R1 to learn the default route from R2 and then check the R1 routing table.
Alternatively, you can clear the routing table with the clear ip route * command. A default route pointing
to R2 should appear in the R1 routing table. From R1, ping the serial 0/0/1 interface on R2
([Link]). The pings should be successful. Troubleshoot if the pings fail.

Task 4: Configure Static NAT

Step 1: Statically map a public IP address to a private IP address.


The inside server attached to R2 is accessible by outside hosts beyond ISP. Statically assign the public
IP address [Link] as the address for NAT to use to map packets to the private IP address of
the inside server at [Link].
R2(config)#ip nat inside source static [Link] [Link]

Step 2: Specify inside and outside NAT interfaces.


Before NAT can work, you must specify which interfaces are inside and which interfaces are outside.

All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 4 of 6
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration

R2(config)#interface serial 0/0/1


R2(config-if)#ip nat outside
R2(config-if)#interface fa0/0
R2(config-if)#ip nat inside

Step 3: Verify the static NAT configuration.


From ISP, ping the public IP address [Link].

Task 5: Configure Dynamic NAT with a Pool of Addresses


While static NAT provides a permanent mapping between an internal address and a specific public
address, dynamic NAT maps private IP addresses to public addresses. These public IP addresses come
from a NAT pool.

Step 1: Define a pool of global addresses.


Create a pool of addresses to which matched source addresses are translated. The following command
creates a pool named MY-NAT-POOL that translates matched addresses to an available IP address in
the [Link] - [Link] range.
R2(config)#ip nat pool MY-NAT-POOL [Link] [Link] netmask
[Link]

Step 2: Create a standard access control list to identify which inside addresses are translated.
R2(config)#ip access-list extended NAT
R2(config-std-nacl)#permit ip [Link] [Link] any
R2(config-std-nacl)#permit ip [Link] [Link] any

Step 3: Establish dynamic source translation by binding the pool with the access control list.
A router can have more than one NAT pool and more than one ACL. The following command tells the
router which address pool to use to translate hosts that are allowed by the ACL.
R2(config)#ip nat inside source list NAT pool MY-NAT-POOL

Step 4: Specify inside and outside NAT interfaces.


You have already specified the inside and outside interfaces for your static NAT configuration. Now add
the serial interface linked to R1 as an inside interface.
R2(config)#interface serial 0/0/0
R2(config-if)#ip nat inside

Step 5: Verify the configuration.


Ping ISP from PC1 and PC2. Then use the show ip nat translations command on R2 to verify NAT.
R2#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- [Link] [Link] --- ---
--- [Link] [Link] --- ---
--- [Link] [Link] --- ---

Task 6: Configure NAT Overload


In the previous example, what would happen if you needed more than the six public IP addresses that the
pool allows?
By tracking port numbers, NAT overloading allows multiple inside users to reuse a public IP address.

All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 5 of 6
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration

In this task, you will remove the pool and mapping statement configured in the previous task. Then you
will configure NAT overload on R2 so that all internal IP addresses are translated to the R2 S0/0/1
address when connecting to any outside device.

Step 1: Remove the NAT pool and mapping statement.


Use the following commands to remove the NAT pool and the map to the NAT ACL.
R2(config)#no ip nat pool MY-NAT-POOL [Link] [Link] netmask
[Link]
R2(config)#no ip nat inside source list NAT pool MY-NAT-POOL

If you receive the following message, clear your NAT translations.


%Pool MY-NAT-POOL in use, cannot destroy
R2#clear ip nat translation *

Step 2: Configure PAT on R2 using the serial 0/0/1 interface public IP address.
The configuration is similar to dynamic NAT, except that instead of a pool of addresses, the interface
keyword is used to identify the outside IP address. Therefore, no NAT pool is defined. The overload
keyword enables the addition of the port number to the translation.
Because you already configured an ACL to identify which inside IP addresses to translate as well as
which interfaces are inside and outside, you only need to configure the following:
R2(config)#ip nat inside source list NAT interface S0/0/1 overload

Step 3: Verify the configuration.


Ping ISP from PC1 and PC2. Then use the show ip nat translations command on R2 to verify NAT.
R2#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp [Link]:3 [Link]:3 [Link]:3
[Link]:3
icmp [Link]:1024192.168.11.11:3 [Link]:3
[Link]:1024
--- [Link] [Link] --- ---

Note: In the previous task, you could have added the keyword overload to the ip nat inside source list
NAT pool MY-NAT-POOL command to allow for more than six concurrent users.

Task 7: Document the Network


On each router, issue the show run command and capture the configurations.

All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 6 of 6

Common questions

Powered by AI

The 'ip dhcp excluded-address' command is used to specify a range of IP addresses that the DHCP server should not assign to clients. This is necessary to ensure that addresses reserved for network devices, such as the router itself or other critical infrastructure, are not dynamically assigned and are kept static .

Verification of NAT configuration involves using the 'show ip nat translations' command which provides a table of current NAT translations, showing mappings between inside and outside IPs. This allows administrators to confirm that addresses are being correctly translated; in the case of a dynamic pool, check that private addresses are accessing the internet via assigned public addresses. Third-party connectivity can be checked with pings to external interfaces or addresses .

To configure a Cisco IOS DHCP server, you must first exclude statically assigned addresses using the 'ip dhcp excluded-address' command to prevent assignment of IP addresses that should remain static, such as those for router interfaces and critical network devices . Next, create a DHCP pool using the 'ip dhcp pool' command, specifying a network range for dynamic assignment and configuring necessary settings like default router and DNS server addresses . Finally, verify the setup with commands such as 'show ip dhcp binding' to ensure IP addresses are correctly assigned to clients .

Disabling DNS lookup is crucial to prevent unnecessary delays in command line interaction due to failed domain name resolutions. Configuring security settings like passwords for EXEC mode, console and vty lines, along with message-of-the-day banners, protects the router from unauthorized access by securing management interfaces and providing legal notices or warnings upon login, enhancing overall security posture .

The learning objectives for the DHCP and NAT configuration lab include preparing a network, performing basic router configurations, setting up a Cisco IOS DHCP server, configuring static and dynamic NAT, and implementing NAT overload. These objectives aim to provide hands-on experience in building and managing efficient network services essential for CCNA-level networking tasks .

NAT offers multiple benefits, including conservation of public IP addresses by allowing multiple devices to share a single external address. It enhances security by masking internal IP addresses from external networks, reducing direct exposure. NAT is flexible; static NAT provides persistent mappings for consistent external access, while dynamic NAT and NAT overload efficiently manage public IP use for numerous internal hosts, vital in scenarios with limited public IP resources .

NAT overload, unlike static and dynamic NAT, allows multiple internal clients to share a single public IP address by tracking port numbers, enabling multiple connections through a single IP . Static NAT maps a specific internal IP to a specific external IP, while dynamic NAT uses a pool of external IPs to map internal addresses. NAT overload uses a single external IP from an interface, with port numbers appended, allowing more users than the number of available external IPs in static or dynamic configurations .

Static routes are essential for directing traffic through predefined paths in a network, providing reliable connectivity and control over routing decisions without depending on dynamic routing protocols that may frequently update paths . For example, in the described scenario, static routes are necessary for the ISP to reach networks beyond R2, ensuring stable communication paths for external access and integration within the planned NAT setup .

The default route on R2, configured to 0.0.0.0 0.0.0.0 pointing to the ISP's interface IP 209.165.200.226, serves as the gateway of last resort, allowing R2 to direct packets outside the local network to external destinations . Propagation of this route in OSPF using the 'default-information originate' command ensures it is shared with other OSPF routers, such as R1, allowing them to dynamically learn the external connectivity path without a need for individual static route settings .

OSPF is configured with process ID 1 on both R1 and R2, designed to handle internal routing within specified areas by advertising network routes such as 192.168.10.0 and 192.168.11.0 for R1, and 10.1.1.0 on both R1 and R2. This setup ensures that both routers effectively share path information, enabling internal hosts to communicate efficiently without routing data to public networks, balancing network traffic load .

You might also like