Skip to content

DHCPv4 Relay Agent High Level Design - #1938

Merged
yaqiangz merged 6 commits into
sonic-net:masterfrom
ashutosh-agrawal:dhcpv4
Aug 14, 2025
Merged

DHCPv4 Relay Agent High Level Design#1938
yaqiangz merged 6 commits into
sonic-net:masterfrom
ashutosh-agrawal:dhcpv4

Conversation

@ashutosh-agrawal

@ashutosh-agrawal ashutosh-agrawal commented Mar 1, 2025

Copy link
Copy Markdown
Member

This document provides a high-level design for SONiC's new DHCPv4 relay agent, which addresses limitations of the existing ISC-DHCP implementation. The document outlines the architecture, new features and configuration of the new design, and also addresses the backward compatibility concerns related to transition from isc-dhcp.

Code PRs:
sonic-dhcp-relay
yang-model
sonic-buildimage
sonic-swss-common
Testplan HLD
sonic-mgmt test
CLIs

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md Outdated
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md Outdated
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md Outdated
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md Outdated
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
@yaqiangz

Copy link
Copy Markdown
Contributor

Hi @lolyu could you please help to check the dual tor part?

@yaqiangz
yaqiangz requested a review from lolyu March 17, 2025 12:28
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md Outdated
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md Outdated
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md Outdated
lolyu
lolyu previously approved these changes Apr 8, 2025

@lolyu lolyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dualtor part LGTM

@AnantKishorSharma

Copy link
Copy Markdown

Hi @yaqiangz , @saiarcot895 , @lguohan , could you please create the new repo mentioned in this HLD( https://github.com/sonic-net/sonic-dhcpv4-relay) to open code PR?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe detailing the type of OFFER packet(unicast) is more friendly

Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
Comment thread doc/DHCPv4_relay/DHCPv4-relay-agent-High-Level-Design.md
gordon-nexthop pushed a commit to nexthop-ai/sonic-utilities that referenced this pull request Nov 25, 2025
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).

What I did
Added dependency checks in SONiC config CLI to prevent deletion of interfaces, VRFs, and VLANs that are in use by DHCPv4 relay configurations.
Added/updated unit tests.
How I did it
Implemented a new function check_dhcpv4_relay_dependencies to check if an interface or VRF is referenced in the DHCPV4_RELAY table.
Called this function before allowing deletion of portchannels, loopbacks, VRFs, and VLANs.
Modified the VLAN deletion logic to block removal if the VLAN is present in the DHCPV4_RELAY table.
Extended the test suite to verify that deletion is blocked when dependencies exist and allowed after cleanup.

How to verify it
Run the updated unit tests: they now include cases where deletion of interfaces, VRFs, or VLANs in use by DHCPv4 relay is attempted and should fail.
Manually test by configuring DHCPv4 relay on an interface/VRF/VLAN, then attempt to delete it using the CLI; the command should fail with an appropriate error message.
After removing the DHCPv4 relay configuration, deletion should succeed.
ashutosh-agrawal pushed a commit to AnantKishorSharma/sonic-buildimage that referenced this pull request Nov 30, 2025
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).
Docker changes PR : sonic-net#22486

How I did it
Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder.
Corresponding cli-plugin-tests are included.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Dec 4, 2025
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).
Docker changes PR : sonic-net#22486

How I did it
Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder.
Corresponding cli-plugin-tests are included.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
Signed-off-by: Feng Pan <fenpan@microsoft.com>
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Dec 5, 2025
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
kewei-arista pushed a commit to kewei-arista/sonic-buildimage that referenced this pull request Dec 8, 2025
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
hdwhdw pushed a commit to hdwhdw/sonic-buildimage that referenced this pull request Dec 18, 2025
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
xwjiang-ms pushed a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 22, 2025
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).
Docker changes PR : sonic-net#22486

How I did it
Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder.
Corresponding cli-plugin-tests are included.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
xwjiang-ms pushed a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 22, 2025
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
YairRaviv pushed a commit to YairRaviv/sonic-utilities that referenced this pull request Jan 12, 2026
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).

What I did
Added dependency checks in SONiC config CLI to prevent deletion of interfaces, VRFs, and VLANs that are in use by DHCPv4 relay configurations.
Added/updated unit tests.
How I did it
Implemented a new function check_dhcpv4_relay_dependencies to check if an interface or VRF is referenced in the DHCPV4_RELAY table.
Called this function before allowing deletion of portchannels, loopbacks, VRFs, and VLANs.
Modified the VLAN deletion logic to block removal if the VLAN is present in the DHCPV4_RELAY table.
Extended the test suite to verify that deletion is blocked when dependencies exist and allowed after cleanup.

