Timotej Lazar
db397cb2b1
… instead of generating them from prefixes. A NetBox script can be used to create and configure all necessary data for a new VLAN. Instead of VLAN roles “inside" and “outside” we now create separate VRFs for inside VLANs to match the actual exit/firewall configuration. The “outside” VRF is for all VLANs that are directly accessible from the internet.
18 lines
928 B
Django/Jinja
18 lines
928 B
Django/Jinja
{% set dhcp_networks = query('netbox.netbox.nb_lookup', 'prefixes', api_filter='role=dhcp-pool', raw_data=true)
|
|
| selectattr('vlan') | map(attribute='vlan.vid') | sort -%}
|
|
|
|
# What servers should the DHCP relay forward requests to?
|
|
SERVERS="{{ dhcp }}"
|
|
|
|
# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
|
|
# Always include the interface towards the DHCP server.
|
|
# This variable requires a -i for each interface configured above.
|
|
# This will be used in the actual dhcrelay command
|
|
# For example, "-i eth0 -i eth1"
|
|
INTF_CMD="{{ interfaces | selectattr('parent') | selectattr('parent.name', '==', 'bridge')
|
|
| selectattr('untagged_vlan') | selectattr('untagged_vlan.vid', 'in', dhcp_networks)
|
|
| map(attribute='name') | sort | map('regex_replace', '^', '-id ') | join(' ') }} -iu {{ iface_uplink }} -iu peerlink.4"
|
|
|
|
# Additional options that are passed to the DHCP relay daemon?
|
|
OPTIONS="-U outside"
|