Page MenuHomeVyOS Platform

DHCP-Relay potential bug. Static configurations of DHCP-Relay Interfaces
Confirmed, Requires assessmentPublicBUG

Description

Hello, hope you are doing well today. I noticed this bug while doing a small proof of concept and couldn't find any references to it in your documentation. Please forgive me if this is duplicative, I don't navigate the "bug report" space very often.

Quick Summary:
I believe DHCP-Relay configurations hardcode the "Relay Agent IP Address" field in their configuration at the time of initial configuration. If you change an interface or VIF IP after setting up DHCP Relay, the old interface IP will still be sent as the "Relay Agent IP Address" unless you re-do the DHCP-Relay configuration. Its possible that this is expected behavior, but it seems to me like it could be unexpected and/or easily fixable as well.

Steps to reproduce:
--Configure an interface with an IP address
--Configure DHCP Relay on that interface
--Commit your changes
--Reconfigure the original interface from step 1 to a different IP
--Commit your changes
--Perform a PCAP on DHCP Discover traffic and you should still see the original IP address vs the updated in the "Relay Agent IP Address" field

set interfaces ethernet eth1 vif 4050 address '192.168.51.1/24'
set service dhcp-relay interface 'eth1.4050'
commit
delete interfaces ethernet eth1 vif 4050 address '192.168.51.1/24'
set interfaces ethernet eth1 vif 4050 address '192.168.50.1/24'

Troubleshooting Steps I took:
Restart DHCP Relay-Agent (did not resolve)
Administratively shut down interface and re-enable (did not resolve)
Remove the DHCP relay line and then re-apply (delete service dhcp-relay interface 'eth1.4050' set service dhcp-relay interface 'eth1.4050')

Removing the DHCP Relay line and re-applying solved this issue. This leads me to believe that the DHCP-relay configuration is hardcoded to an interface's IP at the time of configuration. Notably I did NOT do a restart of the entire system.

Suggested Actions:
Unfortunately I don't know enough about coding to suggest a technical fix, or to perform the fix myself. However, my theory is that this configuration hardcodes the IP address at the time of DHCP-Relay configuration and does not change it.

Maybe you could adjust the way the DHCP-Relay configuration works to read dynamically from interfaces (at least during service start and shut down).

Alternatively, you could make a note in the documentation that if you reconfigure any DHCP Relay interfaces you must re-configure the dhcp-relay configuration as well to make them update. https://docs.vyos.io/en/equuleus/configuration/service/dhcp-relay.html

Its a pretty little thing, but it messed me up for an hour or two trying to figure out why my DHCP wasn't working. Best of luck, vyOS is a great product ūüĎćūüŹĽ

Version Information (I compiled from source a few months ago I think):
run show version Version:          VyOS LTS 1.3.2
Release train:¬†¬†¬† equuleus¬†Built by:¬†¬†¬†¬†¬†¬†¬†¬† [email protected]
Built on:         Wed 09 Nov 2022 23:18 UTC
Build UUID:       e0f8f761-5fdc-4c99-8b90-90827f9d694a
Build commit ID:  d44942002692c6 Architecture:     x86_64
Boot via:         installed image

Details

Difficulty level
Unknown (require assessment)
Version
VyOS LTS 1.3.2 - vyos-1.4-rolling-202302140317
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Internal change (not visible to end users)

Event Timeline

Can you provide this configuration on both setups:

show config comm | grep relay

# And route to relay server
show ip route <relay_server>

Can you provide this configuration on both setups:

show config comm | grep relay

# And route to relay server
show ip route <relay_server>

Unfortunately, I no longer have the setup handy but I am 99% sure the routing was all fine after I adjusted the interface (I checked it at the time but didn't document). Everything was directly connected to the router and I was able to ping between the networks. The dchp-relay configs were this:

set service broadcast-relay
set service dhcp-relay interface 'eth1.4045'
set service dhcp-relay interface 'eth1.4050'
set service dhcp-relay relay-options
set service dhcp-relay server '192.168.45.5'

Also have a PCAP attached if that helps.

I can confirm this behavior, which occurs when changing IP address on listening interface (where dhcp-discover is captured).
Issue present in 1.3.2 .
It's also present in latest vyos-1.4-rolling-202302140317, regardless if old interface syntax is used, or if new upstream-interfces plus listen-interface commands are used.

n.fort changed the task status from Open to Confirmed.Feb 14 2023, 3:19 PM
n.fort added a project: VyOS 1.4 Sagitta.
n.fort changed Version from VyOS LTS 1.3.2 to VyOS LTS 1.3.2 - vyos-1.4-rolling-202302140317.

In Both version, restarting relay service solved the issue:

sudo systemctl restart isc-dhcp-relay

FYI When I was troubleshooting I used:

restart dhcp relay-agent

and it did not resolve. Not sure if that does something different than the full systemctl service restart that you did in your example.