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

Feat(eos_designs): Add l3_edge.l3_interfaces support #3426

Merged
merged 6 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
@@ -0,0 +1,80 @@
!RANCID-CONTENT-TYPE: arista
!
vlan internal order ascending range 1006 1199
!
transceiver qsfp default-mode 4x10G
!
service routing protocols model multi-agent
!
hostname l3_edge_l3_interfaces
!
spanning-tree mode none
!
no enable password
no aaa root
!
vrf instance MGMT
!
interface Ethernet1
description peer1 eth1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we automatically build the description with an underscore i.e peer1_eth1

no shutdown
no switchport
ip address 192.168.1.2/31
service-policy type qos input TEST_POLICY
service-profile TEST-QOS-PROFILE
! TEST RAW_EOS_CLI

!
interface Ethernet2/2
description peer2
no shutdown
no switchport
ip address dhcp
dhcp client accept default-route
!
interface Ethernet42
description This is a custom description
shutdown
no switchport
ip address dhcp
!
interface Ethernet43
shutdown
no switchport
ip address 192.168.42.42/24
!
interface Loopback0
description EVPN_Overlay_Peering
no shutdown
ip address 1.2.3.1/32
!
ip routing
no ip routing vrf MGMT
!
ip prefix-list PL-LOOPBACKS-EVPN-OVERLAY
seq 10 permit 1.2.3.4/24 eq 32
!
route-map RM-CONN-2-BGP permit 10
match ip address prefix-list PL-LOOPBACKS-EVPN-OVERLAY
!
router bgp 65000
router-id 1.2.3.1
maximum-paths 4 ecmp 4
update wait-install
no bgp default ipv4-unicast
neighbor IPv4-UNDERLAY-PEERS peer group
neighbor IPv4-UNDERLAY-PEERS send-community
neighbor IPv4-UNDERLAY-PEERS maximum-routes 12000
redistribute connected route-map RM-CONN-2-BGP
!
address-family ipv4
neighbor IPv4-UNDERLAY-PEERS activate
!
management api http-commands
protocol https
no shutdown
!
vrf MGMT
no shutdown
!
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
hostname: l3_edge_l3_interfaces
is_deployed: true
router_bgp:
as: '65000'
router_id: 1.2.3.1
bgp:
default:
ipv4_unicast: false
maximum_paths:
paths: 4
ecmp: 4
updates:
wait_install: true
peer_groups:
- name: IPv4-UNDERLAY-PEERS
type: ipv4
maximum_routes: 12000
send_community: all
address_family_ipv4:
peer_groups:
- name: IPv4-UNDERLAY-PEERS
activate: true
redistribute_routes:
- source_protocol: connected
route_map: RM-CONN-2-BGP
service_routing_protocols_model: multi-agent
ip_routing: true
vlan_internal_order:
allocation: ascending
range:
beginning: 1006
ending: 1199
spanning_tree:
mode: none
vrfs:
- name: MGMT
ip_routing: false
management_api_http:
enable_vrfs:
- name: MGMT
enable_https: true
loopback_interfaces:
- name: Loopback0
description: EVPN_Overlay_Peering
shutdown: false
ip_address: 1.2.3.1/32
prefix_lists:
- name: PL-LOOPBACKS-EVPN-OVERLAY
sequence_numbers:
- sequence: 10
action: permit 1.2.3.4/24 eq 32
route_maps:
- name: RM-CONN-2-BGP
sequence_numbers:
- sequence: 10
type: permit
match:
- ip address prefix-list PL-LOOPBACKS-EVPN-OVERLAY
ethernet_interfaces:
- name: Ethernet1
peer_type: l3_interface
peer: peer1
peer_interface: eth1
ip_address: 192.168.1.2/31
shutdown: false
type: routed
description: peer1 eth1
service_profile: TEST-QOS-PROFILE
eos_cli: '! TEST RAW_EOS_CLI

