How to configure DHCP Server on Cisco IOS

(Rene Molenaar) #1

This topic is to discuss the following lesson:

(Rene Molenaar) #2

Before you create the dhcp pool, you should configure the ip dhcp excluded-address command.

(Rene Molenaar) #3

That’s always a good idea.

(system) #4

How i can configure a fast-Ethernet interface to act as a DHCP client? and, is there any configuration we need to do apart from the configuration you have shown in DHCP server for that?

(Rene Molenaar) #5

Hi Rohan,

You can configure a FastEthernet interface to use DHCP client by using the “ip address dhcp” command under the interface.

That’s it…

Rene

(system) #6

thank you very good but i wanna to know Are the messages (discover,offer,request and ack ) still broadcast or change ?

(system) #7

thank ypu but i wanna to know ARE the messages (discover,offer,request and ack) still broadcast messages or change ?

(Rene Molenaar) #8

I have the wireshark capture here for DHCP, it will give you the answer: http://networklessons.com/network-services/introduction-to-dhcp/

(system) #9

is there command to make DHCP hold multiple IP for servers like example, and don;t share it with clients
i mean one command to hold many ip
thanks

(Rene Molenaar) #10

Do you mean how to configure DHCP to use the same IP address for some hosts?

(Barry B) #11

What would be the command to exclude a range of addresses?

(Rene Molenaar) #12

Hi Barry,

That would be “ip dhcp excluded-address”. This is a global configuration command, it’s not under the “ip dhcp pool” configuration.

Rene

(Hussein Samir) #13

Hi Rene

Can I create more than one dhcp server in the same router?
if I can how to do that and how to Verify every dhcp server and it’s client Separately?

(Rene Molenaar) #14

Hi Hussein,

You can create more than one DHCP pool, no problem at all. You can use “show ip dhcp pool” to see all configured DHCP pools.

Rene

(Hussein Samir) #15

Thanks Rene ,

If I need to modify the config of a specific DHCP server like change the defualt gateway or dns server etc, I will use “ip dhcp pool mypoolname” command to do that right? or there is something else?

(Rene Molenaar) #16

Hi Hussein,

That’s right, the subnet, DNS server, gateway and options are all configured under the pool.

The only exception are the excluded IP addresses, this is done in global mode:

R1(config)#ip dhcp excluded-address 192.168.1.1 192.168.1.100

Rene

(Hussein Samir) #17

Thank you very much Rene

(Hussein Samir) #18

Hi Rene ,

I have tow question:

1 - if I have 2 DHCP server in the same network or router and we learn when the host request
an IP address it will send DHCP discover message right, the question is, to message will
Receive to which DHCP server ?

2 - and can I create DHCP server in switch layer 2 ?

(Hussein Samir) #19

Hi Rene,

I try to create dhcp server in switch 2960 in packet tracer and it’s work normally
but I need to assigning an ip address to the vlan in order to function of dhcp server
My question is why i need to assigning this ip address ?

(Rene Molenaar) #20

Hi Hussein,

When you have two DHCP servers in the same subnet then the host will receive an IP address from whoever answers first. This can be dangerous btw, take a look here:

The 2950 or 2960 switches support DHCP server I believe but I would probably not use them for this as you can configure only one IP address on them (for management).

Rene