-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[dhcp_relay] sonic dhcp relay agent for IPv4 #22486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 18 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
5f3860c
add sonic dhcpv4 relay agent
AnantKishorSharma c8b9802
new src path for dhcp6relay
AnantKishorSharma ad53ec9
DHCPv4 Relay Yang Model changes are part of PR #22338
AnantKishorSharma 79c6843
DHCPv4 Relay Yang Model changes are part of PR #22338
AnantKishorSharma 5a81367
DHCPv4 Relay Yang Model changes are part of PR #22338
AnantKishorSharma 6b95785
add sonic dhcpv4 relay agent
AnantKishorSharma 149577c
new src path for dhcp6relay
AnantKishorSharma 209ef65
DHCPv4 Relay Yang Model changes are part of PR #22338
AnantKishorSharma 2869413
DHCPv4 Relay Yang Model changes are part of PR #22338
AnantKishorSharma 5a088dc
DHCPv4 Relay Yang Model changes are part of PR #22338
AnantKishorSharma 2828bf2
Addressing MSFT comments on HLD
cshivashgit e614ff3
CLI bug fixes, Added has_sonic_dhcpv4_relay feature flag in yang
cshivashgit 7777780
Revert CLI changes, Moved to new PR
cshivashgit 8dae52f
Merge branch 'sonic-net:master' into sonic-dhcp4relay
AnantKishorSharma 9890314
merge master
AnantKishorSharma 6ce3424
removed the unintended changes from the feature branch
AnantKishorSharma 5dfcc3a
Merge branch 'master' into sonic-dhcp4relay
ashutosh-agrawal e8de260
Merge branch 'master' into sonic-dhcp4relay
ashutosh-agrawal 1d62e3b
Update rules/dhcp4relay.dep
AnantKishorSharma 3dbb3d2
Update src/sonic-yang-models/yang-models/sonic-feature.yang
AnantKishorSharma bda4a61
Update dockers/docker-dhcp-relay/dhcpv4-sonic-relay.agents.j2
AnantKishorSharma 963140d
Merge branch 'sonic-net:master' into sonic-dhcp4relay
ashutosh-agrawal 8f7066f
fixed sonic-config-engine ut
ashutosh-agrawal f92b577
Merge pull request #1 from AnantKishorSharma/ashu/cfg-engine-ut-fix
ashutosh-agrawal de2737f
Moved has has_sonic_dhcpv4_relay from FEATURE table to DEVICE_METADAT…
ashutosh-agrawal 9fffc4b
Merge branch 'sonic-net:master' into sonic-dhcp4relay
ashutosh-agrawal f050952
Merge branch 'sonic-net:master' into sonic-dhcp4relay
ashutosh-agrawal bf23252
Fixed supervisor-proc-exit-listener path to point to the Rust impleme…
ashutosh-agrawal d5830af
Merge branch 'master' into sonic-dhcp4relay
StormLiangMS 0449c7c
Merge branch 'master' into sonic-dhcp4relay
ashutosh-agrawal f485426
Merge branch 'master' into sonic-dhcp4relay
AnantKishorSharma c1d765b
Merge branch 'master' into sonic-dhcp4relay
AnantKishorSharma cd6cbd4
Merge branch 'master' into sonic-dhcp4relay
ashutosh-agrawal e056dc0
Merge branch 'master' into sonic-dhcp4relay
ashutosh-agrawal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| {# Append DHCPv4 sonic agent #} | ||
| [program:dhcp4relay] | ||
| command=/usr/sbin/dhcp4relay | ||
| {#- Dual ToR Option #} | ||
| {% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -u Loopback0 {% endif %} | ||
|
|
||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
|
|
||
| SPATH := $($(SONIC_DHCP4RELAY)_SRC_PATH) | ||
| DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/dhcp4relay.mk rules/dhcp4relay.dep | ||
|
AnantKishorSharma marked this conversation as resolved.
Outdated
|
||
| DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
| SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files --recurse-submodules)) | ||
|
|
||
| $(SONIC_DHCP4RELAY)_CACHE_MODE := GIT_CONTENT_SHA | ||
| $(SONIC_DHCP4RELAY)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
| $(SONIC_DHCP4RELAY)_DEP_FILES := $(DEP_FILES) | ||
| $(SONIC_DHCP4RELAY)_SMDEP_FILES := $(SMDEP_FILES) | ||
| $(SONIC_DHCP4RELAY)_SMDEP_PATHS := $(SPATH) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # SONiC DHCPV4 RELAY Package | ||
|
|
||
| SONIC_DHCP4RELAY_VERSION = 1.0.0-0 | ||
| SONIC_DHCP4RELAY_PKG_NAME = dhcp4relay | ||
|
|
||
| SONIC_DHCP4RELAY = sonic-$(SONIC_DHCP4RELAY_PKG_NAME)_$(SONIC_DHCP4RELAY_VERSION)_$(CONFIGURED_ARCH).deb | ||
| $(SONIC_DHCP4RELAY)_DEPENDS = $(LIBSWSSCOMMON) $(LIBSWSSCOMMON_DEV) | ||
| $(SONIC_DHCP4RELAY)_SRC_PATH = $(SRC_PATH)/dhcprelay/dhcp4relay | ||
| SONIC_DPKG_DEBS += $(SONIC_DHCP4RELAY) | ||
|
|
||
| SONIC_DHCP4RELAY_DBG = sonic-$(SONIC_DHCP4RELAY_PKG_NAME)-dbgsym_$(SONIC_DHCP4RELAY_VERSION)_$(CONFIGURED_ARCH).deb | ||
| $(eval $(call add_derived_package,$(SONIC_DHCP4RELAY),$(SONIC_DHCP4RELAY_DBG))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/sonic-config-engine/tests/dhcp-sonic-relay-disabled-sample.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "VLAN_INTERFACE": { | ||
| "Vlan1000|fc02:2000::2/24": {} | ||
| }, | ||
| "FEATURE": { | ||
| "dhcp_server": { | ||
| "state": "disabled" | ||
| }, | ||
| "dhcp_relay": { | ||
| "auto_restart": "disabled", | ||
| "check_up_status": "False", | ||
| "delayed": "False", | ||
| "has_global_scope": "True", | ||
| "has_per_asic_scope": "False", | ||
| "high_mem_alert": "disabled", | ||
| "set_owner": "local", | ||
| "has_sonic_dhcpv4_relay": "False", | ||
| "state": "enabled", | ||
| "support_syslog_rate_limit": "True" | ||
| } | ||
|
|
||
| } | ||
| } |
23 changes: 23 additions & 0 deletions
23
src/sonic-config-engine/tests/dhcp-sonic-relay-enabled-sample.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "VLAN_INTERFACE": { | ||
| "Vlan1000|fc02:2000::2/24": {} | ||
| }, | ||
| "FEATURE": { | ||
| "dhcp_server": { | ||
| "state": "disabled" | ||
| }, | ||
| "dhcp_relay": { | ||
| "auto_restart": "disabled", | ||
| "check_up_status": "False", | ||
| "delayed": "False", | ||
| "has_global_scope": "True", | ||
| "has_per_asic_scope": "False", | ||
| "high_mem_alert": "disabled", | ||
| "set_owner": "local", | ||
| "has_sonic_dhcpv4_relay": "True", | ||
| "state": "enabled", | ||
| "support_syslog_rate_limit": "True" | ||
| } | ||
|
|
||
| } | ||
| } |
74 changes: 74 additions & 0 deletions
74
...ngine/tests/sample_output/py2/docker-dhcp-relay-sonic-agent-no-relay-cfg.supervisord.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| [supervisord] | ||
| logfile_maxbytes=1MB | ||
| logfile_backups=2 | ||
| nodaemon=true | ||
|
|
||
| [eventlistener:dependent-startup] | ||
| command=python3 -m supervisord_dependent_startup | ||
| autostart=true | ||
| autorestart=unexpected | ||
| startretries=0 | ||
| exitcodes=0,3 | ||
| events=PROCESS_STATE | ||
| buffer_size=1024 | ||
|
|
||
| [eventlistener:supervisor-proc-exit-listener] | ||
| command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay | ||
| events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING | ||
| autostart=true | ||
| autorestart=unexpected | ||
| buffer_size=1024 | ||
|
|
||
| [program:rsyslogd] | ||
| command=/usr/sbin/rsyslogd -n -iNONE | ||
| priority=1 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
|
|
||
| [program:start] | ||
| command=/usr/bin/start.sh | ||
| priority=2 | ||
| autostart=false | ||
| autorestart=false | ||
| startsecs=0 | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=rsyslogd:running | ||
|
|
||
| [group:dhcp-relay] | ||
| programs=dhcprelayd,dhcp4relay | ||
|
|
||
| [program:dhcp4relay] | ||
| command=/usr/sbin/dhcp4relay | ||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited | ||
|
|
||
| [group:dhcpmon] | ||
| programs= | ||
|
|
||
| [program:dhcprelayd] | ||
| command=/usr/local/bin/dhcprelayd | ||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited |
110 changes: 110 additions & 0 deletions
110
...onic-config-engine/tests/sample_output/py2/docker-dhcp-relay-sonic-agent.supervisord.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| [supervisord] | ||
| logfile_maxbytes=1MB | ||
| logfile_backups=2 | ||
| nodaemon=true | ||
|
|
||
| [eventlistener:dependent-startup] | ||
| command=python3 -m supervisord_dependent_startup | ||
| autostart=true | ||
| autorestart=unexpected | ||
| startretries=0 | ||
| exitcodes=0,3 | ||
| events=PROCESS_STATE | ||
| buffer_size=1024 | ||
|
|
||
| [eventlistener:supervisor-proc-exit-listener] | ||
| command=/usr/bin/supervisor-proc-exit-listener --container-name dhcp_relay | ||
| events=PROCESS_STATE_EXITED,PROCESS_STATE_RUNNING | ||
| autostart=true | ||
| autorestart=unexpected | ||
| buffer_size=1024 | ||
|
|
||
| [program:rsyslogd] | ||
| command=/usr/sbin/rsyslogd -n -iNONE | ||
| priority=1 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
|
|
||
| [program:start] | ||
| command=/usr/bin/start.sh | ||
| priority=2 | ||
| autostart=false | ||
| autorestart=false | ||
| startsecs=0 | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=rsyslogd:running | ||
|
|
||
| [group:dhcp-relay] | ||
| programs=dhcprelayd,dhcp6relay,dhcp4relay | ||
|
|
||
| [program:dhcp4relay] | ||
| command=/usr/sbin/dhcp4relay | ||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited | ||
|
|
||
| [program:dhcp6relay] | ||
| command=/usr/sbin/dhcp6relay | ||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited | ||
|
|
||
| [group:dhcpmon] | ||
| programs=dhcpmon-Vlan1000,dhcpmon-Vlan2000 | ||
|
|
||
| [program:dhcpmon-Vlan1000] | ||
| command=/usr/sbin/dhcpmon -id Vlan1000 -iu Vlan2000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -im eth0 | ||
| priority=4 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=dhcp4relay:running | ||
|
|
||
| [program:dhcpmon-Vlan2000] | ||
| command=/usr/sbin/dhcpmon -id Vlan2000 -iu Vlan1000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 -im eth0 | ||
| priority=4 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=dhcp4relay:running | ||
|
|
||
| [program:dhcprelayd] | ||
| command=/usr/local/bin/dhcprelayd | ||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=NONE | ||
| stdout_syslog=true | ||
| stderr_logfile=NONE | ||
| stderr_syslog=true | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.