access: enable DHCP snooping on D-Link switches
Use the ifaces_dhcp custom context property to select interfaces where we should expect DHCP replies.
This commit is contained in:
parent
bbf0798d5c
commit
de05fd236b
2 changed files with 13 additions and 1 deletions
|
@ -51,6 +51,12 @@ interface {{ iface.name }}
|
|||
{% set mgmt.gw = iface.custom_fields.gateway.address %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if iface.name in ifaces_dhcp | default([]) %}
|
||||
ip dhcp snooping trust
|
||||
{% else %}
|
||||
no ip dhcp snooping trust
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{%- if mgmt.ip %}
|
||||
|
@ -83,6 +89,12 @@ sntp server {{ address }}
|
|||
|
||||
ntp access-group default nomodify noquery
|
||||
|
||||
{% if ifaces_dhcp | default(false) %}
|
||||
ip dhcp snooping
|
||||
{% else %}
|
||||
no ip dhcp snooping
|
||||
{% endif %}
|
||||
|
||||
{% if mgmt.gw %}
|
||||
ip route 0.0.0.0 0.0.0.0 {{ mgmt.gw | ipaddr('address') }} primary
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue