DHCP RELAY ADDRESS Guru Time!!!
mikeybinec
Member Posts: 484 ■■■□□□□□□□
in CCNA & CCENT
A few days ago, somebody posted a question about the ip helper-address command when a dhcp server is in
a different domain. And I opined I can't figure out how it would work since theory tells us that routers do not
forward broadcasts; and the dhcp server is in a different subnet. The gurus all responded with the theory behind the dhcp relay.
With that said, I wired up a basic LAN with 26XX routers and a 2960 switch and I can't get the client to obtain an address. To represent it, I have simulated it in Packet Tracer and still no go. So if anybody has a working dhcp relay lab, I'd like to see it. All the books tell us what to do, but I have'nt seen it in real life. I still think one needs to config a static route to the dhcp sever if it's on a different subnet. Lammle and Graziani present the theory. Funny, Odom doesnt even talk about it.
Here is my PT simulation with the configs
Thanks
a different domain. And I opined I can't figure out how it would work since theory tells us that routers do not
forward broadcasts; and the dhcp server is in a different subnet. The gurus all responded with the theory behind the dhcp relay.
With that said, I wired up a basic LAN with 26XX routers and a 2960 switch and I can't get the client to obtain an address. To represent it, I have simulated it in Packet Tracer and still no go. So if anybody has a working dhcp relay lab, I'd like to see it. All the books tell us what to do, but I have'nt seen it in real life. I still think one needs to config a static route to the dhcp sever if it's on a different subnet. Lammle and Graziani present the theory. Funny, Odom doesnt even talk about it.
Here is my PT simulation with the configs
Thanks
Cisco NetAcad Cuyamaca College
A.S. LAN Management 2010 Grossmont College
B.S. I.T. Management 2013 National University
A.S. LAN Management 2010 Grossmont College
B.S. I.T. Management 2013 National University
Comments
-
xnx Member Posts: 464 ■■■□□□□□□□Wouldn't the default router of the DHCP scope be 10.0.0.2 instead of 10.0.0.1 as the swich which has the clients connected to it is itself conntected to 10.0.0.2??
Obviously the routers should have routes to each other so maybe it won't make a difference..Getting There ...
Lab Equipment: Using Cisco CSRs and 4 Switches currently -
davenull Member Posts: 173 ■■■□□□□□□□As far as I can tell, the client sits in the 192.168.1.0/24 network, so I believe it should receive an address from that pool. I think this should work:
ip dhcp excluded-address 192.168.1.1
ip dhcp pool LAN
default router 192.168.1.1
network 192.168.1.0 255.255.255.0 -
Ltat42a Member Posts: 587 ■■■□□□□□□□You'll probably need a routing protocol or a default route configured.
-
Jon_Cisco Member Posts: 1,772 ■■■■■■■■□□I think I used different interfaces but this worked.
Router#show run
!
hostname Router 0
!
ip dhcp excluded-address 192.168.1.1 192.168.1.5
!
ip dhcp pool LAN
network 192.168.1.0 255.255.255.0
default-router 10.0.0.1
!
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.248
duplex auto
speed auto
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 10.0.0.0 0.255.255.255 area 0
default-information originate
Router#show run
hostname Router 1
interface FastEthernet0/0
ip address 10.0.0.2 255.255.255.248
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.1.1 255.255.255.0
ip helper-address 10.0.0.1
duplex auto
speed auto
router ospf 1
log-adjacency-changes
network 10.0.0.0 0.255.255.255 area 0
network 192.168.1.0 0.0.0.255 area 0
! -
mikeybinec Member Posts: 484 ■■■□□□□□□□Unfortunately, this is a bad picture. But this is straight out of Lammle's book, version 7, page 292.. The fa0/0 has a Class C ip address. You also put the ip helper-address on int fa0/0. On int fa0/1 LAN, is the dhcp server of 10.10.10.254.
Theory sez, one types in the ip helper-address command on the interface closest to the client.
If anybody has the Lammle book, maybe they can verify this config for me (obviously, I changed the Class A address)
thanksCisco NetAcad Cuyamaca College
A.S. LAN Management 2010 Grossmont College
B.S. I.T. Management 2013 National University -
Jon_Cisco Member Posts: 1,772 ■■■■■■■■□□I don't have Lammle's book so I can't look at the page in question. Are still trying to figure out the original post or is this a new question?
Let us know which part is not working for you and possibly we could help you from there.
Have you been able to configure and route with static IP addresses?
Have you adjusted your config so the LAN pool includes addresses for the correct network?
The commands that I posted above came directly from a working packet tracer file. The address pool was incorrect in your original post and the configuration requires routing to return the DHCP address to the host. -
mikeybinec Member Posts: 484 ■■■□□□□□□□I don't have Lammle's book so I can't look at the page in question. Are still trying to figure out the original post or is this a new question?
Let us know which part is not working for you and possibly we could help you from there.
Have you been able to configure and route with static IP addresses?
Have you adjusted your config so the LAN pool includes addresses for the correct network?
The commands that I posted above came directly from a working packet tracer file. The address pool was incorrect in your original post and the configuration requires routing to return the DHCP address to the host.
Somebody out there has to have Lammle. And if they go to page 292, they will verify the theory that one puts the ip helper-address on the interface closest to the client looking for a dhcp address. In fact here's another source. This is from Graziani, and he writes for Cisco Press. His book is Accessing The WAN, and it is used in Cisco's NetAcad
Here is the theory: Routers do not forward broadcasts. the client in the 192.168.10.0 subnet is looking for an IP address from a dhcp server. It cant find one. The solution? Use the IP HELPER-ADDRESS and point towards a dhcp server
So here we see that the ip ;helper address is put on the interface CLOSEST to the client. It points to a different subnet (192.168.11.5) and this command ALLOWS broadcasts from routers so a client can do a DORA (discover, offer, request, ACK) for an IP address.
So my original is not working. And thus my question to the gurus. Maybe they can explain what's going on. Mayber only dedicated DHCP servers can be used and not routers. I just dont know. But there is nothing wrong with my configs in the original setup
RegardsCisco NetAcad Cuyamaca College
A.S. LAN Management 2010 Grossmont College
B.S. I.T. Management 2013 National University -
rocdamike Member Posts: 32 ■■□□□□□□□□Hey guys,
I have Lammle's book and have posted the image from the book below with annotations. Please let me know if you need me to explain further. One of the key things I find is to always make sure that on the host you open a command prompt and enter ipconfig /renew to force the host to send out a DHCP discover message. Give me a few minutes. I will try and see if I can get the setup in your first post to work.
-
rocdamike Member Posts: 32 ■■□□□□□□□□Here is the setup from your first post which I got to work. I had to change the IP address pool on the router due to the fact that as far as I am aware, the IP pool that you assign to the host must be in the same subnet as the default gateway of that host.
-
Jon_Cisco Member Posts: 1,772 ■■■■■■■■□□I think I used different interfaces but this worked.
Router#show run
!
hostname Router 0
!
I think the first line of my post might be where the confusion it. I made a packet tracer to match your example but I picked random interfaces for the connections.
interface FastEthernet0/1
ip address 192.168.1.1 255.255.255.0
ip helper-address 10.0.0.1
duplex auto
speed auto
This interface on my file was actually facing towards the switch and the lan that required the address from DHCP. I am sorry if this caused any confusion. I think the problem has to do with your LAN POOL.
Good Luck! -
mikeybinec Member Posts: 484 ■■■□□□□□□□@rocdamike.. If we change the parameters, yeah, we can make anything work. But here it is that we have two so-called tech savvy authors and their explanations of the theory is all fine and dandy but in real life it doesnt work!!! THAT'S AMAZING TO ME!!
So we go back to my OP and that's why I called on the Gurus to comment. And basically they took a swipe but none could explain why. I'm gonna guess that DHCP relay is extremely rare, if even used at all. I gotta talk to GrazianiCisco NetAcad Cuyamaca College
A.S. LAN Management 2010 Grossmont College
B.S. I.T. Management 2013 National University -
DCD Member Posts: 475 ■■■■□□□□□□For augment sake put a static ip address on the PC and see if you can get to both side of router 1. If that goes well then like Joe_Cisco do a 192.168.1.x DHCP pool and the default route is 192.168.1.1. Then either add a default Router 0 point to Router 1 or use a routing protocol.
For the helper address to work a DHCP in the same scope must exist. Also you change the parameters of Lammel's demo. And you should add the show run commands from both routers and a Show ip interface brief from them as well. -
cpartin Member Posts: 84 ■■□□□□□□□□Mikey, sorry to be a little harsh but the reason that your original config isn't working is because it's just wrong. Your DHCP pool is wrong. As Davenull and Jon_Cisco have both pointed out the DHCP clients sit on the 192.168.1.0/24 subnet, but in your pool config you're trying to give them an address in 10.0.0.0/29.
Using your config, think about what's going to happen if PC0 gets the address 10.0.0.6 (which btw is the only one you left available) and tries to send traffic to its default router (10.0.0.1). PC0 is going to ARP for 10.0.0.1, which isn't on that ethernet segment. That request will never get answered (unless you set up proxy arp - another can of worms). The ip helper address only works for certain broadcasts, it's not going to route regular traffic for you.
DHCP relay isn't rare at all. We use it in our network to forward DHCP requests back to Windows based DHCP servers. Centrally managed DHCP scopes make things a lot more convenient. -
luberguilarte Member Posts: 112Ip helper address does not meant it will allow dhcp broadcast traffic to a different subnet, it just convert that dhcp broadcast request as a unicast packet to be forward to the subnet where the scope was created. That's the concept.
-
davenull Member Posts: 173 ■■■□□□□□□□Like cpartin said, your configuration had some fundamental problems. I labbed out the solution I gave you in the 3rd post here and it worked like a charm, just had to add a static route to point Router0 to 192.168.1.0/24 network:
Edit:
Food for thought:
Assuming a dhcp server gives out ip addresses to hosts in several networks and, thus, has several dhcp pools configured, how does it know from which dhcp pool to draw addresses to which hosts?
I think I know the answer, but whoever gets it first, gets a cookie. -
rocdamike Member Posts: 32 ■■□□□□□□□□As a guess, I think it judges it by looking at the router interface's IP address that is facing towards the host. Any hosts that are connected off that interface (directly or indirectly e.g. via a switch) will be assigned an IP address from the pool which contains addresses in the same subnet as that router's interface.
-
davenull Member Posts: 173 ■■■□□□□□□□As a guess, I think it judges it by looking at the router interface's IP address that is facing towards the host. Any hosts that are connected off that interface (directly or indirectly e.g. via a switch) will be assigned an IP address from the pool which contains addresses in the same subnet as that router's interface.
Just to clarify, the router with the dhcp service enabled can be several networks away from the network that it is servicing. In this case, it looks at the source ip address of the dhcp request which happens to be the ip address of the 'ip helper'.