Configuring DHCP

shaifshahinshaifshahin Member Posts: 5 ■□□□□□□□□□
Can anyone explain me how to configure DHCP. I tried base on this screenshot below. this is from Tod Lammed Book

https://www.dropbox.com/s/x4brrshy6xjkvsy/DHCP.png

Comments

  • davenulldavenull Member Posts: 173 ■■■□□□□□□□
    The image shows the ip helper setup where the dhcp server is not on the same network as dhcp clients. Have you configured DHCP without ip helper yet? What is the problem exactly?
  • shaifshahinshaifshahin Member Posts: 5 ■□□□□□□□□□
    no i did not configured DHCP without ip helper address
  • rocdamikerocdamike Member Posts: 32 ■■□□□□□□□□
    Based on the screenshot you have provided, you have the DHCP server on different network (which is fine). I assume you're using Packet Tracer for this. Here's what you need to do:

    1. On the DHCP server, set the static IP (10.10.10.254), mask and gateway. Then enable the DHCP service on the server and setup the pool

    2. On the router's Fa0/0 interface, use ip helper-address 10.10.10.254 (this is the IP address of your DHCP server)

    3. On the PC, open a command prompt and do an ipconfig /release followed by an ipconfig /renew


    The PC should then acquire a new IP address from the DHCP server
  • VinnyCiscoVinnyCisco Member Posts: 176
    With that Network diagram, that would be wrong. In this particular instance, the IP Helper address needs to be set on the Fa 0/1 interface which is receiving the request to be handed off to the Fa0/0 interface on the different network. (Please look at my screen shots below for setup.) This is one of the reasons I get mad at the diagrams in these study guides as they do not include complete info and they get it wrong.

    Shaif:

    The diagram is missing info. First, you need to make sure that you have an IP Address set on the Fa 0/0 int. Since the server is on the 10.10.10.0 /24 network, you need to configure the interface on R1 with an ip address of 10.10.10.1 255.255.255.0 assuming that the DHCP Server has that set as its default gateway. Then on your Fa0/1 interface, set the ip address of 192.168.10.1 255.255.255.0. ALSO, you need to set the IP helper-address 10.10.10.254 command on Fa 0/1 as well. Please look at screenshots below for config and verification that it worked.

    Config for R1 interfaces:


    GNS3 Diagram and PC Client getting IP Address and Pinging Server on different network:


    Below is the actual screenshot of the DEBUG IP DHCP SERVER PACKET command on R1. This shows how the hand off takes place and how it is forwarded.
    "Failure is the prerequisite of Success" - V. G.
  • rocdamikerocdamike Member Posts: 32 ■■□□□□□□□□
    The diagram isn't as clear as it should have been. When I looked at it, I thought interface fa0/0 was the one with IP address 192.168.10.1 (the link between the router and the switch). And therefore, fa0/1 would be the router's interface connected to the DHCP server. In any case, you need to make sure that the IP helper-address is configured on the router's interface which is facing the switch. VinnyCisco did a good job explaining it.
  • VinnyCiscoVinnyCisco Member Posts: 176
    Yup yup. In the end, the diagram is wrong/missing info. The "arrows" in the diagram is what really puts the confusion into play. And how Lammle could leave an IP Address out of that interface leading to the DHCP server is mind boggling. I hope this works out for Shaif.

    Those study guides are laced with mistakes at times. I actually had to correct 4 of his labs in the book because Lammle was not using the correct interfaces or was leaving out important info. Or maybe that was his intention to get people to learn?? Who knows. :)
    "Failure is the prerequisite of Success" - V. G.
  • DeathmageDeathmage Banned Posts: 2,496
    VinnyCisco wrote: »
    With that Network diagram, that would be wrong. In this particular instance, the IP Helper address needs to be set on the Fa 0/1 interface which is receiving the request to be handed off to the Fa0/0 interface on the different network. (Please look at my screen shots below for setup.) This is one of the reasons I get mad at the diagrams in these study guides as they do not include complete info and they get it wrong.

    Shaif:

    The diagram is missing info. First, you need to make sure that you have an IP Address set on the Fa 0/0 int. Since the server is on the 10.10.10.0 /24 network, you need to configure the interface on R1 with an ip address of 10.10.10.1 255.255.255.0 assuming that the DHCP Server has that set as its default gateway. Then on your Fa0/1 interface, set the ip address of 192.168.10.1 255.255.255.0. ALSO, you need to set the IP helper-address 10.10.10.254 command on Fa 0/1 as well. Please look at screenshots below for config and verification that it worked.

    Config for R1 interfaces:


    GNS3 Diagram and PC Client getting IP Address and Pinging Server on different network:


    Below is the actual screenshot of the DEBUG IP DHCP SERVER PACKET command on R1. This shows how the hand off takes place and how it is forwarded.

    not sure if this is a typo but shouldn't the Fa0/0 and fa0/1 reference on the router be flipped?

    "First, you need to make sure that you have an IP Address set on the Fa 0/0 int. Since the server is on the 10.10.10.0 /24 network, you need to configure the interface on R1 with an ip address of 10.10.10.1 255.255.255.0 assuming that the DHCP Server has that set as its default gateway. Then on your Fa0/1 interface, set the ip address of 192.168.10.1 255.255.255.0."

    if fa0/1 is set as 192.168.10.1 255.255.255.0 it would be on the subnet with the dhcp server. I mean i could also be ready the diagram wrong, lol.

    .... following the diagram, the 0/0 and 0/1 should be flipped, aye?
  • shaifshahinshaifshahin Member Posts: 5 ■□□□□□□□□□
    Thank you for your help
  • saraanandsaraanand Member Posts: 16 ■□□□□□□□□□
    So, while not caring about the errors in the diagram, this is how the router does the forwarding

    1. The broadcast discover message from the client is converted to a unicast by the relay agent and is sent to the unicast destination of the DHCP server
    2. The IP helper-address command is the IP address of the DHCP server, which is issued on the receiving interface of the relay agent facing DHCP client.
    3. The DHCP relay router inserts its own interface IP address (the one it received the request on from the client) in the GIADDR field. This is how the DHCP server knows from which pool to allocate the IP address from.
  • VinnyCiscoVinnyCisco Member Posts: 176
    Deathmage: Look at my diagram. I switched the interfaces to a more "Best Practice" scenario because info was left out of the original diagram. Where you want to apply your Ip's on whatever interface is a personal preference, or based on best practice. In this diagram, I changed the interfaces because A) an IP address was left out on the interface pointing to the 10.X.X.X network, and B)If I were to use this diagram as a an actual layout, I would have my Fa0/0 pointing to 10.X.X.X network and have the Fa0/1 pointing to the LAN.I could have made it simple and just added the IP to the open interface, but I am trying to teach best practice as well. In the end, it don't matter which one you use, as long as the 10.X.X.X sub is on the interface leading to the DHCP.
    "Failure is the prerequisite of Success" - V. G.
  • DeathmageDeathmage Banned Posts: 2,496
    VinnyCisco wrote: »
    Deathmage: Look at my diagram. I switched the interfaces to a more "Best Practice" scenario because info was left out of the original diagram. Where you want to apply your Ip's on whatever interface is a personal preference, or based on best practice. In this diagram, I changed the interfaces because A) an IP address was left out on the interface pointing to the 10.X.X.X network, and B)If I were to use this diagram as a an actual layout, I would have my Fa0/0 pointing to 10.X.X.X network and have the Fa0/1 pointing to the LAN.I could have made it simple and just added the IP to the open interface, but I am trying to teach best practice as well. In the end, it don't matter which one you use, as long as the 10.X.X.X sub is on the interface leading to the DHCP.

    Doh! - didn't see that diagram! (foot in mouth)
  • mikeybinecmikeybinec Member Posts: 484 ■■■□□□□□□□
    The only thing I can't understand in ip helper address is if the dhcp server is obviously on a different subnet, how does the client find it unless there is a static route pointing to it?

    Do I make sense?
    Cisco NetAcad Cuyamaca College
    A.S. LAN Management 2010 Grossmont College
    B.S. I.T. Management 2013 National University
  • rocdamikerocdamike Member Posts: 32 ■■□□□□□□□□
    mikeybinec wrote: »
    The only thing I can't understand in ip helper address is if the dhcp server is obviously on a different subnet, how does the client find it unless there is a static route pointing to it?

    Do I make sense?

    Remember, the router knows about all directly connected networks automatically. So taking the example diagram by VinnyCisco, R1 has the 10.10.10.0 /24 network directly connected to it (interface fa0/0 has an IP of 10.10.10.1), so in this case it's able to forward DHCP requests to the DHCP server on that network. Now, if R1 was connected to another router with the DHCP server connected on one of its interfaces, then you would need to use static routing or configure a dynamic routing protocol in order for it to work.
  • davenulldavenull Member Posts: 173 ■■■□□□□□□□
    mikeybinec wrote: »
    The only thing I can't understand in ip helper address is if the dhcp server is obviously on a different subnet, how does the client find it unless there is a static route pointing to it?

    Do I make sense?

    The client sends a DHCP Discover packet which is a broadcast. The router with the ip helper sees that it's a dhcp packet and passes the packet along to the DHCP server. The router just acts as a middleman in this case. I don't think the client even realizes that the actual DHCP server is not on the same subnet.
  • saraanandsaraanand Member Posts: 16 ■□□□□□□□□□
    Its transparent to the client. That's why the router with the IP helper address is known as DHCP relay agent.
  • shaifshahinshaifshahin Member Posts: 5 ■□□□□□□□□□


    https://dl.dropboxusercontent.com/u/16583931/Hands On Lab 7.pkt

    can i use DHCP for PC7 with 192.168.10.0 network

    i saw this command in Tod Book, what's the use of it
    cmd.png
Sign In or Register to comment.