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

[201811][dhcp_relay] Add support for DHCP client(s) on one VLAN and DHCP server(s) on another #2919

Merged
merged 8 commits into from
May 18, 2019
Prev Previous commit
Next Next commit
Modify supervisor conf to generate dhcrelay commands with '-id' and '…
…-iu' options
jleveque committed May 17, 2019
commit 5efb6d027b0ec2cdd4810db9bdc1f929207e6187
10 changes: 7 additions & 3 deletions dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2
Original file line number Diff line number Diff line change
@@ -46,12 +46,16 @@ isc-dhcp-relay-{{ vlan_name }}
{% for vlan_name in VLAN -%}
{%- if VLAN[vlan_name]['dhcp_servers'] -%}
[program:isc-dhcp-relay-{{ vlan_name }}]
command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -i {{ vlan_name }}
command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id {{ vlan_name }}
{#- We treat all other interfaces besides this VLAN as potential upstream interfaces -#}
{%- for (name, prefix) in VLAN_INTERFACE -%}
{%- if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%}
{%- endfor -%}
{%- for (name, prefix) in INTERFACE -%}
{%- if prefix | ipv4 %} -i {{ name }}{% endif -%}
{%- if prefix | ipv4 %} -iu {{ name }}{% endif -%}
{%- endfor -%}
{%- for (name, prefix) in PORTCHANNEL_INTERFACE -%}
{%- if prefix | ipv4 %} -i {{ name }}{% endif -%}
{%- if prefix | ipv4 %} -iu {{ name }}{% endif -%}
{%- endfor -%}
{%- for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} {{ dhcp_server }}{% endfor %}

Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ stderr_logfile=syslog
programs=isc-dhcp-relay-Vlan1000

[program:isc-dhcp-relay-Vlan1000]
command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -i Vlan1000 -i PortChannel01 -i PortChannel02 -i PortChannel03 -i PortChannel04 192.0.0.1 192.0.0.2
command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id Vlan1000 -iu PortChannel01 -iu PortChannel02 -iu PortChannel03 -iu PortChannel04 192.0.0.1 192.0.0.2
priority=3
autostart=false
autorestart=false