7.4.1 Basic DHCP y NAT Configuration PDF
7.4.1 Basic DHCP y NAT Configuration PDF
Topology Diagram
Addressing Table
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
• Configure NAT overload
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 1 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
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.
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 192.168.10.0/24 subnet starting with 192.168.10.1.
R1(dhcp-config)#network 192.168.10.0 255.255.255.0
Configure the default router and domain name server for the network. Clients receive these settings via
DHCP, along with an IP address.
R1(dhcp-config)#dns-server 192.168.11.5
R1(dhcp-config)#default-router 192.168.10.1
Note: There is not a DNS server at 192.168.11.5. You are configuring the command for practice only.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 2 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
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 0.0.0.0 0.0.0.0 209.165.200.226
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
(209.165.200.225). The pings should be successful. Troubleshoot if the pings fail.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 3 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
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 192.168.10.0 0.0.0.255 any
R2(config-std-nacl)#permit ip 192.168.11.0 0.0.0.255 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
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 4 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
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
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.
Step 1: Cable a network that is similar to the one in the topology diagram.
You can use any current router in your lab as long as it has the required interfaces shown in the topology.
Note: If you use a 1700, 2500, or 2600 series router, the router outputs and interface descriptions may
look different.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 5 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
Note: There is not a DNS server at 192.168.11.5. You are configuring the command for practice only.
Because devices from the network 192.168.11.0/24 also request addresses from R2, a separate pool
must be created to serve devices on that network. The commands are similar to the commands shown
above:
R2(config)#ip dhcp pool R1Fa1
R2(dhcp-config)#network 192.168.11.0 255.255.255.0
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 6 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
R2(dhcp-config)#dns-server 192.168.11.5
R2(dhcp-config)#default-router 192.168.11.1
The show ip dhcp pool command displays information on all currently configured DHCP pools on the
router. In this output, the pool R1Fa0 is configured on R1. One address has been leased from this pool.
The next client to request an address will receive 192.168.10.12.
R2#show ip dhcp pool
Pool R1Fa0 :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 254
Leased addresses : 1
Pending event : none
1 subnet is currently in the pool :
Current index IP address range Leased addresses
192.168.10.12 192.168.10.1 - 192.168.10.254 1
The debug ip dhcp server events command can be extremely useful when troubleshooting DHCP
leases with a Cisco IOS DHCP server. The following is the debug output on R1 after connecting a host.
Notice that the highlighted portion shows DHCP giving the client an address of 192.168.10.12 and mask
of 255.255.255.0
*Sep 13 21:04:18.072: DHCPD: Sending notification of DISCOVER:
*Sep 13 21:04:18.072: DHCPD: htype 1 chaddr 001c.57ec.0640
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 7 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
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
(209.165.200.226). The pings should be successful. Troubleshoot if the pings fail.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 8 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
Note: If using a simulated inside server, assign the ip nat inside command to the loopback interface.
Step 2. Create an extended access control list to identify which inside addresses are translated.
R2(config)#ip access-list extended NAT
R2(config-ext-nacl)#permit ip 192.168.10.0 0.0.0.255 any
R2(config-ext-nacl)#permit ip 192.168.11.0 0.0.0.255 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
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 9 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
To troubleshoot issues with NAT, you can use the debug ip nat command. Turn on NAT debugging and
repeat the ping from PC1.
R2#debug ip nat
IP NAT debugging is on
R2#
*Sep 13 21:15:02.215: NAT*: s=192.168.10.11->209.165.200.241, d=209.165.200.226 [25]
*Sep 13 21:15:02.231: NAT*: s=209.165.200.226, d=209.165.200.241->192.168.10.11 [25]
*Sep 13 21:15:02.247: NAT*: s=192.168.10.11->209.165.200.241, d=209.165.200.226 [26]
*Sep 13 21:15:02.263: NAT*: s=209.165.200.226, d=209.165.200.241->192.168.10.11 [26]
*Sep 13 21:15:02.275: NAT*: s=192.168.10.11->209.165.200.241, d=209.165.200.226 [27]
*Sep 13 21:15:02.291: NAT*: s=209.165.200.226, d=209.165.200.241->192.168.10.11 [27]
*Sep 13 21:15:02.307: NAT*: s=192.168.10.11->209.165.200.241, d=209.165.200.226 [28]
*Sep 13 21:15:02.323: NAT*: s=209.165.200.226, d=209.165.200.241->192.168.10.11 [28]
*Sep 13 21:15:02.335: NAT*: s=192.168.10.11->209.165.200.241, d=209.165.200.226 [29]
*Sep 13 21:15:02.351: NAT*: s=209.165.200.226, d=209.165.200.241->192.168.10.11 [29]
R2#
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 10 of 12
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 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
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.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 11 of 12
CCNA Exploration
Accessing the WAN: IP Addressing Services PT Activity 7.4.1: Basic DHCP and NAT Configuration
Task 9: Clean Up
Erase the configurations and reload the routers. Disconnect and store the cabling. For PC hosts that are
normally connected to other networks, such as the school LAN or the Internet, reconnect the appropriate
cabling and restore the TCP/IP settings.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 12 of 12