-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[201911] Add dhcp6relay as dhcprelay submodule #12052
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 all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
482f0d3
Add DHCPv6 minigraph parsing support (#8870)
kellyyeh 35b5578
Parse DHCP Table (#8988)
kellyyeh 01a8af1
Replace isc-dhcp with DHCPv6 Relay in dhcp_relay docker (#8884)
kellyyeh a6c00c9
Add dhcprelay submodule
kellyyeh 81ff36a
Add package dependency
kellyyeh 3f996df
Clean Up
kellyyeh 695d19c
Clean Up
kellyyeh 5bab10c
Update docker-dhcp-relay.supervisord.conf
kellyyeh 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| group:isc-dhcp-relay | ||
| group:dhcp-relay |
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,63 @@ | ||
| [group:dhcpmon] | ||
| programs= | ||
| {%- set add_preceding_comma = { 'flag': False } %} | ||
| {% set monitor_instance = { 'flag': False } %} | ||
| {% for vlan_name in VLAN_INTERFACE %} | ||
| {% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} | ||
| {% set _dummy = monitor_instance.update({'flag': True}) %} | ||
| {%- endif %} | ||
| {% if monitor_instance.flag %} | ||
| {% if add_preceding_comma.flag %},{% endif %} | ||
| {% set _dummy = add_preceding_comma.update({'flag': True}) %} | ||
| dhcpmon-{{ vlan_name }} | ||
| {%- set _dummy = monitor_instance.update({'flag': False}) %} | ||
| {%- endif %} | ||
| {% endfor %} | ||
|
|
||
|
|
||
| {# Create a program entry for each DHCP MONitor instance #} | ||
| {% set relay_for_ipv4 = { 'flag': False } %} | ||
| {% for vlan_name in VLAN_INTERFACE %} | ||
| {# Check DHCPv4 agents #} | ||
| {% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} | ||
| {% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} | ||
| {% if dhcp_server | ipv4 %} | ||
| {% set _dummy = relay_for_ipv4.update({'flag': True}) %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% if relay_for_ipv4.flag %} | ||
| [program:dhcpmon-{{ vlan_name }}] | ||
| {# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #} | ||
| command=/usr/sbin/dhcpmon -id {{ vlan_name }} | ||
| {#- Dual ToR Option #} | ||
| {% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -u Loopback0{% endif -%} | ||
| {#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #} | ||
| {% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} | ||
| {% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%} | ||
| {% endfor %} | ||
| {% for (name, prefix) in INTERFACE|pfx_filter %} | ||
| {% if prefix | ipv4 %} -iu {{ name }}{% endif -%} | ||
| {% endfor %} | ||
| {% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} | ||
| {% if prefix | ipv4 %} -iu {{ name }}{% endif -%} | ||
| {% endfor %} | ||
| {% if MGMT_INTERFACE %} | ||
| {% for (name, prefix) in MGMT_INTERFACE|pfx_filter %} | ||
| {% if prefix | ipv4 %} -im {{ name }}{% endif -%} | ||
| {% endfor %} | ||
| {% endif %} | ||
|
|
||
| priority=4 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=syslog | ||
| stderr_logfile=syslog | ||
| dependent_startup=true | ||
| dependent_startup_wait_for= | ||
| {%- if relay_for_ipv4.flag %}isc-dhcpv4-relay-{{ vlan_name }}:running {% endif %} | ||
|
|
||
|
|
||
| {% set _dummy = relay_for_ipv4.update({'flag': False}) %} | ||
| {% endif %} | ||
| {% endfor %} | ||
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,22 @@ | ||
| [group:dhcp-relay] | ||
| programs= | ||
| {%- set relay_for_ipv6 = { 'flag': False } %} | ||
| {%- set add_preceding_comma = { 'flag': False } %} | ||
| {% for vlan_name in VLAN_INTERFACE %} | ||
| {# Append DHCPv4 agents #} | ||
| {% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} | ||
| {% if add_preceding_comma.flag %},{% endif %} | ||
| {% set _dummy = add_preceding_comma.update({'flag': True}) %} | ||
| isc-dhcpv4-relay-{{ vlan_name }} | ||
| {%- endif %} | ||
| {% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %} | ||
| {% set _dummy = relay_for_ipv6.update({'flag': True}) %} | ||
| {%- endif %} | ||
| {% endfor %} | ||
| {# Append DHCPv6 agents #} | ||
| {% if relay_for_ipv6.flag %} | ||
| {% if add_preceding_comma.flag %},{% endif %} | ||
| {% set _dummy = add_preceding_comma.update({'flag': True}) %} | ||
| dhcp6relay | ||
| {% endif %} | ||
|
|
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,41 @@ | ||
| {# Append DHCPv4 agents #} | ||
| {% if VLAN and vlan_name in VLAN and 'dhcp_servers' in VLAN[vlan_name] and VLAN[vlan_name]['dhcp_servers']|length > 0 %} | ||
| {% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} | ||
| {% if dhcp_server | ipv4 %} | ||
| {% set _dummy = relay_for_ipv4.update({'flag': True}) %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% if relay_for_ipv4.flag %} | ||
| {% set _dummy = relay_for_ipv4.update({'flag': False}) %} | ||
|
|
||
| [program:isc-dhcpv4-relay-{{ vlan_name }}] | ||
| {# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #} | ||
| command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id {{ vlan_name }} | ||
| {#- Dual ToR Option #} | ||
| {% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -U Loopback0 -dt{% endif -%} | ||
| {#- si option to use intf addr in relay #} | ||
| {% if DEVICE_METADATA['localhost']['deployment_id'] == '8' %} -si{% endif -%} | ||
| {#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #} | ||
| {% for (name, prefix) in VLAN_INTERFACE|pfx_filter %} | ||
| {% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%} | ||
| {% endfor %} | ||
| {% for (name, prefix) in INTERFACE|pfx_filter %} | ||
| {% if prefix | ipv4 %} -iu {{ name }}{% endif -%} | ||
| {% endfor %} | ||
| {% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} | ||
| {% if prefix | ipv4 %} -iu {{ name }}{% endif -%} | ||
| {% endfor %} | ||
| {% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} | ||
| {%- if dhcp_server | ipv4 %} {{ dhcp_server }}{% endif -%} | ||
| {% endfor %} | ||
|
|
||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=syslog | ||
| stderr_logfile=syslog | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited | ||
|
|
||
| {% endif %} | ||
| {% endif %} |
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,24 @@ | ||
| {# Append DHCPv6 agents #} | ||
| {# Create a program entry for each DHCPv6 relay agent instance #} | ||
| {% for vlan_name in VLAN_INTERFACE %} | ||
| {% if DHCP_RELAY and vlan_name in DHCP_RELAY and 'dhcpv6_servers' in DHCP_RELAY[vlan_name] %} | ||
| {% for dhcpv6_server in DHCP_RELAY[vlan_name]['dhcpv6_servers'] %} | ||
| {% if dhcpv6_server | ipv6 %} | ||
| {% set _dummy = relay_for_ipv6.update({'flag': True}) %} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% if relay_for_ipv6.flag %} | ||
| {% set _dummy = relay_for_ipv6.update({'flag': False}) %} | ||
| [program:dhcp6relay] | ||
| command=/usr/sbin/dhcp6relay | ||
| priority=3 | ||
| autostart=false | ||
| autorestart=false | ||
| stdout_logfile=syslog | ||
| stderr_logfile=syslog | ||
| dependent_startup=true | ||
| dependent_startup_wait_for=start:exited | ||
|
|
||
| {% endif %} | ||
| {% endif %} | ||
| {% endfor %} |
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,12 @@ | ||
| # SONiC DHCPV6 RELAY Package | ||
|
|
||
| SONIC_DHCPRELAY_VERSION = 1.0.0-0 | ||
| SONIC_DHCPRELAY_PKG_NAME = dhcp6relay | ||
|
|
||
| SONIC_DHCPRELAY = sonic-$(SONIC_DHCPRELAY_PKG_NAME)_$(SONIC_DHCPRELAY_VERSION)_$(CONFIGURED_ARCH).deb | ||
| $(SONIC_DHCPRELAY)_DEPENDS = $(LIBSWSSCOMMON) $(LIBHIREDIS) $(LIBSWSSCOMMON_DEV) $(LIBHIREDIS_DEV) | ||
| $(SONIC_DHCPRELAY)_SRC_PATH = $(SRC_PATH)/dhcprelay | ||
| SONIC_DPKG_DEBS += $(SONIC_DHCPRELAY) | ||
|
|
||
| SONIC_DHCPRELAY_DBG = sonic-$(SONIC_DHCPRELAY_PKG_NAME)-dbgsym_$(SONIC_DHCPRELAY_VERSION)_amd64.deb | ||
| $(eval $(call add_derived_package,$(SONIC_DHCPRELAY),$(SONIC_DHCPRELAY_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
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.