• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 542
  • Last Modified:

dhcp default router on Cisco router

This is the scenario:

R1 <-->R2<-->sw1<-->client

I have R1 as the DHCP server but I am not sure what the default-router IP address should be.

This is what I have so far?
ip dhcp pool MYPOOL
 network 192.168.1.0 255.255.255.0
 default-router ????

Thanks
0
leblanc
Asked:
leblanc
  • 10
  • 5
  • 3
  • +2
10 Solutions
 
InfamusCommented:
Who is getting IPs from DHCP?
0
 
Nick RhodeIT DirectorCommented:
Whatever you want really.  In General for home I stick with these IPs

192.168.1.0
172.120.1.0

Businesses I usually use

10.0.0.0
0
 
InfamusCommented:
Okay, let me give you an example.


              R1   --------------------------------  R2 ---------------------- SW ------------------------------ Client
10.1.1.1    192.168.1.1      192.168.1.2  172.20.1.1             DHCP                           172.20.1.x/24


So if you want to setup for DHCP for Client, you would setup DHCP on the switch and the default gateway should be 172.20.1.1.

Make sense?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
RKnebel512Commented:
The way you have this written above, R1 <-->R2<-->sw1<-->client, it looks like R2 is going to be on the same network as the client, so you will need to put in the IP address of R2.  Common best practice is to use either the first or last address in a domain as the default router, so I would make the R2 address either 192.168.1.1 or 192.168.1.254.  There is no benefit to choosing either one; it is just personal preference.

Whatever you use, make sure the address on the R2 interface that plugs into sw1 has the same address.

You will also need to type in the "ip dhcp excluded-address [address]" command on R1 to make sure default router address is not handed out to any DHCP clients.

The way you have it set up here, you will also have to set up DHCP relay agent on R2 to make sure that the client's address requests make it all the way to R1.  To do this, you need to configure the interface on R2 that connects to sw1 with the following command:  "ip helper-address [address]"  For the address, type in the address of R1 so R2 knows where to send the client's requests.
0
 
InfamusCommented:
@RKnebel512,

R2 should have WAN and LAN interface and the LAN interface should have Client IP subnet.

I was in the assumption that the SW is layer 2.

If it is layer 3 then we can configure routed port and we can put client in a different subnet.

It would make more sense to have DHCP configured on R2 or the Switch and in this case, Switch is the best option.

And you are right about the ip dhcp excluded-address, definately have to configure it.
0
 
leblancAccountingAuthor Commented:
I know that I can have my dhcp server on R2. But to test my understanding, I want to implement dhcp server on R1. The DHCP is for the client.

Let me take your fiction setup:
             R1   ------------------------------  R2 ---------------------- SW ---------- Client
10.1.1.1    192.168.1.1      192.168.1.2     172.20.1.1                          192.168.20.x/24 (DHCP)

R1 is doing DHCP with network as 192.168.20.0/24
Will my default-router be 172.20.1.1?

PS. I know that I need ip helper-address 192.168.1.1 on R2
0
 
RKnebel512Commented:
@Infamus

I'm under the assumption that sw1 is layer 2 as well. So on the model, the right side interface of R2 (LAN) will be on the same subnet as the client.  This is the interface that needs the default router address.

R1 <-->R2<-->sw1<-->client

The left side interface on R2 (WAN) will have an address on the same subnet as the right side interface of R1 (WAN).

I agree that DHCP would probably be best configured on R2, or the switch in most topologies.
0
 
InfamusCommented:
You are correct RKnebel512.
0
 
RKnebel512Commented:
Okay, I didn't see the addresses previously. There will need to be a slight change to your addresses.  R2, would need to be on the same subnet as Client so I would give it 192.168.20.254

             R1   ----------------------------------  R2 --------------------------- SW ---------- Client
10.1.1.1    192.168.1.1      192.168.1.2     192.168.20.254                          192.168.20.x/24 (DHCP)

That is the address that should be in the default router command.
0
 
InfamusCommented:
@pitachip

If you configure DHCP on R1, what if it goes down?  None of the PC will have network connection since they don't have any IP's.

If you configure DHCP on the switch and the switch goes down, you won't have network connection any ways because switch is down.

The best practice here will be setting up DHCP on the switch which is the closest hop to the client.
0
 
InfamusCommented:
The IP's I provided was just a sample to understand the network.

You can use any subnet that meets your requirement.
0
 
vivigattCommented:
A default gateway must be in the same subnet as the client.
If the DHCP server is not in the same subnet as the client, you need to configure a DHCP Relay (ip helper-address in Cisco wording) for the DHCP DISCOVER packets (sent by clients to local broadcast) to be forwarded to the DHCP server. When forwarded, these packets will be modified: unicast to DHCP server, with GIADDR field (Gateway Ip ADDRess) set to the address of the DHCP relay. When receiving such a forwarded packet, the DHCP server matches the GIADDR subnet to one of its scopes and assigns an IP address in said scope.

More details in Wikipedia's article about DHCP, especially:
http://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol#DHCP_relaying
0
 
leblancAccountingAuthor Commented:
I just talked to my admin network and the attached diagram is what we want to accomplish. We are not sure how to accomplish it with the link between R1 and L3 switch as a routed link.

The 3750 L3 switch cannot be a dhcp server.

Thanks
net-diagram.JPG
0
 
InfamusCommented:
Your 2960 can be configured as dhcp server and i've done that before.
0
 
InfamusCommented:
If you really want to setup DHCP on R1, you can set it up.

The default gateway should be 192.168.10.1 which is your vlan 10 interface IP on 3560.

On 3560, you have to add ip helper as 10.10.10.2 on your vlan 10. (Assuming 3560 is VTP server)

Let me know if you need the full configuration.
0
 
leblancAccountingAuthor Commented:
We talked to Cisco and they say the 2960 does not support DHCP. They say even though you can use DHCP, they don't recommend it. But I may consider though.

We do not use VTP. Everything is in transparent mode. Thanks
0
 
InfamusCommented:
Well, they are wrong...

I have more than 5 2960 that is serving as DHCP server, maybe it is depend on what license you have on it.

If you have all transparent, you have to configure IP helper-address on each vlan interface.

Since your R1 is the DHCP server, the IP helper-address should be 10.10.10.2.
0
 
leblancAccountingAuthor Commented:
I will try to configure it on the 2960. But I will make the other DHCP works first. I just want to make sure that I have several options to choose from.

I will test the first dhcp scenario tomorrow.

Thank you for your help.
0
 
InfamusCommented:
Let me know how it went or if you need the configs.
0
 
leblancAccountingAuthor Commented:
it works on the 2960S
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 10
  • 5
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now