Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor(eos_cli_config_gen): Improve schema for redistributes_routes under address_family_ipv4_multicast, address_family_ipv6 and vrfs for router_bgp #4359

Merged
merged 25 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e565686
added valid values for redistribute routes
MaheshGSLAB Aug 12, 2024
ea23a5d
Merge branch 'devel' into todo-bgp
MaheshGSLAB Aug 13, 2024
d6bf9c2
updated porting guide
MaheshGSLAB Aug 14, 2024
b9703f6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2024
4b845fc
updated porting-guide
MaheshGSLAB Aug 14, 2024
61414ff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2024
ee6d349
updated porting guide
MaheshGSLAB Aug 14, 2024
2adf481
Merge branch 'devel' into todo-bgp
MaheshGSLAB Aug 16, 2024
c3cb4b0
addressed comments
MaheshGSLAB Aug 16, 2024
716ec22
updated j2 and schema with isis levels
MaheshGSLAB Aug 21, 2024
ff3ba04
updated porting guide
MaheshGSLAB Aug 21, 2024
54663db
updated title in porting guide
MaheshGSLAB Aug 21, 2024
e362639
updated the schema for isis level
MaheshGSLAB Aug 21, 2024
b1f0e13
updated the schema
MaheshGSLAB Aug 22, 2024
86ce389
Merge branch 'devel' into todo-bgp
MaheshGSLAB Sep 20, 2024
796de53
updated schema for address_family_ipv4_multicast
MaheshGSLAB Sep 20, 2024
7a90e90
updated schema for redistribute routes
MaheshGSLAB Sep 24, 2024
f9d6b56
fix CI failure
MaheshGSLAB Sep 24, 2024
072847e
Merge branch 'devel' into todo-bgp
carlbuchmann Sep 27, 2024
fc48f82
added few more testcases
MaheshGSLAB Sep 30, 2024
46a1641
updated the logic for ospf and ospfv3
MaheshGSLAB Oct 1, 2024
afee617
updated the description
MaheshGSLAB Oct 1, 2024
3b80e62
updated the schema for vlan aware bundle
MaheshGSLAB Oct 1, 2024
119f30b
fix the j2 logic for include_leaked
MaheshGSLAB Oct 1, 2024
b7e8916
Merge branch 'devel' into todo-bgp
carlbuchmann Oct 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,17 @@ router bgp 65101
network 2001:db8:100::/40
network 2001:db8:200::/40 route-map RM-BAR-MATCH
bgp redistribute-internal
redistribute attached-host
redistribute bgp leaked route-map RM-REDISTRIBUTE-BGP
redistribute connected rcf Address_Family_IPV6_Connected()
redistribute dhcp
redistribute dynamic
redistribute isis
redistribute ospfv3
redistribute ospfv3 match external include leaked
redistribute ospfv3 match internal include leaked route-map RM-REDISTRIBUTE-OSPF-INTERNAL
redistribute ospfv3 match nssa-external 1
redistribute static route-map RM-IPV6-STATIC-TO-BGP
redistribute user
session tracker ST1
recovery delay 666 seconds
session tracker ST2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ ASN Notation: asplain

| VLAN Aware Bundle | Route-Distinguisher | Both Route-Target | Import Route Target | Export Route-Target | Redistribute | VLANs |
| ----------------- | ------------------- | ----------------- | ------------------- | ------------------- | ------------ | ----- |
| B-ELAN-201 | 192.168.255.3:20201 | 20201:20201 | - | - | learned<br>no host-routes | 201 |
| TENANT_A_PROJECT01 | 192.168.255.3:11 | 11:11<br>remote 2:11 | - | - | learned<br>igmp<br>no connected | 110 |
| B-ELAN-201 | 192.168.255.3:20201 | 20201:20201 | - | - | learned<br>no host-route | 201 |
| TENANT_A_PROJECT01 | 192.168.255.3:11 | 11:11<br>remote 2:11 | - | - | learned<br>igmp<br>no static | 110 |
| TENANT_A_PROJECT02 | 192.168.255.3:12 | 12:12 | remote 2:12 | remote 2:12 | learned | 112 |

