diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md index d84487ab92c..b370a660e03 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/host1.md @@ -10826,6 +10826,15 @@ router segment-security | ----------------- | --------- | | 200 | ingress | +#### Interfaces metric bandwidth + +| Interface name | Transmit Bandwidth (Mbps) | Receive Bandwidth (Mbps) | +| -------------- | ------------------------- | ------------------------ | +| Ethernet1 | - | 100 | +| Ethernet2 | - | - | +| Ethernet3 | 200 | - | +| Port-Channel4 | 200 | 100 | + #### Path Groups ##### Path Group PG-1 @@ -10944,6 +10953,18 @@ router path-selection peer dynamic source stun tcp mss ceiling ipv4 200 ingress ! + interface Ethernet1 + metric bandwidth receive 100 Mbps + ! + interface Ethernet2 + ! + interface Ethernet3 + metric bandwidth transmit 200 Mbps + ! + interface Port-Channel4 + metric bandwidth transmit 200 Mbps + metric bandwidth receive 100 Mbps + ! path-group PG-1 id 666 keepalive interval 200 milliseconds failure-threshold 3 intervals ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg index e213b30b800..4f790e274ed 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/intended/configs/host1.cfg @@ -805,6 +805,18 @@ router path-selection peer dynamic source stun tcp mss ceiling ipv4 200 ingress ! + interface Ethernet1 + metric bandwidth receive 100 Mbps + ! + interface Ethernet2 + ! + interface Ethernet3 + metric bandwidth transmit 200 Mbps + ! + interface Port-Channel4 + metric bandwidth transmit 200 Mbps + metric bandwidth receive 100 Mbps + ! path-group PG-1 id 666 keepalive interval 200 milliseconds failure-threshold 3 intervals ! diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-path-selection.yml b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-path-selection.yml index 85235f4f670..3c6c0f5abbd 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-path-selection.yml +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/inventory/host_vars/host1/router-path-selection.yml @@ -139,3 +139,15 @@ router_path_selection: - name: VRF-3 tcp_mss_ceiling: ipv4_segment_size: 200 + interfaces: + - name: Ethernet2 + - name: Port-Channel4 + metric_bandwidth: + receive: 100 + transmit: 200 + - name: Ethernet3 + metric_bandwidth: + transmit: 200 + - name: Ethernet1 + metric_bandwidth: + receive: 100 diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-path-selection.md b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-path-selection.md index f39492d5086..100a9530949 100644 --- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-path-selection.md +++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/docs/tables/router-path-selection.md @@ -62,6 +62,11 @@ | [  tcp_mss_ceiling](## "router_path_selection.tcp_mss_ceiling") | Dictionary | | | | | | [    ipv4_segment_size](## "router_path_selection.tcp_mss_ceiling.ipv4_segment_size") | String | | | | Segment Size for IPv4.
Can be an integer in the range 64-65515 or "auto".
"auto" will enable auto-discovery which clamps the TCP MSS value to the minimum of all the direct paths
and multi-hop path MTU towards a remote VTEP (minus 40bytes to account for IP + TCP header). | | [    direction](## "router_path_selection.tcp_mss_ceiling.direction") | String | | `ingress` | Valid Values:
- ingress | Enforce on packets through DPS tunnel for a specific direction.
Only 'ingress' direction is supported. | + | [  interfaces](## "router_path_selection.interfaces") | List, items: Dictionary | | | | | + | [    - name](## "router_path_selection.interfaces.[].name") | String | Required, Unique | | | | + | [      metric_bandwidth](## "router_path_selection.interfaces.[].metric_bandwidth") | Dictionary | | | | Allow maximum metric bandwidth. | + | [        receive](## "router_path_selection.interfaces.[].metric_bandwidth.receive") | Integer | | | Min: 1
Max: 4294967295 | Maximum receive bandwidth in Mbps. | + | [        transmit](## "router_path_selection.interfaces.[].metric_bandwidth.transmit") | Integer | | | Min: 1
Max: 4294967295 | Maximum transmit bandwidth in Mbps. | === "YAML" @@ -200,4 +205,15 @@ # Enforce on packets through DPS tunnel for a specific direction. # Only 'ingress' direction is supported. direction: + interfaces: + - name: + + # Allow maximum metric bandwidth. + metric_bandwidth: + + # Maximum receive bandwidth in Mbps. + receive: + + # Maximum transmit bandwidth in Mbps. + transmit: ``` diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-path-selection.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-path-selection.j2 index 6083373d3ba..4d873ff292b 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-path-selection.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/router-path-selection.j2 @@ -23,6 +23,16 @@ | ----------------- | --------- | | {{ router_path_selection.tcp_mss_ceiling.ipv4_segment_size }} | {{ router_path_selection.tcp_mss_ceiling.direction | arista.avd.default("ingress") }} | {% endif %} +{% if router_path_selection.interfaces is arista.avd.defined %} + +#### Interfaces metric bandwidth + +| Interface name | Transmit Bandwidth (Mbps) | Receive Bandwidth (Mbps) | +| -------------- | ------------------------- | ------------------------ | +{% for interface_data in router_path_selection.interfaces | arista.avd.natural_sort('name') %} +| {{ interface_data.name }} | {{ interface_data.metric_bandwidth.transmit | arista.avd.default("-") }} | {{ interface_data.metric_bandwidth.receive | arista.avd.default("-") }} | +{% endfor %} +{% endif %} {% if router_path_selection.path_groups is arista.avd.defined %} #### Path Groups diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-path-selection.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-path-selection.j2 index 8952d0a81db..8e0488de411 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-path-selection.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/router-path-selection.j2 @@ -17,6 +17,16 @@ router path-selection {% endif %} {{ tcp_mss_ceiling_cli }} {{ router_path_selection.tcp_mss_ceiling.direction | arista.avd.default("ingress") }} {% endif %} +{% for interface_data in router_path_selection.interfaces | arista.avd.natural_sort('name') %} + ! + interface {{ interface_data.name }} +{% if interface_data.metric_bandwidth.transmit is arista.avd.defined %} + metric bandwidth transmit {{ interface_data.metric_bandwidth.transmit }} Mbps +{% endif %} +{% if interface_data.metric_bandwidth.receive is arista.avd.defined %} + metric bandwidth receive {{ interface_data.metric_bandwidth.receive }} Mbps +{% endif %} +{% endfor %} {# path group #} {% for path_group in router_path_selection.path_groups | arista.avd.natural_sort('name') %} {% set path_group_def = "path-group " ~ path_group.name %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py b/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py index f35545f25db..81c62fd69c5 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/__init__.py @@ -61155,6 +61155,83 @@ def __init__( """ + class InterfacesItem(AvdModel): + """Subclass of AvdModel.""" + + class MetricBandwidth(AvdModel): + """Subclass of AvdModel.""" + + _fields: ClassVar[dict] = {"receive": {"type": int}, "transmit": {"type": int}, "_custom_data": {"type": dict}} + receive: int | None + """Maximum receive bandwidth in Mbps.""" + transmit: int | None + """Maximum transmit bandwidth in Mbps.""" + _custom_data: dict[str, Any] + + if TYPE_CHECKING: + + def __init__( + self, + *, + receive: int | None | UndefinedType = Undefined, + transmit: int | None | UndefinedType = Undefined, + _custom_data: dict[str, Any] | UndefinedType = Undefined, + ) -> None: + """ + MetricBandwidth. + + + Subclass of AvdModel. + + Args: + receive: Maximum receive bandwidth in Mbps. + transmit: Maximum transmit bandwidth in Mbps. + _custom_data: _custom_data + + """ + + _fields: ClassVar[dict] = {"name": {"type": str}, "metric_bandwidth": {"type": MetricBandwidth}, "_custom_data": {"type": dict}} + name: str + metric_bandwidth: MetricBandwidth + """ + Allow maximum metric bandwidth. + + Subclass of AvdModel. + """ + _custom_data: dict[str, Any] + + if TYPE_CHECKING: + + def __init__( + self, + *, + name: str | UndefinedType = Undefined, + metric_bandwidth: MetricBandwidth | UndefinedType = Undefined, + _custom_data: dict[str, Any] | UndefinedType = Undefined, + ) -> None: + """ + InterfacesItem. + + + Subclass of AvdModel. + + Args: + name: name + metric_bandwidth: + Allow maximum metric bandwidth. + + Subclass of AvdModel. + _custom_data: _custom_data + + """ + + class Interfaces(AvdIndexedList[str, InterfacesItem]): + """Subclass of AvdIndexedList with `InterfacesItem` items. Primary key is `name` (`str`).""" + + _primary_key: ClassVar[str] = "name" + + Interfaces._item_type = InterfacesItem + _fields: ClassVar[dict] = { "peer_dynamic_source": {"type": str}, "path_groups": {"type": PathGroups}, @@ -61162,6 +61239,7 @@ def __init__( "policies": {"type": Policies}, "vrfs": {"type": Vrfs}, "tcp_mss_ceiling": {"type": TcpMssCeiling}, + "interfaces": {"type": Interfaces}, "_custom_data": {"type": dict}, } peer_dynamic_source: Literal["stun"] | None @@ -61176,6 +61254,8 @@ def __init__( """Subclass of AvdIndexedList with `VrfsItem` items. Primary key is `name` (`str`).""" tcp_mss_ceiling: TcpMssCeiling """Subclass of AvdModel.""" + interfaces: Interfaces + """Subclass of AvdIndexedList with `InterfacesItem` items. Primary key is `name` (`str`).""" _custom_data: dict[str, Any] if TYPE_CHECKING: @@ -61189,6 +61269,7 @@ def __init__( policies: Policies | UndefinedType = Undefined, vrfs: Vrfs | UndefinedType = Undefined, tcp_mss_ceiling: TcpMssCeiling | UndefinedType = Undefined, + interfaces: Interfaces | UndefinedType = Undefined, _custom_data: dict[str, Any] | UndefinedType = Undefined, ) -> None: """ @@ -61204,6 +61285,7 @@ def __init__( policies: Subclass of AvdIndexedList with `PoliciesItem` items. Primary key is `name` (`str`). vrfs: Subclass of AvdIndexedList with `VrfsItem` items. Primary key is `name` (`str`). tcp_mss_ceiling: Subclass of AvdModel. + interfaces: Subclass of AvdIndexedList with `InterfacesItem` items. Primary key is `name` (`str`). _custom_data: _custom_data """ diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml index 90a7ac05177..ba2fd987a5d 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/eos_cli_config_gen.schema.yml @@ -20061,6 +20061,32 @@ keys: description: 'Enforce on packets through DPS tunnel for a specific direction. Only ''ingress'' direction is supported.' + interfaces: + type: list + primary_key: name + items: + type: dict + keys: + name: + type: str + metric_bandwidth: + description: Allow maximum metric bandwidth. + type: dict + keys: + receive: + description: Maximum receive bandwidth in Mbps. + type: int + min: 1 + max: 4294967295 + convert_types: + - str + transmit: + description: Maximum transmit bandwidth in Mbps. + type: int + min: 1 + max: 4294967295 + convert_types: + - str router_pim_sparse_mode: type: dict keys: diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_path_selection.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_path_selection.schema.yml index 07be1c8bad3..67980c79bdd 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_path_selection.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/router_path_selection.schema.yml @@ -256,3 +256,29 @@ keys: description: |- Enforce on packets through DPS tunnel for a specific direction. Only 'ingress' direction is supported. + interfaces: + type: list + primary_key: name + items: + type: dict + keys: + name: + type: str + metric_bandwidth: + description: Allow maximum metric bandwidth. + type: dict + keys: + receive: + description: Maximum receive bandwidth in Mbps. + type: int + min: 1 + max: 4294967295 + convert_types: + - str + transmit: + description: Maximum transmit bandwidth in Mbps. + type: int + min: 1 + max: 4294967295 + convert_types: + - str