diff options
Diffstat (limited to 'data/templates/dhcp-client/override.conf.j2')
-rw-r--r-- | data/templates/dhcp-client/override.conf.j2 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/data/templates/dhcp-client/override.conf.j2 b/data/templates/dhcp-client/override.conf.j2 new file mode 100644 index 000000000..5ceee9f5e --- /dev/null +++ b/data/templates/dhcp-client/override.conf.j2 @@ -0,0 +1,14 @@ +### Autogenerated by interface.py ### +{% set vrf_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is defined and vrf is not none else '' %} +{% set if_metric = '-e IF_METRIC=' ~ dhcp_options.default_route_distance if dhcp_options is defined and dhcp_options.default_route_distance is defined and dhcp_options.default_route_distance is not none else '' %} +{% set dhclient_options = '-d -nw -cf /var/lib/dhcp/dhclient_' ~ ifname ~ '.conf -pf /var/lib/dhcp/dhclient_' ~ ifname ~ '.pid -lf /var/lib/dhcp/dhclient_' ~ ifname ~ '.leases ' ~ if_metric %} + +[Unit] +ConditionPathExists= +ConditionPathExists=/var/lib/dhcp/dhclient_{{ ifname }}.conf + +[Service] +ExecStart= +ExecStart={{ vrf_command }}/sbin/dhclient -4 {{ dhclient_options }} {{ ifname }} +ExecStop= +ExecStop={{ vrf_command }}/sbin/dhclient -4 -r {{ dhclient_options }} {{ ifname }} |