#### Router BGP VLANs
Expand Down Expand Up @@ -248,7 +248,7 @@ router bgp 65101
rd 192.168.255.3:20201
route-target both 20201:20201
redistribute learned
no redistribute host-routes
no redistribute host-route
vlan 201
!
vlan-aware-bundle TENANT_A_PROJECT01
Expand All @@ -257,7 +257,7 @@ router bgp 65101
route-target import export evpn domain remote 2:11
redistribute igmp
redistribute learned
no redistribute connected
no redistribute static
vlan 110
!
vlan-aware-bundle TENANT_A_PROJECT02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,24 @@ router bgp 65101
neighbor TEST_PEER_GRP next-hop address-family ipv6 originate
neighbor TEST_PEER_GRP activate
!
address-family ipv4 multicast
redistribute attached-host route-map AFIPV4M_ATTACHED_HOST
redistribute connected route-map AFIPV4M_CONNECTED
redistribute isis level-1-2 include leaked route-map AFIPV4M_ISIS
redistribute ospf match internal route-map AFIPV4M_OSPF_INTERNAL
redistribute ospf match external route-map AFIPV4M_OSPF_EXTERNAL
redistribute ospf match nssa-external route-map AFIPV4M_OSPF_NSSA
redistribute ospfv3 route-map AFIPV4M_OSPFV3
redistribute static route-map AFIPV4M_STATIC
!
address-family ipv6
redistribute bgp leaked route-map RM-REDISTRIBUTE-BGP
redistribute connected rcf Address_Family_IPV6_Connected()
redistribute ospfv3 match internal include leaked route-map RM-REDISTRIBUTE-OSPF-INTERNAL
redistribute ospfv3 match external include leaked
redistribute ospfv3 match nssa-external 1
redistribute static route-map RM-IPV6-STATIC-TO-BGP
!
vrf TENANT_A_PROJECT01
rd 192.168.255.3:11
route-target import evpn 11:11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ASN Notation: asplain

| VRF | Route-Distinguisher | Redistribute |
| --- | ------------------- | ------------ |
| Tenant_A | 10.50.64.15:30001 | ospf<br>ospfv3<br>ospfv3<br>connected |
| Tenant_A | 10.50.64.15:30001 | ospf<br>ospfv3<br>connected |
| Tenant_B | 10.50.64.15:30002 | - |

#### Router BGP Device Configuration
Expand Down Expand Up @@ -240,10 +240,14 @@ router bgp 65100
neighbor IPV4-UNDERLAY activate
neighbor IPV4-UNDERLAY-MLAG activate
redistribute attached-host
redistribute connected
redistribute isis rcf Router_BGP_Isis()
redistribute ospf match external
redistribute ospf match internal
redistribute ospf match external
redistribute ospf match nssa-external 2
redistribute ospfv3 match internal
redistribute ospfv3 match external
redistribute ospfv3 match nssa-external 2
!
address-family ipv6
neighbor IPV6-UNDERLAY route-map RM-HIDE-AS-PATH in
Expand All @@ -252,6 +256,16 @@ router bgp 65100
neighbor IPV6-UNDERLAY-MLAG activate
neighbor TEST_RCF rcf in Address_Family_IPV6_In()
neighbor TEST_RCF rcf out Address_Family_IPV6_Out()
redistribute attached-host route-map RM-Address_Family_IPV6_Attached-Host
redistribute bgp leaked
redistribute connected route-map RM-Address_Family_IPV6_Connected
redistribute dhcp route-map RM-Address_Family_IPV6_DHCP
redistribute dynamic rcf RCF_Address_Family_IPV6_Dynamic()
redistribute isis include leaked route-map RM-Address_Family_IPV6_ISIS
redistribute ospfv3 include leaked route-map RM-REDISTRIBUTE-OSPFV3
redistribute ospfv3 match external include leaked route-map RM-REDISTRIBUTE-OSPFV3-EXTERNAL
redistribute static include leaked rcf RCF_IPV6_STATIC_TO_BGP{}
redistribute user rcf RCF_Address_Family_IPV6_User()
!
vrf Tenant_A
rd 10.50.64.15:30001
Expand All @@ -264,7 +278,7 @@ router bgp 65100
route-target export evpn rcf RT_EXPORT_AF_RCF()
redistribute connected
redistribute ospf match external include leaked
redistribute ospfv3 match internal
redistribute ospfv3
redistribute ospfv3 match nssa-external
!
vrf Tenant_B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ ASN Notation: asplain

| VRF | Route-Distinguisher | Redistribute |
| --- | ------------------- | ------------ |
| VRF01 | - | - |
| VRF02 | - | - |
| VRF01 | - | user<br>static<br>rip<br>ospf<br>ospfv3<br>isis<br>connected<br>bgp<br>attached_host |
| VRF02 | - | dynamic<br>user<br>static<br>rip<br>ospf<br>ospfv3<br>isis<br>connected<br>bgp<br>attached_host |
| VRF03 | - | dynamic |

