3

Let us say that we have R01, R02, and R03 connected to each other, and each of them is connected to a different subnet SUB01, SUB02, and SUB03, respectively. R03 is set up as a DHCP server, and DHCP works fine for the workstation in its own subnet. Now we setup R01 and R02 with an IP helper-addresses of R03, where each is connected. Assuming all configurations are correct. Do we need to configure routing protocols or not for the DHCP and DHCP relay to do their magic? or should they work just fine with these configurations?

UPDATE (28APR2023):

Here is an example of the situation in question with all running configs for the three routers, along with routing tables. Also, Here is a link to the Packet Tracer file.

![![enter image description here

R01(config)#do sh run
Building configuration...

Current configuration : 787 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R01
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX1524X850-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
 ip address 192.168.0.30 255.255.255.224
 ip helper-address 192.168.0.254
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 192.168.0.126 255.255.255.224
 duplex auto
 speed auto
!
interface GigabitEthernet0/2
 ip address 192.168.0.253 255.255.255.224
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end


----------------------


R01(config)#do sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     192.168.0.0/24 is variably subnetted, 6 subnets, 2 masks
C       192.168.0.0/27 is directly connected, GigabitEthernet0/0
L       192.168.0.30/32 is directly connected, GigabitEthernet0/0
C       192.168.0.96/27 is directly connected, GigabitEthernet0/1
L       192.168.0.126/32 is directly connected, GigabitEthernet0/1
C       192.168.0.224/27 is directly connected, GigabitEthernet0/2
L       192.168.0.253/32 is directly connected, GigabitEthernet0/2

========================

R02(config)#do sh run
Building configuration...

Current configuration : 787 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R02
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX1524U1U3-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
 ip address 192.168.0.62 255.255.255.224
 ip helper-address 192.168.0.189
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 192.168.0.125 255.255.255.224
 duplex auto
 speed auto
!
interface GigabitEthernet0/2
 ip address 192.168.0.190 255.255.255.224
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end


----------------------


R02(config)#do sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     192.168.0.0/24 is variably subnetted, 6 subnets, 2 masks
C       192.168.0.32/27 is directly connected, GigabitEthernet0/0
L       192.168.0.62/32 is directly connected, GigabitEthernet0/0
C       192.168.0.96/27 is directly connected, GigabitEthernet0/1
L       192.168.0.125/32 is directly connected, GigabitEthernet0/1
C       192.168.0.160/27 is directly connected, GigabitEthernet0/2
L       192.168.0.190/32 is directly connected, GigabitEthernet0/2

============================

R03(config)#do sh run
Building configuration...

Current configuration : 1125 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R03
!
!
!
!
ip dhcp excluded-address 192.168.0.30
ip dhcp excluded-address 192.168.0.62
ip dhcp excluded-address 192.168.0.94
!
ip dhcp pool SUB01
 network 192.168.0.0 255.255.255.224
 default-router 192.168.0.30
ip dhcp pool SUB02
 network 192.168.0.32 255.255.255.224
 default-router 192.168.0.62
ip dhcp pool SUB03
 network 192.168.0.64 255.255.255.224
 default-router 192.168.0.94
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX15244VUL-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
 ip address 192.168.0.94 255.255.255.224
 duplex auto
 speed auto
!
interface GigabitEthernet0/1
 ip address 192.168.0.254 255.255.255.224
 duplex auto
 speed auto
!
interface GigabitEthernet0/2
 ip address 192.168.0.189 255.255.255.224
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end



----------


 
    
R03(config)#do sh ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     192.168.0.0/24 is variably subnetted, 6 subnets, 2 masks
C       192.168.0.64/27 is directly connected, GigabitEthernet0/0
L       192.168.0.94/32 is directly connected, GigabitEthernet0/0
C       192.168.0.160/27 is directly connected, GigabitEthernet0/2
L       192.168.0.189/32 is directly connected, GigabitEthernet0/2
C       192.168.0.224/27 is directly connected, GigabitEthernet0/1
L       192.168.0.254/32 is directly connected, GigabitEthernet0/1



=====================
0

1 Answer 1

6

Routers need to know how to reach networks in order to send packets to those networks. DHCP relay is sending packets to other networks. Routers learn routes in three ways:

  • Directly connected networks
  • Statically configured routes
  • Dynamic routes from routing protocols

Because the R1 and R2 networks are not directly connected to R3, R3 will either need statically configured routes point to the respective R1 and R2 routers, or all three routers will need to run a common routing protocol to exchange routing information.

Routers route packets based on what is in their routing tables. Routing protocols do not route packets, they are used by neighbor routers to exchange routing information in order to help populate their routing tables.


Edit for your comments:

Remember that DHCP works on request/response. Your comment:

Not SUB01 and SUB02 but R01 and R02. PC1, for example, does not need to know where R03 is. It just broadcasts. When it does, R01 should not drop the DHCP packet because the IP helper-address is configured on the port G0/0 (192.168.0.30/27) of R01, which in turn directly connected to R03 (The DHCP Server). And this is the whole idea of the DHCP Relay. Correct?

does not address the fact that R3 needs to send a DHCP response back to PC1, and R3 does not know how to reach the network of PC1 (where the DHCP relay is configured on the interface using an address in that network), so R3 drops the DHCP response packet because it cannot find a path to the destination network in its routing table.

Yes, PC1 broadcasts the DHCP request, but the unicast response from R3 needs to go to the address of the R1 interface where PC1 is connected.

It is not all broadcasts as you claim. Broadcasts do not cross routers. PC1 broadcasts a DHCP request, and even if the DHCP server is on the same network, the response from the DHCP server is unicast. A DHCP relay simply captures the broadcast and sends a unicast request to the DHCP server, receiving a unicast response in return. That cannot happen in your scenario because the DHCP relay address is the interface address in the network of the interface on which the DHCP relay is configured.

You can simply configure a routing protocol by placing the following commands on all three routers:

router ospf 1
 network 0.0.0.0 255.255.255.255 area 0
!

That will start OSPF and include all router interfaces in the OSPF process. If you want to block OSPF hellos on the PC networks (a good practice), just add:

passive-interface GigabitEthernet0/0

You can also configure static routes on each router, but that is a little more complex, and it will not scale.

5
  • They are directly connected. Please take a look at the updated question
    – Shadi
    Commented Apr 20, 2023 at 6:23
  • @Shadi, no, SUB1 is not directly connected to R3, and neither is SUB2. You will need to either configure static routes to them on R3, or you will need to run a common routing protocol on all three routers, which is the preferred method because static configuration does not scale. R3 has no idea where SUB1 and SUB2 are, and it will simply drop any packets destined for those networks unless you somehow tell it how to reach those networks.
    – Ron Maupin
    Commented Apr 20, 2023 at 12:19
  • Not SUB01 and SUB02 but R01 and R02. PC1, for example, does not need to know where R03 is. It just broadcasts. When it does, R01 should not drop the DHCP packet because the IP helper-address is configured on the port G0/0 (192.168.0.30/27) of R01, which in turn directly connected to R03 (The DHCP Server). And this is the whole idea of the DHCP Relay. Correct?
    – Shadi
    Commented Apr 20, 2023 at 16:51
  • @Shadi, R3 does not know how to reach SUB1 and SUB2, and it needs to know that if it is to send packets to those networks. A router that does not know how to reach a network will drop packets destined to that network. Either use static routes or a routing protocol.
    – Ron Maupin
    Commented Apr 20, 2023 at 17:07
  • Thank you very much Ron, I can see what you were saying and it makes sense. I just realized that R03 needs to respond to the helper address port, which exists in a SUB that R03 does not have any kind of routes to. I just confused the fact that R03 has routes to R01 and R02 with the fact that it does not have routes to SUB01 and SUB 02 where, in fact, the helper addresses reside. Regarding the Broadcast, I meant that the PC does it initially. I fully understand that the helper use unicast as does R03 to respond. Thanks again.
    – Shadi
    Commented Apr 23, 2023 at 7:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.