forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework DHCP relay to support routed and/or unnumbered interfaces
- Loading branch information
1 parent
f6ae0f7
commit c087ff9
Showing
7 changed files
with
120 additions
and
130 deletions.
There are no files selected for viewing
This file contains 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,21 +1,14 @@ | ||
[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}) %} | ||
{% for server in v4_relays %} | ||
{% if add_preceding_comma.flag %},{% endif %} | ||
{% set _dummy = add_preceding_comma.update({'flag': True}) %} | ||
isc-dhcpv4-relay-{{ server | replace(".", "-") }} | ||
{%- endfor %} | ||
{# Append DHCPv6 agents #} | ||
{% if ipv6_num_relays.count > 0 %} | ||
{% if add_preceding_comma.flag %},{% endif %} | ||
{% set _dummy = add_preceding_comma.update({'flag': True}) %} | ||
dhcp6relay | ||
{% endif %} | ||
{% endif %} |
This file contains 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 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 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 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 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.