'
service_policy:
qos:
input: TEST_POLICY
- name: Ethernet2/2
peer_type: l3_interface
peer: peer2
ip_address: dhcp
shutdown: false
type: routed
description: peer2
dhcp_client_accept_default_route: true
- name: Ethernet42
peer_type: l3_interface
peer: peer3
ip_address: dhcp
shutdown: true
type: routed
description: This is a custom description
- name: Ethernet43
peer_type: l3_interface
ip_address: 192.168.42.42/24
shutdown: true
type: routed
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
type: spine
spine:
nodes:
- name: l3_edge_l3_interfaces
id: 1
evpn_role: "none"
loopback_ipv4_pool: 1.2.3.4/24
bgp_as: 65000

l3_edge:
l3_interfaces_profiles:
- profile: profile1
speed: "forced 10000full"
qos_profile: TEST-QOS-PROFILE
structured_config:
service_policy:
qos:
input: TEST_POLICY
raw_eos_cli: |
! TEST RAW_EOS_CLI
l3_interfaces:
# Settings set via profile
- node: l3_edge_l3_interfaces
peer: peer1
peer_interface: eth1
interface: Ethernet1
ip: 192.168.1.2/31
profile: profile1
# DHCP default route
- node: l3_edge_l3_interfaces
peer: peer2
interface: Ethernet2/2
ip: dhcp
dhcp_client_accept_default_route: True
# custom descriptipon
- node: l3_edge_l3_interfaces
peer: peer3
interface: Ethernet42
enabled: False
description: This is a custom description
ip: dhcp
# empty description
- node: l3_edge_l3_interfaces
interface: Ethernet43
enabled: False
ip: 192.168.42.42/24
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ all:
l3_edge_bgp:
l3_edge_ospf:
l3_edge_isis:
l3_edge_l3_interfaces:
UPLINK_NATIVE_VLAN_TESTS:
hosts:
uplink-native-vlan-grandparent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ipv4_pool</samp>](## "core_interfaces.p2p_links_ip_pools.[].ipv4_pool") | String | | | | IPv4 address/Mask. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prefix_size</samp>](## "core_interfaces.p2p_links_ip_pools.[].prefix_size") | Integer | | `31` | Min: 8<br>Max: 31 | Subnet mask size. |
| [<samp>&nbsp;&nbsp;p2p_links_profiles</samp>](## "core_interfaces.p2p_links_profiles") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;name</samp>](## "core_interfaces.p2p_links_profiles.[].name") | String | Required, Unique | | | P2P profile name. Any variable supported under p2p_links can be inherited from a profile. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;name</samp>](## "core_interfaces.p2p_links_profiles.[].name") | String | Required, Unique | | | P2P profile name. Any variable supported under `p2p_links` can be inherited from a profile. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id</samp>](## "core_interfaces.p2p_links_profiles.[].id") | Integer | | | | Unique id per subnet_summary. Used to calculate ip addresses.<br>Required with ip_pool. ID starting from 1.<br> |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;speed</samp>](## "core_interfaces.p2p_links_profiles.[].speed") | String | | | | Speed should be set in the format `<interface_speed>` or `forced <interface_speed>` or `auto <interface_speed>`. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ip_pool</samp>](## "core_interfaces.p2p_links_profiles.[].ip_pool") | String | | | | P2P pool name. IP Pool defined under p2p_links_ip_pools. A /31 will be taken from the pool per P2P link. |
Expand Down Expand Up @@ -92,6 +92,35 @@
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;&lt;str&gt;</samp>](## "core_interfaces.p2p_links.[].port_channel.nodes_child_interfaces.[].interfaces.[]") | String | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw_eos_cli</samp>](## "core_interfaces.p2p_links.[].raw_eos_cli") | String | | | | EOS CLI rendered directly on the point-to-point interface in the final EOS configuration. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;structured_config</samp>](## "core_interfaces.p2p_links.[].structured_config") | Dictionary | | | | Custom structured config for interfaces<br>Note! The content of this dictionary is _not_ validated by the schema, since it can be either ethernet_interfaces or port_channel_interfaces. |
| [<samp>&nbsp;&nbsp;l3_interfaces_profiles</samp>](## "core_interfaces.l3_interfaces_profiles") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;profile</samp>](## "core_interfaces.l3_interfaces_profiles.[].profile") | String | Required, Unique | | | L3 interface profile name. Any variable supported under `l3_interfaces` can be inherited from a profile. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface</samp>](## "core_interfaces.l3_interfaces_profiles.[].interface") | String | | | Pattern: Ethernet[\d/]+ | Ethernet interface name like 'Ethernet2'. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description</samp>](## "core_interfaces.l3_interfaces_profiles.[].description") | String | | | | Interface description.<br>If not set a default description will be configured with '[<peer>[ <peer_interface>]]' |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ip</samp>](## "core_interfaces.l3_interfaces_profiles.[].ip") | String | | | | Node IPv4 address/Mask or 'dhcp'. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dhcp_client_accept_default_route</samp>](## "core_interfaces.l3_interfaces_profiles.[].dhcp_client_accept_default_route") | Boolean | | `False` | | Supported if `ip` is `dhcp`.<br>Accepts default route from DHCP. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled</samp>](## "core_interfaces.l3_interfaces_profiles.[].enabled") | Boolean | | `True` | | Enable or Shutdown the interface. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;speed</samp>](## "core_interfaces.l3_interfaces_profiles.[].speed") | String | | | | Speed should be set in the format `<interface_speed>` or `forced <interface_speed>` or `auto <interface_speed>`. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;peer</samp>](## "core_interfaces.l3_interfaces_profiles.[].peer") | String | | | | The peer device name. Used for description and documentation |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;peer_interface</samp>](## "core_interfaces.l3_interfaces_profiles.[].peer_interface") | String | | | | The peer device interface. Used for description and documentation |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;peer_ip</samp>](## "core_interfaces.l3_interfaces_profiles.[].peer_ip") | String | | | | The peer device IP. Used for description and documentation |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qos_profile</samp>](## "core_interfaces.l3_interfaces_profiles.[].qos_profile") | String | | | | QOS service profile. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw_eos_cli</samp>](## "core_interfaces.l3_interfaces_profiles.[].raw_eos_cli") | String | | | | EOS CLI rendered directly on the interface in the final EOS configuration. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;structured_config</samp>](## "core_interfaces.l3_interfaces_profiles.[].structured_config") | Dictionary | | | | Custom structured config for the Ethernet interface. |
| [<samp>&nbsp;&nbsp;l3_interfaces</samp>](## "core_interfaces.l3_interfaces") | List, items: Dictionary | | | | |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;node</samp>](## "core_interfaces.l3_interfaces.[].node") | String | | | | Device on which the interface should be configured. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;profile</samp>](## "core_interfaces.l3_interfaces.[].profile") | String | | | | L3 interface profile name. Profile defined under l3_interfaces_profiles. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interface</samp>](## "core_interfaces.l3_interfaces.[].interface") | String | | | Pattern: Ethernet[\d/]+ | Ethernet interface name like 'Ethernet2'. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description</samp>](## "core_interfaces.l3_interfaces.[].description") | String | | | | Interface description.<br>If not set a default description will be configured with '[<peer>[ <peer_interface>]]' |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ip</samp>](## "core_interfaces.l3_interfaces.[].ip") | String | | | | Node IPv4 address/Mask or 'dhcp'. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dhcp_client_accept_default_route</samp>](## "core_interfaces.l3_interfaces.[].dhcp_client_accept_default_route") | Boolean | | `False` | | Supported if `ip` is `dhcp`.<br>Accepts default route from DHCP. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enabled</samp>](## "core_interfaces.l3_interfaces.[].enabled") | Boolean | | `True` | | Enable or Shutdown the interface. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;speed</samp>](## "core_interfaces.l3_interfaces.[].speed") | String | | | | Speed should be set in the format `<interface_speed>` or `forced <interface_speed>` or `auto <interface_speed>`. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;peer</samp>](## "core_interfaces.l3_interfaces.[].peer") | String | | | | The peer device name. Used for description and documentation |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;peer_interface</samp>](## "core_interfaces.l3_interfaces.[].peer_interface") | String | | | | The peer device interface. Used for description and documentation |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;peer_ip</samp>](## "core_interfaces.l3_interfaces.[].peer_ip") | String | | | | The peer device IP. Used for description and documentation |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qos_profile</samp>](## "core_interfaces.l3_interfaces.[].qos_profile") | String | | | | QOS service profile. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raw_eos_cli</samp>](## "core_interfaces.l3_interfaces.[].raw_eos_cli") | String | | | | EOS CLI rendered directly on the interface in the final EOS configuration. |
| [<samp>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;structured_config</samp>](## "core_interfaces.l3_interfaces.[].structured_config") | Dictionary | | | | Custom structured config for the Ethernet interface. |

=== "YAML"

Expand All @@ -109,7 +138,7 @@
prefix_size: <int; 8-31; default=31>
p2p_links_profiles:

# P2P profile name. Any variable supported under p2p_links can be inherited from a profile.
# P2P profile name. Any variable supported under `p2p_links` can be inherited from a profile.
- name: <str; required; unique>

# Unique id per subnet_summary. Used to calculate ip addresses.
Expand Down Expand Up @@ -317,4 +346,91 @@
# Custom structured config for interfaces
# Note! The content of this dictionary is _not_ validated by the schema, since it can be either ethernet_interfaces or port_channel_interfaces.
structured_config: <dict>
l3_interfaces_profiles:

# L3 interface profile name. Any variable supported under `l3_interfaces` can be inherited from a profile.
- profile: <str; required; unique>

# Ethernet interface name like 'Ethernet2'.
interface: <str>

# Interface description.
# If not set a default description will be configured with '[<peer>[ <peer_interface>]]'
description: <str>

# Node IPv4 address/Mask or 'dhcp'.
ip: <str>

# Supported if `ip` is `dhcp`.
# Accepts default route from DHCP.
dhcp_client_accept_default_route: <bool; default=False>

# Enable or Shutdown the interface.
enabled: <bool; default=True>

# Speed should be set in the format `<interface_speed>` or `forced <interface_speed>` or `auto <interface_speed>`.
speed: <str>

# The peer device name. Used for description and documentation
peer: <str>

# The peer device interface. Used for description and documentation
peer_interface: <str>

# The peer device IP. Used for description and documentation
peer_ip: <str>

# QOS service profile.
qos_profile: <str>

# EOS CLI rendered directly on the interface in the final EOS configuration.
raw_eos_cli: <str>

# Custom structured config for the Ethernet interface.
structured_config: <dict>
l3_interfaces:

# Device on which the interface should be configured.
- node: <str>

# L3 interface profile name. Profile defined under l3_interfaces_profiles.
profile: <str>

# Ethernet interface name like 'Ethernet2'.
interface: <str>

# Interface description.
# If not set a default description will be configured with '[<peer>[ <peer_interface>]]'
description: <str>

# Node IPv4 address/Mask or 'dhcp'.
ip: <str>

# Supported if `ip` is `dhcp`.
# Accepts default route from DHCP.
dhcp_client_accept_default_route: <bool; default=False>

# Enable or Shutdown the interface.
enabled: <bool; default=True>

# Speed should be set in the format `<interface_speed>` or `forced <interface_speed>` or `auto <interface_speed>`.
speed: <str>

# The peer device name. Used for description and documentation
peer: <str>

# The peer device interface. Used for description and documentation
peer_interface: <str>

# The peer device IP. Used for description and documentation
peer_ip: <str>

# QOS service profile.
qos_profile: <str>

# EOS CLI rendered directly on the interface in the final EOS configuration.
raw_eos_cli: <str>

# Custom structured config for the Ethernet interface.
structured_config: <dict>
```
Loading