Skip to content

Commit

Permalink
[DHCP Relay]: Listen on all front panel, VLAN and PortChannel interfa…
Browse files Browse the repository at this point in the history
…ces with IPv4 addresses (#645)

* DHCP relay now listens on all front panel, VLAN and PortChannel interfaces with IPv4 addresses
* Add sample isc-dhcp-relay output file
  • Loading branch information
jleveque authored and Shuotian Cheng committed May 31, 2017
1 parent 520fff5 commit b8c11bc
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
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"

0 comments on commit b8c11bc

Please sign in to comment.