From bb7a882a469d551531f68ae904cbccb6488c0a20 Mon Sep 17 00:00:00 2001 From: Daniel Ankers Date: Thu, 4 Jul 2024 14:58:03 +0100 Subject: [PATCH] Cope better with no primary IP4 --- juniper-macros.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/juniper-macros.j2 b/juniper-macros.j2 index a8a9b26..70ed381 100644 --- a/juniper-macros.j2 +++ b/juniper-macros.j2 @@ -301,7 +301,9 @@ forwarding-options { {% macro routingoptionssection(device, overlay_as = None, gateway = None, routes = None) %} routing-options { +{% if device.primary_ip4 %} router-id {{ device.primary_ip4.address.ip }}; +{% endif %} {% if overlay_as %} autonomous-system {{ overlay_as }}; {% endif %}