diff --git a/docs/caveats.md b/docs/caveats.md index 5ddf5bc82..fd1c87d60 100644 --- a/docs/caveats.md +++ b/docs/caveats.md @@ -280,6 +280,10 @@ We're not testing Fortinet implementation as part of the regular integration tes * Junos cannot have more than one loopback interface per routing instance. Using **loopback** links on Junos devices will result in configuration errors. * Junos configuration template configures BFD timers within routing protocol configuration, not on individual interfaces +(caveats-linux)= +## Generic Linux lag module caveats +* The lag module requires the `ip` command to be available on the Linux host + (caveats-vptx)= ## Juniper vPTX diff --git a/docs/module/lag.md b/docs/module/lag.md index 3eaa021d0..618858ba4 100644 --- a/docs/module/lag.md +++ b/docs/module/lag.md @@ -13,6 +13,7 @@ LAG is currently supported on these platforms: | Cumulus 5.x (NVUE) | ✅ | ✅ | ❌ | ❌ | | Dell OS10 | ✅ | ✅ | ✅ | ✅ | | FRR | ✅ | ✅ | ❌ | ❌ | +| Generic Linux hosts [❗](caveats-linux) | ✅ | ✅ | ❌ | ❌ | ## Parameters @@ -31,7 +32,7 @@ The following parameters can be set on individual links: * **lag.members**: Mandatory list of links that form the LAG. It uses the [same format as the topology **links** list](link-formats). * **lag.ifindex**: Optional parameter that controls the naming of the LAG (bonding, port-channel) interface. -* **lag.mlag**: Optional Boolean or dict with peer link parameters; see [below](mlag) +* **lag.mlag**: Optional dict with peer link parameters; see [below](mlag) This configuration module creates a virtual link with the link type set to **lag** between the **lag.members** and appends the links described in the **lag.members** list to the topology **links** list. diff --git a/docs/plugins.md b/docs/plugins.md index 4244c8126..10fc72480 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -9,6 +9,7 @@ plugins/bgp.domain.md plugins/bgp.session.md plugins/bgp.policy.md + plugins/bonding.md plugins/ebgp.multihop.md plugins/bgp.originate.md plugins/check.config.md diff --git a/docs/plugins/bonding.md b/docs/plugins/bonding.md new file mode 100644 index 000000000..c34d938b9 --- /dev/null +++ b/docs/plugins/bonding.md @@ -0,0 +1,66 @@ +(plugin-bonding)= +# Host-side link bonding + +Linux networking has long supported *bonding*, the ability to use multiple links simultaneously. Netlab supports bonding with LACP through the *lag* module, +this plugin adds support for the other bonding modes (that don't require any special configuration on peers) + +```eval_rst +.. contents:: Table of Contents + :depth: 2 + :local: + :backlinks: none +``` + +## Using the Plugin + +* Add `plugin: [ bonding ]` to the lab topology. +* Include the **bonding.ifindex** attribute in any links that need to be bonded + +### Supported attributes + +The plugin adds the following attributes: +* **bonding.mode** (string, one of active-backup, balance-tlb, or balance-alb) -- the bonding mode to use, default `active-backup` + +Additional interface level attributes: +* **bonding.ifindex** (int,mandatory) -- the interface index for the bonding device; links with matching ifindex are bonded together +* **bonding.primary** (bool) -- optional flag to mark this interface as primary, default *False* + +## Examples + +(active-backup-bonding)= +### Connect a host to a pair of switches using active-backup bonding + +```yaml +plugin: [ bonding ] + +bonding.mode: active-backup # Default + +vlans: + v1: + +groups: + _auto_create: True + hosts: + members: [ h1 ] + device: linux + switches: + members: [ s1, s2 ] + module: [ vlan ] + +links: +- s1: + s2: + vlan.trunk: [ v1 ] + +# Bonded interfaces eth1/eth2 +- s1: + h1: + bonding.ifindex: 1 +- s2: + h1: + bonding: + ifindex: 1 + primary: True # Use this interface as primary +``` + +Note how there are no bonding specific modules enabled on the switches \ No newline at end of file diff --git a/netsim/ansible/templates/initial/linux/ubuntu.j2 b/netsim/ansible/templates/initial/linux/ubuntu.j2 index 1fa65faeb..41bf7a0ea 100644 --- a/netsim/ansible/templates/initial/linux/ubuntu.j2 +++ b/netsim/ansible/templates/initial/linux/ubuntu.j2 @@ -64,10 +64,21 @@ if systemctl is-active --quiet lldpd.service; then else if "$NEED_APT_UPDATE"; then apt-get update -qq + NEED_APT_UPDATE= fi apt-get install -qq lldpd fi +{% if 'lag' in module|default([]) %} +# +# Install ethtool and iproute2(ip) for lag support +# +if "$NEED_APT_UPDATE"; then + apt-get update -qq +fi +apt-get install -qq ethtool iproute2 +{% endif %} + cat </etc/lldpd.d/system.conf configure lldp tx-interval 30 configure lldp tx-hold 3 diff --git a/netsim/ansible/templates/initial/linux/vanilla.j2 b/netsim/ansible/templates/initial/linux/vanilla.j2 index 8d548c825..a78344e36 100644 --- a/netsim/ansible/templates/initial/linux/vanilla.j2 +++ b/netsim/ansible/templates/initial/linux/vanilla.j2 @@ -1,3 +1,5 @@ +{% from "lag/linux.j2" import create_bond_dev with context %} + ### One-Shot configuration (non-Ubuntu VM or container) # # Disable IPv4 and IPv6 forwarding @@ -24,9 +26,12 @@ ip -6 addr add {{ loopback.ipv6 }} dev lo {% endif %} {% endif %} # -# Interface addressing +# Interface addressing, create any bond devices # {% for l in interfaces|default([]) %} +{% if l.type in ['lag','bond'] %} +{{ create_bond_dev(l) }} +{% endif %} ip link set dev {{ l.ifname }} up {% if l.ipv4 is defined %} set +e @@ -41,7 +46,7 @@ ip -6 addr del {{ l.ipv6 }} dev {{ l.ifname }} 2>/dev/null set -e ip -6 addr add {{ l.ipv6 }} dev {{ l.ifname }} {% endif %} -{% if l.mtu is defined %} +{% if l.mtu is defined and l.type!='lag' %} ip link set {{ l.ifname }} mtu {{ l.mtu }} {% endif %} {% endfor %} diff --git a/netsim/ansible/templates/lag/frr.j2 b/netsim/ansible/templates/lag/frr.j2 index d4db8772c..0d93aebe7 100644 --- a/netsim/ansible/templates/lag/frr.j2 +++ b/netsim/ansible/templates/lag/frr.j2 @@ -1,42 +1 @@ -#!/bin/bash -# -set -e # Exit immediately when any command fails -# -{% if node_provider != 'clab' %} -modprobe bonding miimon=100 mode=802.3ad lacp_rate=fast -{% endif %} -# -# Create bonds for LAGs, if any. Requires kernel bonding module loaded -# -{% for l in interfaces if 'lag' in l %} -{% if l.type=='lag' %} -{% set _m = l.lag.mode|default(lag.mode) %} -{% if _m=="802.3ad" %} -{% set _lacp = l.lag.lacp|default(lag.lacp) %} -{% set lacp_act = 'off' if _lacp=='off' else 'on' %} -{% set lacp_rate = (' lacp_rate ' + _lacp) if _lacp!='off' else '' %} -{% set _m = _m + " xmit_hash_policy encap3+4" + lacp_rate %} -{% if node_provider == 'clab' %} -{% set _m = _m + " lacp_active " + lacp_act %} -{% endif %} -{% endif %} -ip link add dev {{l.ifname}} type bond mode {{_m}} -{% endif %} -ip link set dev {{ l.ifname }} down -{% endfor %} - -{% for l in interfaces if 'lag' in l and l.type != 'lag' %} -{% if l.type=='p2p' %} -{% if node_provider != 'clab' %} -ethtool -s {{ l.ifname }} autoneg off speed 1000 duplex full -{% endif %} -ip link set dev {{ l.ifname }} master {% - for i in interfaces if i.type=='lag' and i.linkindex==l.lag._parentindex %}{{ i.ifname }} -{% endfor %} -{% endif %} -ip link set dev {{ l.ifname }} up -{% endfor %} -{% for l in interfaces if 'lag' in l and l.type == 'lag' %} -ip link set dev {{ l.ifname }} up -{% endfor %} -exit 0 +{% include "linux.j2" %} \ No newline at end of file diff --git a/netsim/ansible/templates/lag/linux.j2 b/netsim/ansible/templates/lag/linux.j2 new file mode 100644 index 000000000..9ce6d2725 --- /dev/null +++ b/netsim/ansible/templates/lag/linux.j2 @@ -0,0 +1,52 @@ +{% macro create_bond_dev(l) %} +{% if l.type in ['lag','bond'] %} +{% set _m = l.lag.mode|default(l.bonding.mode|default("802.3ad")) %} +{% if _m=="802.3ad" %} +{% set _lacp = l.lag.lacp|default('fast') %} +{% set lacp_act = 'off' if _lacp=='off' else 'on' %} +{% set lacp_rate = (' lacp_rate ' + _lacp) if _lacp!='off' else '' %} +{% set _m = _m + lacp_rate %} +{% if node_provider == 'clab' %} +{% set _m = _m + " lacp_active " + lacp_act %} +{% endif %} +{% elif l.bonding.primary is defined %} +{% set _m = _m + " primary " + l.bonding.primary %} +{% endif %} +{% if _m in ["802.3ad","balance-xor","balance-alb","balance-tlb"] %} +{% set _m = _m + " xmit_hash_policy encap3+4" %} +{% endif %} +{% if node_provider != 'clab' %} +# +# Make sure 'bonding' module is loaded +# +if [ ! -e /sys/module/bonding ]; then +modprobe bonding miimon=100 mode=802.3ad lacp_rate=fast +fi +{% endif %} +if [ ! -e /sys/class/net/{{l.ifname}} ]; then +ip link add dev {{l.ifname}} type bond mode {{ _m }} +fi +{% endif %} +{% endmacro -%} +#!/bin/bash +# +set -e # Exit immediately when any command fails +# +# Bond devices are created by 'initial' module - add members +# +{% for l in interfaces if 'lag' in l and l.type != 'lag' %} +{% if l.type=='p2p' %} +{% if node_provider != 'clab' %} +ethtool -s {{ l.ifname }} autoneg off speed 1000 duplex full +{% endif %} +ip link set dev {{ l.ifname }} down +ip link set dev {{ l.ifname }} master {% + for i in interfaces if i.type=='lag' and i.linkindex==l.lag._parentindex %}{{ i.ifname }} +{% endfor %} +{% endif %} +ip link set dev {{ l.ifname }} up +{% endfor %} +{% for l in interfaces if 'lag' in l and l.type == 'lag' %} +ip link set dev {{ l.ifname }} up +{% endfor %} +exit 0 diff --git a/netsim/augment/links.py b/netsim/augment/links.py index 9eb992aa8..c590afa23 100644 --- a/netsim/augment/links.py +++ b/netsim/augment/links.py @@ -1168,7 +1168,8 @@ def transform(link_list: typing.Optional[Box], defaults: Box, nodes: Box, pools: continue set_link_bridge_name(link,defaults) - link_default_pools = ['p2p','lan'] if link.type in ['p2p','lag'] else ['lan'] + link_default_pools = ['p2p','lan'] if link.type=='p2p' or ( + link.type=='lag' and not 'vlan' in link) else ['lan'] assign_link_prefix(link,link_default_pools,pools,nodes,link._linkname) copy_link_gateway(link,nodes) assign_interface_addresses(link,pools,nodes,defaults) diff --git a/netsim/devices/linux.yml b/netsim/devices/linux.yml index 921dd459b..00768186d 100644 --- a/netsim/devices/linux.yml +++ b/netsim/devices/linux.yml @@ -1,5 +1,6 @@ description: Generic Linux host interface_name: eth{ifindex} +lag_interface_name: "bond{lag.ifindex}" mgmt_if: eth0 role: host features: @@ -9,6 +10,8 @@ features: ipv6: true server: true relay: true + lag: + passive: False libvirt: image: generic/ubuntu2004 group_vars: diff --git a/netsim/extra/bonding/defaults.yml b/netsim/extra/bonding/defaults.yml new file mode 100644 index 000000000..20c8494ed --- /dev/null +++ b/netsim/extra/bonding/defaults.yml @@ -0,0 +1,25 @@ +# bonding plugin attributes +# +--- +bonding: + mode: active-backup # Default bond mode + +devices: + linux: + features.bonding: True + frr: + features.bonding: True + +attributes: + global: + bonding: + # Subset of Linux bonding modes that use autonomous ports and no LACP + mode: { type: str, valid_values: [ active-backup, balance-tlb, balance-alb ] } + node: + bonding: + mode: + interface: + bonding: + ifindex: { type: int, min_value: 0, _required: True } + mode: { copy: global } + primary: bool # Optional flag to use this interface as primary for bonding diff --git a/netsim/extra/bonding/frr.j2 b/netsim/extra/bonding/frr.j2 new file mode 100644 index 000000000..571230c3f --- /dev/null +++ b/netsim/extra/bonding/frr.j2 @@ -0,0 +1 @@ +{% include linux.j2 %} diff --git a/netsim/extra/bonding/linux.j2 b/netsim/extra/bonding/linux.j2 new file mode 100644 index 000000000..6b6d89301 --- /dev/null +++ b/netsim/extra/bonding/linux.j2 @@ -0,0 +1,23 @@ +{% from "templates/lag/linux.j2" import create_bond_dev with context %} +#!/bin/bash + +set -e + +# Check if the 'ip' command is available, if not install it +if ! command -v ip 2>&1 >/dev/null +then + echo "Trying to install the 'ip' and 'ethtool' commands..." + apt-get -qq update + apt-get -qq install ethtool iproute2 +fi + +{# Bonding device is created by 'initial' module #} +{% for intf in interfaces|default([]) if intf.bonding.members is defined %} +ip link set dev {{ intf.ifname }} down +{% for member in intf.bonding.members %} +ip link set dev {{ member }} down +ip link set dev {{ member }} master {{ intf.ifname }} +ip link set dev {{ member }} up +{% endfor %} +ip link set dev {{ intf.ifname }} up +{% endfor %} diff --git a/netsim/extra/bonding/plugin.py b/netsim/extra/bonding/plugin.py new file mode 100644 index 000000000..3d00a8422 --- /dev/null +++ b/netsim/extra/bonding/plugin.py @@ -0,0 +1,90 @@ +import typing +from box import Box +from netsim.utils import log +from netsim import api,data +from netsim.augment import devices + +_config_name = 'bonding' + +''' +add_bond_interfaces - append interface data to node.interfaces for bonding template to read and implement +''' +def add_bond_interfaces(node: Box, bonds: dict[int,Box]) -> None: + for c,(ifindex,bond) in enumerate(bonds.items()): + ifname = f'bond{ifindex}' # XXX hardcoded, could make this a device template attribute + + # + # TODO: Could make sure the layout is exactly like the 'lag' module needs it, to reuse provisioning logic + # That means converting 'bonding.ifindex' to 'lag._parentindex' too! + # + bond_if = { + 'type': 'bond', + 'ifname': ifname, + 'name': f'bond {ifindex}', + 'bonding': { 'ifindex': ifindex, 'members': bond['members'], 'mode': bond.mode }, + 'interfaces': bond['interfaces'], + 'ifindex': 50000 + c, + 'virtual_interface': True + } + if 'primary' in bond: + bond_if['bonding']['primary'] = bond['primary'] + for af in ['ipv4','ipv6']: + if af in bond: + bond_if[af] = bond[af] # Take the first one, if any + node.interfaces.append(bond_if) + +''' +post_transform hook + +Apply plugin config to nodes with interfaces marked with 'bonding.ifindex', for devices that support this plugin +''' +def post_transform(topology: Box) -> None: +# def post_link_transform(topology: Box) -> None: # Use 'pre_node_transform' such that only 1 IP address gets assigned, nothing to move? + global _config_name + bond_mode = topology.get('bonding.mode','active-backup') + bonds : Box = data.get_empty_box() # Map of bonds per node, indexed by bonding.ifindex + for node in topology.nodes.values(): + features = devices.get_device_features(node,topology.defaults) + if 'bonding' in features: + for intf in node.get('interfaces',[]): + bond_ifindex = intf.get('bonding.ifindex',None) + if not bond_ifindex: + continue + + link = topology.links[ intf.linkindex-1 ] + if 'virtual_interface' in intf or link.node_count!=2: + log.error( f"{intf.name}: 'bonding.ifindex' can only be applied to interfaces on direct p2p links", + category=log.IncorrectAttr,module=_config_name) + continue + + clone = data.get_box(intf) + if node.name in bonds and bond_ifindex in bonds[node.name]: + bonds[node.name][bond_ifindex]['members'].append( clone.ifname ) + for att in ['ipv4','ipv6']: + intf.pop(att,None) + else: + mode = intf.get('bonding.mode',bond_mode) + bonds[node.name][bond_ifindex] = { 'interfaces': intf.neighbors, 'members': [ clone.ifname ], 'mode': mode } + for att in ['ipv4','ipv6']: # Move any ips (from first member link) + if att in intf: + bonds[node.name][bond_ifindex][att] = intf.pop(att,None) + + if intf.get('bonding.primary',False): + bonds[node.name][bond_ifindex]['primary'] = intf.ifname + + intf.neighbors = [ { 'ifname': i.ifname, 'node': i.node } for i in link.interfaces if i.node!=node.name ] + intf.type = 'p2p' + intf.prefix = False # L2 p2p interface + intf.pop('name',None) + + for node in topology.nodes.values(): # For each node + if node.name in bonds: # ...that has 1 or more bonds + for bond in bonds[node.name].values(): # ...for each bond + for i in bond.interfaces: # ...for each interface of that bond + if i.node in bonds: # ...check if the node also has bonds + for i2,b2 in bonds[i.node].items(): # If so, for each such bond + if i.ifname in b2['members']: # if the interface connecting to is a member + i.ifname = f'bond{i2}' # Set correct neighbor device name to bond + continue + add_bond_interfaces(node,bonds[node.name]) + api.node_config(node,_config_name) # Remember that we have to do extra configuration diff --git a/netsim/modules/lag.py b/netsim/modules/lag.py index 73f8e033e..3eb5abd53 100644 --- a/netsim/modules/lag.py +++ b/netsim/modules/lag.py @@ -222,9 +222,6 @@ def analyze_lag(members: list, node_count: dict) -> tuple[bool,bool,str]: if not check_lag_config(node,l._linkname,topology): return elif is_mlag: - lag_mode = l.get('lag.mode',topology.get('lag.mode',"802.3ad")) - if lag_mode == "active-backup": # Exception: active-backup lag to 2 nodes - continue # Skip adding the lag interface on M-side if not check_mlag_support(node,l._linkname,topology): return ifatts.lag._mlag = True # Set internal flag diff --git a/netsim/modules/lag.yml b/netsim/modules/lag.yml index e6f295544..5ba974dc9 100644 --- a/netsim/modules/lag.yml +++ b/netsim/modules/lag.yml @@ -12,11 +12,13 @@ attributes: global: lacp: { type: str, valid_values: [ "off", "slow", "fast" ] } lacp_mode: { type: str, valid_values: [ "passive", "active" ] } - mode: { type: str, valid_values: [ "802.3ad", "balance-xor", "active-backup" ] } + + # All Linux bonding modes that require lag configuration on the switch side + mode: { type: str, valid_values: [ "802.3ad", "balance-rr", "balance-xor", "broadcast" ] } node: lacp: lacp_mode: - mode: { type: str, valid_values: [ "802.3ad", "balance-xor", "active-backup" ] } + mode: link: # Most should be consistent across both interfaces on the link lacp: { copy: global } lacp_mode: { copy: global } @@ -24,7 +26,7 @@ attributes: # Optional, to control naming of the bonding interface ifindex: { type: int, min_value: 0, max_value: 10000 } members: - mode: { type: str, valid_values: [ "802.3ad", "balance-xor", "active-backup" ] } + mode: { copy: global } mlag: peergroup: # Optional, for MLAG interconnect links to peers type: int diff --git a/tests/integration/lag/04-host-mlag.yml b/tests/integration/lag/04-host-mlag.yml index af19232ef..b1c2b97b6 100644 --- a/tests/integration/lag/04-host-mlag.yml +++ b/tests/integration/lag/04-host-mlag.yml @@ -1,5 +1,5 @@ message: | - The device under is a pair of switches with a pair of L3 MC-LAG links connected to 2 Linux hosts. + The device under test is a pair of switches with a pair of L3 MC-LAG links connected to 2 Linux hosts. The hosts should be able to ping each other and their gateway groups: @@ -8,9 +8,9 @@ groups: members: [s1, s2] module: [lag, vlan] hosts: - members: [h1, h2] - module: [lag] # Host side must support lag to present single MAC on both interfaces - device: frr # linux does not support 'lag' module yet + members: [ h1, h2 ] + module: [ lag ] # Host side must support lag to present single MAC on both interfaces + device: linux vlans: red: @@ -35,8 +35,8 @@ validate: nodes: [h1] wait_msg: Waiting for STP to enable the ports wait: 45 - plugin: ping(nodes.h2.interfaces[0].ipv4,af='ipv4') + plugin: ping('h2') ping_gw: description: Pinging gateway from H1 nodes: [h1] - plugin: ping(nodes.s1.interfaces[5].ipv4,af='ipv4') + plugin: ping(nodes.s1.interfaces[-1].ipv4,af='ipv4') diff --git a/tests/integration/lag/05-bonding-active-standby.yml b/tests/integration/lag/05-bonding-active-standby.yml new file mode 100644 index 000000000..6999ed2a5 --- /dev/null +++ b/tests/integration/lag/05-bonding-active-standby.yml @@ -0,0 +1,56 @@ +message: | + The device under test is a pair of switches with a pair of links connected to 2 Linux hosts. + The Linux hosts are using active-standby bonding, which doesn't require any special support from the switches + (and technically isn't "link aggregation") + + The hosts should be able to ping each other + +defaults.device: frr + +plugin: [ bonding ] # To be created + +bonding.mode: active-backup + +groups: + _auto_create: true + switches: + members: [ s1, s2 ] + module: [vlan] # No 'lag' module support enabled + hosts: + members: [ h1, h2 ] + device: linux + +vlans: + red: + mode: bridge + +links: +- s1: + s2: + vlan.trunk: [red] +- h1: + bonding.ifindex: 1 + s1: + vlan.access: red +- h1: + bonding.ifindex: 1 + s2: + vlan.access: red +- h2: + bonding.ifindex: 1 + s1: + vlan.access: red +- h2: + bonding: + ifindex: 1 + primary: True # Prefer s2 as active switch for h2 + s2: + vlan.access: red + +validate: + ping: + description: Pinging H2 from H1 + nodes: [h1] + wait_msg: Waiting for STP to enable the ports + wait: 45 + plugin: ping('h1',af='ipv4') diff --git a/tests/integration/lag/05-host-mlag-lag.yml b/tests/integration/lag/05-host-mlag-lag.yml deleted file mode 100644 index 23e037823..000000000 --- a/tests/integration/lag/05-host-mlag-lag.yml +++ /dev/null @@ -1,43 +0,0 @@ -message: | - The device under is a pair of switches with a pair of L3 MLAG links connected - to 2 Linux hosts, each connected through a LAG The hosts should be able to - ping each other and their gateway - -groups: - _auto_create: true - switches: - members: [s1, s2] - module: [lag, vlan] - hosts: - members: [h1, h2] - module: [lag] # Host side must support lag to present single MAC on both interfaces - device: frr # linux does not support 'lag' module yet - -vlans: - red: - -links: -- lag: - members: [s1-s2, s1-s2] - mlag.peergroup: 1 - # On OS10 in case of mlag, vlan.trunk is implied for all vlans - other platforms? -- lag: - members: [h1-s1, h1-s1, h1-s2, h1-s2] - # mlag: True - vlan.access: red -- lag: - members: [h2-s1, h2-s1, h2-s2, h2-s2] - # mlag: True - vlan.access: red - -validate: - ping: - description: Pinging H2 from H1 - nodes: [h1] - wait_msg: Waiting for STP to enable the ports - wait: 45 - plugin: ping(nodes.h2.interfaces[0].ipv4,af='ipv4') - ping_gw: - description: Pinging gateway from H1 - nodes: [h1] - plugin: ping(nodes.s1.interfaces[8].ipv4,af='ipv4') diff --git a/tests/integration/lag/06-host-mlag-anycast-gateway.yml b/tests/integration/lag/06-host-mlag-anycast-gateway.yml index 1eccf38ef..6c8b9d013 100644 --- a/tests/integration/lag/06-host-mlag-anycast-gateway.yml +++ b/tests/integration/lag/06-host-mlag-anycast-gateway.yml @@ -11,7 +11,7 @@ groups: hosts: members: [h1, h2] module: [lag] # Host side must support lag to present single MAC on both interfaces - device: frr # linux does not support 'lag' module yet + device: linux vlans: red: @@ -21,14 +21,11 @@ links: - lag: members: [s1-s2] mlag.peergroup: 1 - # On OS10 in case of mlag, vlan.trunk is implied for all vlans - other platforms? - lag: members: [h1-s1, h1-s2] - # mlag: True vlan.access: red - lag: members: [h2-s1, h2-s2] - # mlag: True vlan.access: red validate: @@ -41,8 +38,8 @@ validate: ping_anycast_gw1: description: Pinging anycast gateway from H1 nodes: [h1] - plugin: ping(nodes.s1.interfaces[5].gateway.ipv4,af='ipv4') + plugin: ping(nodes.s1.interfaces[-1].gateway.ipv4,af='ipv4') ping_anycast_gw2: description: Pinging other non-anycast gateway from H1 nodes: [h1] - plugin: ping(nodes.s2.interfaces[5].ipv4,af='ipv4') + plugin: ping(nodes.s2.interfaces[-1].ipv4,af='ipv4') diff --git a/tests/integration/lag/11-host-lag-active-standby.yml b/tests/integration/lag/11-host-lag-active-standby.yml deleted file mode 100644 index 84ea261d9..000000000 --- a/tests/integration/lag/11-host-lag-active-standby.yml +++ /dev/null @@ -1,40 +0,0 @@ -message: | - The device under test is a pair of switches with a pair of links connected to 2 Linux hosts. - The Linux hosts are using active-standby lags, which don't require any special support from the switches - - The hosts should be able to ping each other and their gateway - -lag.mode: active-backup - -groups: - _auto_create: true - switches: - members: [s1, s2] - module: [vlan] # No 'lag' module support enabled - hosts: - members: [h1, h2] - module: [lag] # Host side uses lag to implement active/standby bond - device: linux - -vlans: - red: - -links: -- lag: - members: [h1-s1, h1-s2] - vlan.access: red -- lag: - members: [h2-s1, h2-s2] - vlan.access: red - -validate: - ping: - description: Pinging H2 from H1 - nodes: [h1] - wait_msg: Waiting for STP to enable the ports - wait: 45 - plugin: ping(nodes.h2.interfaces[0].ipv4,af='ipv4') - ping_gw: - description: Pinging gateway from H1 - nodes: [h1] - plugin: ping(nodes.s1.interfaces[5].ipv4,af='ipv4')