Jinja2 Filters

IP address

napalm_yang.jinja_filters.ip_filters.cidr_to_netmask(value)

Converts a CIDR prefix-length to a network mask.

Examples

>>> "{{ '24'|cidr_to_netmask }}" -> "255.255.255.0"
napalm_yang.jinja_filters.ip_filters.netmask_to_cidr(value)

Converts a network mask to it’s CIDR value.

Examples

>>> "{{ '255.255.255.0'|netmask_to_cidr }}" -> "24"