#### Router BGP Device Configuration
Expand Down Expand Up @@ -87,6 +87,15 @@ router bgp 65001
!
vrf VRF01
no bgp redistribute-internal
redistribute attached-host route-map RM_VRF_ATTACHED-HOST
redistribute bgp leaked route-map RM_VRF_BGP
redistribute connected include leaked rcf RCF_VRF_CONNECTED()
redistribute isis level-2 rcf RCF_VRF_ISIS()
redistribute ospf match nssa-external route-map RM_VRF_OSPFV3
redistribute ospfv3 match internal include leaked route-map RM_VRF_OSPF
redistribute rip route-map RM_VRF_RIP
redistribute static route-map RM_VRF_STATIC
redistribute user rcf RCF_VRF_USER()
!
address-family flow-spec ipv4
bgp missing-policy direction in action permit
Expand Down Expand Up @@ -160,6 +169,16 @@ router bgp 65001
redistribute static route-map VRF_AFIPV6MULTI_RM_STATIC
!
vrf VRF02
redistribute attached-host
redistribute bgp leaked
redistribute connected
redistribute dynamic
redistribute isis level-2 route-map RM_VRF_ISIS
redistribute ospf include leaked
redistribute ospfv3 match external
redistribute rip
redistribute static
redistribute user
!
address-family ipv4
bgp additional-paths send backup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,17 @@ router bgp 65101
network 2001:db8:100::/40
network 2001:db8:200::/40 route-map RM-BAR-MATCH
bgp redistribute-internal
redistribute attached-host
redistribute bgp leaked route-map RM-REDISTRIBUTE-BGP
redistribute connected rcf Address_Family_IPV6_Connected()
redistribute dhcp
redistribute dynamic
redistribute isis
redistribute ospfv3
redistribute ospfv3 match external include leaked
redistribute ospfv3 match internal include leaked route-map RM-REDISTRIBUTE-OSPF-INTERNAL
redistribute ospfv3 match nssa-external 1
redistribute static route-map RM-IPV6-STATIC-TO-BGP
redistribute user
session tracker ST1
recovery delay 666 seconds
session tracker ST2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ router bgp 65101
rd 192.168.255.3:20201
route-target both 20201:20201
redistribute learned
no redistribute host-routes
no redistribute host-route
vlan 201
!
vlan-aware-bundle TENANT_A_PROJECT01
Expand All @@ -80,7 +80,7 @@ router bgp 65101
route-target import export evpn domain remote 2:11
redistribute igmp
redistribute learned
no redistribute connected
no redistribute static
vlan 110
!
vlan-aware-bundle TENANT_A_PROJECT02
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@ router bgp 65101
neighbor TEST_PEER_GRP next-hop address-family ipv6 originate
neighbor TEST_PEER_GRP activate
!
address-family ipv4 multicast
redistribute attached-host route-map AFIPV4M_ATTACHED_HOST
redistribute connected route-map AFIPV4M_CONNECTED
redistribute isis level-1-2 include leaked route-map AFIPV4M_ISIS
redistribute ospf match internal route-map AFIPV4M_OSPF_INTERNAL
redistribute ospf match external route-map AFIPV4M_OSPF_EXTERNAL
redistribute ospf match nssa-external route-map AFIPV4M_OSPF_NSSA
redistribute ospfv3 route-map AFIPV4M_OSPFV3
redistribute static route-map AFIPV4M_STATIC
!
address-family ipv6
redistribute bgp leaked route-map RM-REDISTRIBUTE-BGP
redistribute connected rcf Address_Family_IPV6_Connected()
redistribute ospfv3 match internal include leaked route-map RM-REDISTRIBUTE-OSPF-INTERNAL
redistribute ospfv3 match external include leaked
redistribute ospfv3 match nssa-external 1
redistribute static route-map RM-IPV6-STATIC-TO-BGP
!
vrf TENANT_A_PROJECT01
rd 192.168.255.3:11
route-target import evpn 11:11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@ router bgp 65100
neighbor IPV4-UNDERLAY activate
neighbor IPV4-UNDERLAY-MLAG activate
redistribute attached-host
redistribute connected
redistribute isis rcf Router_BGP_Isis()
redistribute ospf match external
redistribute ospf match internal
redistribute ospf match external
redistribute ospf match nssa-external 2
redistribute ospfv3 match internal
redistribute ospfv3 match external
redistribute ospfv3 match nssa-external 2
!
address-family ipv6
neighbor IPV6-UNDERLAY route-map RM-HIDE-AS-PATH in
Expand All @@ -108,6 +112,16 @@ router bgp 65100
neighbor IPV6-UNDERLAY-MLAG activate
neighbor TEST_RCF rcf in Address_Family_IPV6_In()
neighbor TEST_RCF rcf out Address_Family_IPV6_Out()
redistribute attached-host route-map RM-Address_Family_IPV6_Attached-Host
redistribute bgp leaked
redistribute connected route-map RM-Address_Family_IPV6_Connected
redistribute dhcp route-map RM-Address_Family_IPV6_DHCP
redistribute dynamic rcf RCF_Address_Family_IPV6_Dynamic()
redistribute isis include leaked route-map RM-Address_Family_IPV6_ISIS
redistribute ospfv3 include leaked route-map RM-REDISTRIBUTE-OSPFV3
redistribute ospfv3 match external include leaked route-map RM-REDISTRIBUTE-OSPFV3-EXTERNAL
redistribute static include leaked rcf RCF_IPV6_STATIC_TO_BGP{}
redistribute user rcf RCF_Address_Family_IPV6_User()
!
vrf Tenant_A
rd 10.50.64.15:30001
Expand All @@ -120,7 +134,7 @@ router bgp 65100
route-target export evpn rcf RT_EXPORT_AF_RCF()
redistribute connected
redistribute ospf match external include leaked
redistribute ospfv3 match internal
redistribute ospfv3
redistribute ospfv3 match nssa-external
!
vrf Tenant_B
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ router bgp 65001
!
vrf VRF01
no bgp redistribute-internal
redistribute attached-host route-map RM_VRF_ATTACHED-HOST
redistribute bgp leaked route-map RM_VRF_BGP
redistribute connected include leaked rcf RCF_VRF_CONNECTED()
redistribute isis level-2 rcf RCF_VRF_ISIS()
redistribute ospf match nssa-external route-map RM_VRF_OSPFV3
redistribute ospfv3 match internal include leaked route-map RM_VRF_OSPF
redistribute rip route-map RM_VRF_RIP
redistribute static route-map RM_VRF_STATIC
redistribute user rcf RCF_VRF_USER()
!
address-family flow-spec ipv4
bgp missing-policy direction in action permit
Expand Down Expand Up @@ -105,6 +114,16 @@ router bgp 65001
redistribute static route-map VRF_AFIPV6MULTI_RM_STATIC
!
vrf VRF02
redistribute attached-host
redistribute bgp leaked
redistribute connected
redistribute dynamic
redistribute isis level-2 route-map RM_VRF_ISIS
redistribute ospf include leaked
redistribute ospfv3 match external
redistribute rip
redistribute static
redistribute user
!
address-family ipv4
bgp additional-paths send backup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,24 +158,38 @@ router_bgp:
- ip_address: 2001:db8::2
rcf_in: Address_Family_IPV6_In()
rcf_out: Address_Family_IPV6_Out()
redistribute_routes:
- source_protocol: ospfv3
include_leaked: true
ospf_route_type: external
- source_protocol: ospfv3
ospf_route_type: internal
route_map: RM-REDISTRIBUTE-OSPF-INTERNAL
include_leaked: true
- source_protocol: ospfv3
ospf_route_type: nssa-external 1
- source_protocol: static
redistribute:
ospfv3:
enabled: true
match_external:
enabled: true
include_leaked: true
match_internal:
enabled: true
route_map: RM-REDISTRIBUTE-OSPF-INTERNAL
include_leaked: true
match_nssa_external:
enabled: true
nssa_type: 1
static:
enabled: true
route_map: RM-IPV6-STATIC-TO-BGP
- source_protocol: bgp
bgp:
enabled: true
route_map: RM-REDISTRIBUTE-BGP
# this should not do anything as leaked is generated when source protocol is bgp
include_leaked: true
- source_protocol: connected
connected:
enabled: true
rcf: Address_Family_IPV6_Connected()
attached_host:
enabled: true
dhcp:
enabled: true
dynamic:
enabled: true
user:
enabled: true
isis:
enabled: true
neighbors:
- ip_address: 192.0.3.1
remote_as: 65432
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,14 @@ router_bgp:
rib_in_pre_policy_retain:
enabled: true
all: false
redistribute_routes:
- source_protocol: connected
- source_protocol: static
redistribute:
connected:
enabled: true
static:
enabled: true
rcf: Router_BGP_Static()
- source_protocol: isis
isis:
enabled: true
route_map: Router_BGP_Isis
- name: TENANT_A_PROJECT02
router_id: 192.168.255.3
Expand All @@ -124,5 +127,6 @@ router_bgp:
neighbors:
- ip_address: 10.255.251.1
peer_group: MLAG-IPv4-UNDERLAY-PEER
redistribute_routes:
- source_protocol: connected
redistribute:
connected:
enabled: true
Loading
Loading