Solved

dhcp default router on Cisco router

Posted on 2013-11-20
20
522 Views
Last Modified: 2014-04-08
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
Comment
Question by:leblanc
  • 10
  • 5
  • 3
  • +2
20 Comments
 
LVL 12

Expert Comment

by:Infamus
ID: 39663052
Who is getting IPs from DHCP?
0
 
LVL 22

Expert Comment

by:Nick Rhode
ID: 39663065
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
 
LVL 12

Accepted Solution

by:
Infamus earned 300 total points
ID: 39663143
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
 
LVL 3

Assisted Solution

by:RKnebel512
RKnebel512 earned 150 total points
ID: 39663181
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
 
LVL 12

Assisted Solution

by:Infamus
Infamus earned 300 total points
ID: 39663221
@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
 
LVL 1

Author Comment

by:leblanc
ID: 39663277
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
 
LVL 3

Assisted Solution

by:RKnebel512
RKnebel512 earned 150 total points
ID: 39663281
@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
 
LVL 12

Expert Comment

by:Infamus
ID: 39663292
You are correct RKnebel512.
0
 
LVL 3

Assisted Solution

by:RKnebel512
RKnebel512 earned 150 total points
ID: 39663293
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
 
LVL 12

Assisted Solution

by:Infamus
Infamus earned 300 total points
ID: 39663298
@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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 12

Expert Comment

by:Infamus
ID: 39663302
The IP's I provided was just a sample to understand the network.

You can use any subnet that meets your requirement.
0
 
LVL 16

Assisted Solution

by:vivigatt
vivigatt earned 50 total points
ID: 39665801
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
 
LVL 1

Author Comment

by:leblanc
ID: 39665827
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
 
LVL 12

Assisted Solution

by:Infamus
Infamus earned 300 total points
ID: 39665863
Your 2960 can be configured as dhcp server and i've done that before.
0
 
LVL 12

Assisted Solution

by:Infamus
Infamus earned 300 total points
ID: 39665902
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
 
LVL 1

Author Comment

by:leblanc
ID: 39665922
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
 
LVL 12

Assisted Solution

by:Infamus
Infamus earned 300 total points
ID: 39666041
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
 
LVL 1

Author Comment

by:leblanc
ID: 39666089
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
 
LVL 12

Expert Comment

by:Infamus
ID: 39666119
Let me know how it went or if you need the configs.
0
 
LVL 1

Author Comment

by:leblanc
ID: 39700072
it works on the 2960S
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Don’t let your business fall victim to the coming apocalypse – use our Survival Guide for the Fax Apocalypse to identify the risks and signs of zombie fax activities at your business.
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now