This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/dockers/docker-dhcp-relay/dhcpv6-relay.agents.j2
jcaiMR 3c8ae454b4
[202012] dhcprelay add Loopback0 as source interface in dualtor scenario (#15744)
#### Why I did it
1. sonic-build image side change to fix source interface selection in dual tor scenario.
dhcprelay related PR:
https://github.com/sonic-net/sonic-dhcp-relay/pull/40

2. Announce dhcprelay submodule to 3578eb3 (to invoke [#40](https://github.com/sonic-net/sonic-dhcp-relay/pull/40
) PR)

##### Work item tracking
- Microsoft ADO 24243215

#### How to verify it
run test case, dhcp_relay/test_dhcpv6_relay.py
2023-07-24 18:28:16 -07:00

27 lines
831 B
Django/Jinja

{# Append DHCPv6 agents #}
{% for vlan_name in VLAN_INTERFACE %}
{% if DHCP_RELAY and vlan_name in DHCP_RELAY and DHCP_RELAY[vlan_name]['dhcpv6_servers']|length > 0 %}
{% for dhcpv6_server in DHCP_RELAY[vlan_name]['dhcpv6_servers'] %}
{% if dhcpv6_server | ipv6 %}
{% set _dummy = relay_for_ipv6.update({'flag': True}) %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% if relay_for_ipv6.flag %}
{% set _dummy = relay_for_ipv6.update({'flag': False}) %}
[program:dhcp6relay]
command=/usr/sbin/dhcp6relay
{#- Dual ToR Option #}
{% if 'subtype' in DEVICE_METADATA['localhost'] and DEVICE_METADATA['localhost']['subtype'] == 'DualToR' %} -u Loopback0 {% endif %}
priority=3
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog
dependent_startup=true
dependent_startup_wait_for=start:exited
{% endif %}