How to verify it
Run the updated unit tests: they now include cases where deletion of interfaces, VRFs, or VLANs in use by DHCPv4 relay is attempted and should fail.
Manually test by configuring DHCPv4 relay on an interface/VRF/VLAN, then attempt to delete it using the CLI; the command should fail with an appropriate error message.
After removing the DHCPv4 relay configuration, deletion should succeed.
jasonbridges pushed a commit to jasonbridges/sonic-buildimage that referenced this pull request Jan 22, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
ashutosh-agrawal added a commit to ashutosh-agrawal/sonic-buildimage that referenced this pull request Feb 5, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
Signed-off-by: Feng Pan <fenpan@microsoft.com>
vmittal-msft added a commit to sonic-net/sonic-buildimage that referenced this pull request Mar 23, 2026
* [dhcp_relay] sonic dhcp relay agent for IPv4 (#22486)

Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>

* Update sonic-dhcp-relay submodule to include boost dependency fixes

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>

---------

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Anant <127479400+AnantKishorSharma@users.noreply.github.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
Co-authored-by: Vineet  Mittal <46945843+vmittal-msft@users.noreply.github.com>
eddieruan-alibaba pushed a commit that referenced this pull request Mar 27, 2026
This document provides a high-level design for SONiC's new DHCPv4 relay agent, which addresses limitations of the existing ISC-DHCP implementation. The document outlines the architecture, new features and configuration of the new design, and also addresses the backward compatibility concerns related to transition from isc-dhcp.

Signed-off-by: Eddie Ruan <eddie.ruan@alibaba-inc.com>
mhchann pushed a commit to mhchann/sonic-buildimage that referenced this pull request May 7, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).
Docker changes PR : sonic-net#22486

How I did it
Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder.
Corresponding cli-plugin-tests are included.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
Signed-off-by: mhchann <mhchann082@gmail.com>
mhchann pushed a commit to mhchann/sonic-buildimage that referenced this pull request May 7, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
Signed-off-by: mhchann <mhchann082@gmail.com>
roger530-ho pushed a commit to roger530-ho/sonic-buildimage that referenced this pull request Jun 23, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).
Docker changes PR : sonic-net#22486

How I did it
Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder.
Corresponding cli-plugin-tests are included.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
roger530-ho pushed a commit to roger530-ho/sonic-buildimage that referenced this pull request Jun 23, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
xdqi pushed a commit to canonical/sonic-buildimage that referenced this pull request Jul 6, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).
Docker changes PR : sonic-net#22486

How I did it
Included new commands to support dhcpv4_relay in dockers/docker-dhcp-relay folder.
Corresponding cli-plugin-tests are included.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Co-authored-by: Prashant Srivastava <srivastavaprashant829@gmail.com>
xdqi pushed a commit to canonical/sonic-buildimage that referenced this pull request Jul 6, 2026
Why I did it
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938)

Work item tracking
Microsoft ADO (number only):
How I did it
Edit supervisord template to start sonic DHCPv4 relay instance when configured to do so in Config DB.
Align cfg unit test to the new change.

How to verify it
Configure sonic DHCPv4 agent as described in the feature HLD(sonic-net/SONiC#1938)
Test it with real client/server with IPv4 or use the sonic-mgmt suite

Signed-off-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Shivashankar C R <shivashankar.c.r@gmail.com>
Co-authored-by: Ashutosh Agrawal <ashu@cisco.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: StormLiangMS <89824293+StormLiangMS@users.noreply.github.com>
Yogapriya-cisco pushed a commit to vrajeshe/sonic-utilities that referenced this pull request Jul 10, 2026
Currently SONiC uses the 'isc-dhcp-relay' package to allow DHCP relay functionality on IPv4 networks.
With this PR we are adding sonic dhcp relay agent for IPv4 as described in this HLD(sonic-net/SONiC#1938).

What I did
Added dependency checks in SONiC config CLI to prevent deletion of interfaces, VRFs, and VLANs that are in use by DHCPv4 relay configurations.
Added/updated unit tests.
How I did it
Implemented a new function check_dhcpv4_relay_dependencies to check if an interface or VRF is referenced in the DHCPV4_RELAY table.
Called this function before allowing deletion of portchannels, loopbacks, VRFs, and VLANs.
Modified the VLAN deletion logic to block removal if the VLAN is present in the DHCPV4_RELAY table.
Extended the test suite to verify that deletion is blocked when dependencies exist and allowed after cleanup.

How to verify it
Run the updated unit tests: they now include cases where deletion of interfaces, VRFs, or VLANs in use by DHCPv4 relay is attempted and should fail.
Manually test by configuring DHCPv4 relay on an interface/VRF/VLAN, then attempt to delete it using the CLI; the command should fail with an appropriate error message.
After removing the DHCPv4 relay configuration, deletion should succeed.

Signed-off-by: Yogapriya Mohankumar <ymohanku@cisco.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants