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: j.randomhacker@vyos.io
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