Router – DHCP relay on Juniper MX

dhcpjuniperjuniper-junosjuniper-mxrouter

Hi I got a problem with bootp relay on a juniper router(s).
I got helpers bootp interface configured with:
irb.10
broadcast
server 10.20.1.10
server 10.20.1.11

theres several irb insterfaces in the configuration with the same settings.

If I start another DHCP server with the IP 10.20.1.14 it will get DHCP DISCOVERY too and sending offers and some ACK. I thought these setting would only send DHCP request to the servers listed.
So I tried with removing the broadcast line on all interfaces but then the real DHCP server only ACK some requests, so some request wasnt coming to the DHCP server.

I have tried finding the documentation for the broadcast setting but I could find any that explains it in detail.

I also tried with dhcp-relay settings but that doesnt work att all probably because that I cant specifiy the irb interfaces in the group interface option.

Does anyone know why the DHCP server with an IP that isnt specified in the server option gets DISCOVERY messages, i think this is because the broadcast option.

And how can I configure dhcp-relay to work, I tried with group interface xe-0/0/3 (the physical interface to the switch thats connected to the acces switch)

Best Answer

DHCP/BootP is Broadcast Traffic by definition.

The DHCP Relay / IP Helper configuration can only be used to forward request from hosts NOT on the same physical network as the DHCP Servers to the DHCP Servers (at least in the Router).

If you configure a DHCP Relay on a switch the DHCP relay agent can in some instances be smart enough to, if they have an SVI to associate the MAC to IP for the DHCP server, direct the broadcast message even in the same segment, so that only the DHCP Servers configured in the Relay receive the DHCP request.

Otherwise any time you send a DHCP hello request it will be answered by any DHCP server in the same segment.

Options you might consider if you need these DHCP servers to be doing separate things:

Segregate the DHCP Serving interfaces onto their own network segment and configure DHCP Relay for them appropriately.

Move only the DHCP server you don;t want to answer locally in the network segment to a separate network segment (either it's own with it's own relay or a vlan where local clients should receive it's reply.)

Set up separate DHCP ranges on several VLAN interfaces on each server so that each sever only responds to the appropriate local network (And do away with DHCP relay on the router)

Note that IRB on the other hand simpley allows the device to bridge local connections at Layer 2 instead of routing them at Layer 3, so any Devices in 10.20.1.x could be bridged directly as applicable (ie this doesn't really have anything to do with DHCP per-se, except as it allows the local broadcasts to flood both vlans rather limiting the usefulness of having separate segments)

Essentially the IRB is a second IP address in each VLAN / Net Segment, that the switch will forward all packets destined for the other vlan segment through to allow both to communicate with each other by bridging (the switch makes a direct connection between the devices and no routing needs to take place).

Long Story Short (too Late)

I'm fairly sure that the broadcast command allows the broadcasts in one vlan to flood the other and vice verse, so if the DHCP server is set up in one it will get requests from both. (Which I believe fits exactly the behavior of the issue that you are trying to describe above.)

As such, what I believe you need to do is:

  1. Set up your IRB to have 1 IP in each subnet.
  2. Not to use the broadcast switch.
  3. Set up your DHCP relay ONLY for the vlan which DOES NOT have the DHCP server on it.

This should send a directed message to the DHCP server as a unicast message via the relay, which will then match your IRB, so this will happen as a bridging action.