设为首页收藏本站language 语言切换
查看: 764|回复: 2
收起左侧

[分享] CCNA Lab 118: Configuring DHCP on Router

[复制链接]
 成长值: 63715
发表于 2024-12-6 19:13:41 | 显示全部楼层 |阅读模式
本帖最后由 小乔 于 2024-12-6 19:20 编辑

DHCP stands for Dynamic Host Configuration Protocol. It is a service which allows you to configure TCP/ IP settings such as IP address and subnet mask on the clients (PC, laptop, printer, etc.) automatically. Typically, DHCP is configured on a dedicated server for better performance. The server can be either Windows-based or Linux-based.

To perform this exercise, we will use the following topology.



First, add the required devices in Cico Packet Tracer and connect them appropriatley. In the preceding topology, Router1 will act as DHCP server while Router2 and PC1 will act as DCHP clients. Let’s begin the exercise.

1.  On Router1, execute the following commands to configure an IP address.

Router( config)# int fa0/ 0
Router( config-if)# ip add 10.0.0.1 255.0.0.0
Router( config-if)# no shut
2.  Next, create a DHCP pool named DhcpPool1. Use 10.0.0.1 IP address as the default gateway and DNS server. Use 10.0.0.0 255.0.0.0 as network ID.

Router( config)# ip dhcp pool DhcpPool1
Router( dhcp-config)# default-router 10.0.0.1
Router( dhcp-config)# dns-server 10.0.0.1
Router( dhcp-config)# network 10.0.0.0 255.0.0.0
Router( dhcp-config)# exit
By default DHCP server will start to assign IP addresses from the first IP address of the assigned network ID and it will be 10.0.0.1/ 8. However, we have already configured this IP addresses manually on Fa0/ 0 interface of Router1. To avoid the confliction between DHCP assigned and manually assigned IP addresses, you can exclude one or more specific IP addresses or IP ranges from the DHCP pool. DHCP server will not distribute these IP addresses to any of the DHCP client.

3.  The following commands will exclude 10.0.0.0.1 to 10.0.0.100 IP addresses that will not be distributed by DHCP server.

Router( config)# ip dhcp excluded-address 10.0.0.1 10.0.0.100
Router( config)# exit


4.  On Router2, we will assign an IPv4 address on the Fa0/ 0 interface through the DHCP server. To do this, execute the following commands.

Router( config)# int fa0/ 0
Router( config-if)# ip add dhcp
Router( config-if)# no shut
5.  Wait for a few seconds and then execute the following command to view the IP address on Router2.

Router2# show ip int brief
or

Router2( config)# do show ip int brief
Note: Adding the do command before the show command allows you to execute privilege mode commands from the global configuration mode.



.

7.  After a few seconds, DHCP server will assign an IP address from the configured DHCP pool along with a default gateway and DNS server IP addresses.



8.  In the preceding figure, you can see that 10.0.0.102 IP address has been assigned by the DHCP server.

9.  To verify the connectivity between PC1 and Router1, execute the following command at the Command Prompt window.

Ping 10.0.0.1
10.  You should be able to ping successfully, as shown in the following figure.


11. Save the configuration of each device and also save the topology and name is as DHCP Topology.



来源:CCNA  Lab 114: Route Redistribution between OSPF and EIGRP
来源: Lab 115: Implementing IPv6 Addressing
来源: Lab 116: Configuring RIP for IPv6 (RIPng)

来源: CCNA Lab 117: Configuring EIGRP for IPv6 (EIGRPv6)
您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-2-23 13:16 , Processed in 0.066242 second(s), 23 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表