Get custom field in config template #15528
-
Hello everyone. I have defined a custom field in netbox: I link this field with an IP address (IPAM> IP Address) Now I would like to retrieve the address in a config template. Can any of you give me a tip on how to do this? Thank you very much! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Tried this one! :-( |
Beta Was this translation helpful? Give feedback.
-
I figured it out myself! Maybe it helps someone else! ;) Working: |
Beta Was this translation helpful? Give feedback.
I figured it out myself! Maybe it helps someone else! ;)
Working:
{% for interface in device.interfaces.all() %}
{% if interface.name == "ether1" %}
{{ interface.cf["default_gateway"] }}
{% endif %}
{% endfor %}