Possibility of a dhcp-relay chain (DHCP server--Router1---Router2--DHCPClient) multiple routers dhcp relay

Hi there,

I am trying to figure out how to relay dhcp requests from a client to a dhcp server that are seperated by two vyos routers. Currently how it is set up is that router A and B are directly connected to each other, but client is behind router A and server is behind Router B. I assume that this requires some sort of relay-chain from router A to B but I am not sure which settings to apply for each router. I’ve tried various combinations of the relay-agents-packets on both routers but alas it did not make a different. If you have dealt with this before or might know a solution please let me know! Thank you.

  • S

You shouldn’t need a “relay-chain” you just setup DHCP relay on Router A so that it is relaying requests to the IP Address of the DHCP server behind B.
Config to apply to Router A:

# show service dhcp-relay
     interface eth1  <------- Interface on Router A that has your client(s) on it.
     server X.X.X.X <-------- IP Address of the DHCP Server attached to Router B.
     relay-options {
        relay-agents-packets discard

As long as routing is working correctly between everything, this should be enough.

In other breaking news: Welcome to the Vyos Forums :slight_smile:

1 Like

Thanks for the solution you’ve posted. I’m currently dealing with a wan load balancing issue so I am not able to test the relay on the environment right now. I’ll keep you posted once that is working. Thank you for the warm welcome. Glad to be here! :slightly_smiling_face:

Just tested it with the right load balancing config and good news is that it works now, although I had to also enter the interface of router A that connected to router B in the dhcp-relay settings, so in this case both interfaces that played a part in routing the dhcp packets from client to server need to be declared via the set dhcp-relay interface command. Thanks again for your help!

1 Like

Most welcome, glad you got it working!

Yes your observation is correct the source and destination interfaces need to be added for dhcp relay as both are bidirectional, you can not specify originating/forwarding, you must specify all of them due to this.
You can see it via logs when you start up or restart dhcp-relay.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.