From c9497253cb40e75d09e89d91fa08ffc36be8eb5c Mon Sep 17 00:00:00 2001
From: Wered <kylem@serverforge.org>
Date: Fri, 19 May 2023 18:13:47 +0000
Subject: T5230: Added missing enforce-first-as option to bgp protocol common
 config and frr bgp jinja template.

---
 data/templates/frr/bgpd.frr.j2                                 | 3 +++
 interface-definitions/include/bgp/protocol-common-config.xml.i | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/data/templates/frr/bgpd.frr.j2 b/data/templates/frr/bgpd.frr.j2
index 7bd9efdce..5e789304a 100644
--- a/data/templates/frr/bgpd.frr.j2
+++ b/data/templates/frr/bgpd.frr.j2
@@ -86,6 +86,9 @@
 {% if config.solo is vyos_defined %}
  neighbor {{ neighbor }} solo
 {% endif %}
+{% if config.enforce_first_as is vyos_defined %}	
+ neighbor {{ neighbor }} enforce-first-as	
+{% endif %}
 {% if config.strict_capability_match is vyos_defined %}
  neighbor {{ neighbor }} strict-capability-match
 {% endif %}
diff --git a/interface-definitions/include/bgp/protocol-common-config.xml.i b/interface-definitions/include/bgp/protocol-common-config.xml.i
index 2d36f7de6..d69fd7dab 100644
--- a/interface-definitions/include/bgp/protocol-common-config.xml.i
+++ b/interface-definitions/include/bgp/protocol-common-config.xml.i
@@ -1016,6 +1016,12 @@
         <valueless/>
       </properties>
     </leafNode>
+    <leafNode name="enforce-first-as">
+      <properties>
+        <help>Ensure the first AS in the AS path matches the peer AS</help>
+        <valueless/>
+      </properties>
+    </leafNode>
     <leafNode name="strict-capability-match">
       <properties>
         <help>Enable strict capability negotiation</help>
-- 
cgit v1.2.3