Skip to content
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

[DHCP Relay]: Now listen on all front panel, VLAN and PortChannel interfaces with IPv4 addresses #645

Merged
merged 2 commits into from
May 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion dockers/docker-dhcp-relay/isc-dhcp-relay.j2
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
SERVERS="{{ dhcp_servers | join(' ') }}"

INTERFACES="{{ minigraph_vlan_interfaces[0]['attachto'] }}"
INTERFACES="
{%- set add_preceding_space = { 'flag': False } %}
{%- for interface in minigraph_interfaces %}
{%- if interface['addr'] | ipv4 %}
{%- if add_preceding_space.flag %} {% endif %}
{{ interface['attachto'] }}
{%- set _dummy = add_preceding_space.update({'flag': True}) %}
{%- endif %}
{%- endfor %}
{%- for vlan_interface in minigraph_vlan_interfaces %}
{%- if vlan_interface['addr'] | ipv4 %}
{%- if add_preceding_space.flag %} {% endif %}
{{ vlan_interface['attachto'] }}
{%- set _dummy = add_preceding_space.update({'flag': True}) %}
{%- endif %}
{%- endfor %}
{%- for pc_interface in minigraph_portchannel_interfaces %}
{%- if pc_interface['addr'] | ipv4 %}
{%- if add_preceding_space.flag %} {% endif %}
{{ pc_interface['attachto'] }}
{%- set _dummy = add_preceding_space.update({'flag': True}) %}
{%- endif %}
{%- endfor %}"

# '-a' option provides option 82 circuit id information
OPTIONS="-a"
Expand Down
7 changes: 7 additions & 0 deletions src/sonic-config-engine/tests/sample_output/isc-dhcp-relay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SERVERS="192.0.0.1 192.0.0.2 192.0.0.3 192.0.0.4 192.0.0.5 192.0.0.6 192.0.0.7 192.0.0.8 192.0.0.9 192.0.0.10 192.0.0.11 192.0.0.12 192.0.0.13 192.0.0.14 192.0.0.15 192.0.0.16 192.0.0.17 192.0.0.18 192.0.0.19 192.0.0.20 192.0.0.21 192.0.0.22 192.0.0.23 192.0.0.24 192.0.0.25 192.0.0.26 192.0.0.27 192.0.0.28 192.0.0.29 192.0.0.30 192.0.0.31 192.0.0.32 192.0.0.33 192.0.0.34 192.0.0.35 192.0.0.36 192.0.0.37 192.0.0.38 192.0.0.39 192.0.0.40 192.0.0.41 192.0.0.42 192.0.0.43 192.0.0.44 192.0.0.45 192.0.0.46 192.0.0.47 192.0.0.48"

INTERFACES="Vlan1000 PortChannel01 PortChannel02 PortChannel03 PortChannel04"

# '-a' option provides option 82 circuit id information
OPTIONS="-a"