diff --git a/netsim/ansible/templates/lag/arubacx.j2 b/netsim/ansible/templates/lag/arubacx.j2 index 57db5798eb..b6c335f53b 100644 --- a/netsim/ansible/templates/lag/arubacx.j2 +++ b/netsim/ansible/templates/lag/arubacx.j2 @@ -10,7 +10,7 @@ interface lag {{ intf.lag.mlag.ifindex }} description VSX ISL ! -{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._parentindex|default(False) == intf.linkindex %} +{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._peerlink|default(0) == intf.linkindex %} interface {{ ch.ifname }} no shutdown description {{ ch.name }} (ISL in lag {{intf.lag.mlag.ifindex }}) @@ -54,7 +54,7 @@ interface {{ intf.ifname }}{{ mclag_intf }}{{ mclag_intf_static }} no shutdown ! -{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %} +{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.lag.ifindex %} ! interface {{ ch.ifname }} description {{ ch.name }} in lag {{ intf.lag.ifindex }} diff --git a/netsim/ansible/templates/lag/cumulus.j2 b/netsim/ansible/templates/lag/cumulus.j2 index ba27c821aa..b374daa36c 100644 --- a/netsim/ansible/templates/lag/cumulus.j2 +++ b/netsim/ansible/templates/lag/cumulus.j2 @@ -12,7 +12,7 @@ iface {{ data.ifname }} pre-up ip link add {{ data.ifname }} type bond bond-slaves {%- for i in interfaces - if i.lag._parentindex|default(False) == data.linkindex %} {{ i.ifname }}{%- endfor %} + if i.lag._parentindex|default(False) == data.lag.ifindex %} {{ i.ifname }}{%- endfor %} {% set _lacp = data.lag.lacp|default(lag.lacp) %} {% if _lacp=='slow' %} bond-lacp-rate slow diff --git a/netsim/ansible/templates/lag/cumulus_nvue.j2 b/netsim/ansible/templates/lag/cumulus_nvue.j2 index 9904cbe07f..b3e5bc4db8 100644 --- a/netsim/ansible/templates/lag/cumulus_nvue.j2 +++ b/netsim/ansible/templates/lag/cumulus_nvue.j2 @@ -6,7 +6,7 @@ member: {% for intf in interfaces if intf.lag.mlag.peergroup is defined %} {{ intf.ifname }}: {} -{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %} +{% for ch in interfaces if ch.lag._peerlink|default(0) == intf.linkindex %} {{ ch.ifname }}: {} {% endfor %} {% endfor %} @@ -42,7 +42,7 @@ mode: static {% endif %} member: -{% for c in interfaces if c.lag._parentindex|default(False) == i.linkindex %} +{% for c in interfaces if c.lag._parentindex|default(False) == i.lag.ifindex %} {{ c.ifname }}: {} {% endfor %} {% endfor %} diff --git a/netsim/ansible/templates/lag/dellos10.j2 b/netsim/ansible/templates/lag/dellos10.j2 index 5d1b1cfe84..161562b8fa 100644 --- a/netsim/ansible/templates/lag/dellos10.j2 +++ b/netsim/ansible/templates/lag/dellos10.j2 @@ -5,7 +5,7 @@ vlt-domain {{ intf.lag.mlag.peergroup }} backup destination {{ intf.lag.mlag.peer }} vlt-mac {{ intf.lag.mlag.mac | hwaddr('linux') }} discovery-interface {{ intf.ifname }} -{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %} +{% for ch in interfaces if ch.lag._peerlink|default(0) == intf.linkindex %} discovery-interface {{ ch.ifname }} {% endfor %} {% endfor %} @@ -23,7 +23,7 @@ interface {{ intf.ifname }} description "{{ intf.name }}" {% endif %} ! -{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %} +{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.lag.ifindex %} {% set _lag_mode = 'on' if intf.lag.lacp|default('') == 'off' else 'active' if intf.lag.lacp_mode|default('') == 'active' else diff --git a/netsim/ansible/templates/lag/eos.j2 b/netsim/ansible/templates/lag/eos.j2 index 6e05346725..86abb982fc 100644 --- a/netsim/ansible/templates/lag/eos.j2 +++ b/netsim/ansible/templates/lag/eos.j2 @@ -26,7 +26,7 @@ mlag peer-link port-channel {{ intf.lag.mlag.ifindex }} no shutdown ! -{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._parentindex|default(False) == intf.linkindex %} +{% for ch in ([intf]+interfaces) if ch==intf or ch.lag._peerlink|default(0) == intf.linkindex %} interface {{ ch.ifname }} description {{ ch.name }} (peerlink in channel-group {{intf.lag.mlag.ifindex }}) channel-group {{ intf.lag.mlag.ifindex }} mode active @@ -47,7 +47,7 @@ interface {{ intf.ifname }} description {{ intf.name }} {% endif %} ! -{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.linkindex %} +{% for ch in interfaces if ch.lag._parentindex|default(False) == intf.lag.ifindex %} ! {% set _lag_mode = 'on' if intf.lag.lacp|default('') == 'off' else diff --git a/netsim/ansible/templates/lag/frr.j2 b/netsim/ansible/templates/lag/frr.j2 index 0d93aebe7b..e5a4eeb881 100644 --- a/netsim/ansible/templates/lag/frr.j2 +++ b/netsim/ansible/templates/lag/frr.j2 @@ -1 +1 @@ -{% include "linux.j2" %} \ No newline at end of file +{% include "linux.j2" %} diff --git a/netsim/ansible/templates/lag/linux.j2 b/netsim/ansible/templates/lag/linux.j2 index 005fb07f12..c886debf8f 100644 --- a/netsim/ansible/templates/lag/linux.j2 +++ b/netsim/ansible/templates/lag/linux.j2 @@ -12,7 +12,7 @@ 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 }} + for i in interfaces if i.type=='lag' and i.lag.ifindex==l.lag._parentindex %}{{ i.ifname }} {% endfor %} {% endif %} ip link set dev {{ l.ifname }} up diff --git a/netsim/defaults/attributes.yml b/netsim/defaults/attributes.yml index ff247320c7..07d236fc42 100644 --- a/netsim/defaults/attributes.yml +++ b/netsim/defaults/attributes.yml @@ -60,7 +60,7 @@ link: # Global link attributes _alt_types: [ bool_false, prefix_str, named_pfx ] role: id pool: id - type: { type: str, valid_values: [ lan, p2p, stub, loopback, tunnel, vlan_member, lag ] } + type: { type: str, valid_values: [ lan, p2p, stub, loopback, tunnel, vlan_member ] } unnumbered: bool interfaces: mtu: { type: int, min_value: 64, max_value: 65535 } diff --git a/netsim/modules/lag.py b/netsim/modules/lag.py index 18b4f74912..ea03d16136 100644 --- a/netsim/modules/lag.py +++ b/netsim/modules/lag.py @@ -38,11 +38,11 @@ def populate_peerlink_id_set(topology: Box) -> None: create_l2_link_base - Create a L2 P2P link as base for member links """ def create_l2_link_base(l: Box, topology: Box) -> Box: - l2_ifdata = data.get_box({ 'type': "p2p", 'prefix': False, 'lag': {} }) # Construct an L2 member link - for a in list(topology.defaults.lag.attributes.lag_l2_ifattr): + l2_linkdata = data.get_box({ 'type': "p2p", 'prefix': False, 'lag': {} }) # Construct an L2 member link + for a in list(topology.defaults.lag.attributes.lag_l2_linkattr): if a in l: - l2_ifdata[a] = l[a] - return l2_ifdata + l2_linkdata[a] = l[a] + return l2_linkdata """ check_lag_config - check if the given node supports lag and has the module enabled @@ -144,28 +144,55 @@ def set_lag_ifindex(laglink: Box, intf: Box, is_mside: bool, topology: Box) -> b """ split_dual_mlag_link - Split dual-mlag pairs into 2 lag link groups, returns the new link """ -def split_dual_mlag_link(link: Box, topology: Box) -> Box: +def split_dual_mlag_link(link: Box, topology: Box) -> None: def no_peer(i: Box) -> Box: i.pop('_peer',None) # Remove internal _peer attribute - return i - + return i + split_copy = data.get_box(link) # Make a copy split_copy.linkindex = len(topology.links)+1 # Update its link index split_copy._linkname = split_copy._linkname + "-2" # Assign unique name - split_copy.lag.pop('members',None) # Clean up members first_pair = ( link.interfaces[0].node, link.interfaces[0]._peer ) split_copy.interfaces = [ no_peer(i) for i in link.interfaces if i.node in first_pair ] topology.links[link.linkindex-1].interfaces = [ no_peer(i) for i in link.interfaces if i.node not in first_pair ] + + for l in topology.links: + if 'lag' in l: + nodes = [ i.node for i in l.interfaces ] + if first_pair[0] in nodes and first_pair[1] in nodes: + l.lag._parentindex = split_copy.linkindex + if log.debug_active('lag'): print(f'LAG split_dual_mlag_links -> adding split link {split_copy}') print(f'LAG split_dual_mlag_links -> remaining link {topology.links[link.linkindex-1]}') topology.links.append(split_copy) - return split_copy """ create_lag_member_links -- expand lag.members for link l and create physical p2p links """ -def create_lag_member_links(l: Box, topology: Box) -> None: +def create_lag_member_links(l: Box, topology: Box) -> bool: + members = normalized_members(l,topology) # Build list of normalized member links + if not members: + return False + l.lag.members = members # Update for create_lag_interfaces + + l2_linkdata = create_l2_link_base(l,topology) + keep_attr = list(topology.defaults.lag.attributes.lag_member_linkattr) + keep_if = ['node','ifindex'] # Keep only 'node' and optional 'ifindex' + for member in members: + member = l2_linkdata + { k:v for k,v in member.items() if k in keep_attr } + member.linkindex = len(topology.links)+1 + member.interfaces = [ { k:v for k,v in i.items() if k in keep_if } for i in member.interfaces ] + member.lag._parentindex = l.linkindex # Keep track of parent, updated to lag.ifindex below + if log.debug_active('lag'): + print(f'LAG create_lag_member_links -> adding link {member}') + topology.links.append(member) + return True + +""" +create_lag_interfaces -- create interfaces of type "lag" for each link marked as _virtual_lag +""" +def create_lag_interfaces(l: Box, topology: Box) -> None: """ analyze_lag - figure out which type of LAG we're dealing with: @@ -175,14 +202,14 @@ def create_lag_member_links(l: Box, topology: Box) -> None: Returns updated node_count set, bool is_mlag, bool dual_mlag, string one_side """ - def analyze_lag(members: list, node_count: dict) -> typing.Tuple[bool,bool,str]: + def analyze_lag(members: list, node_count: typing.Dict[str,int]) -> typing.Tuple[bool,bool,str]: for m in members: for i in m.interfaces: if i.node in node_count: node_count[ i.node ] = node_count[ i.node ] + 1 else: node_count[ i.node ] = 1 - + if len(node_count)==2: # Regular LAG between 2 nodes return (False,False,"") elif len(node_count)==3: # 1:2 MLAG or weird MLAG triangle @@ -206,15 +233,19 @@ def analyze_lag(members: list, node_count: dict) -> typing.Tuple[bool,bool,str]: if one_side=="": # Check for errors return - l.interfaces = [] # Build interface list for lag link + members = l.pop('lag.members',[]) # Remove lag.members skip_atts = list(topology.defaults.lag.attributes.lag_no_propagate) + l.interfaces = [] # Build interface list for lag link for node in node_count: - ifatts = data.get_box({ 'node': node }) + ifatts = data.get_box({ 'node': node, '_type': 'lag', 'lag': {} }) # use '_type', not 'type' (!) for m in members: # Collect attributes from member links - if node in [ i.node for i in m.interfaces ]:# ...in which is involved - ifatts = ifatts + { k:v for k,v in m.items() if k not in skip_atts } - if dual_mlag: - ifatts._peer = [ i.node for i in m.interfaces if i.node!=node ][0] + node_ifs = [ i for i in m.interfaces if i.node==node ] + if not node_ifs: # ...in which is involved + continue + ifatts = ifatts + { k:v for k,v in m.items() if k not in skip_atts } + node_ifs[0] + if dual_mlag: + ifatts._peer = [ i.node for i in m.interfaces if i.node!=node ][0] + is_mside = is_mlag and node!=one_side # Set flag if this node is the M: side if not set_lag_ifindex(l,ifatts,is_mside,topology): return @@ -227,28 +258,16 @@ def analyze_lag(members: list, node_count: dict) -> typing.Tuple[bool,bool,str]: ifatts.lag._mlag = True # Set internal flag if log.debug_active('lag'): - print(f'LAG create_lag_member_links for node {node} -> collected ifatts {ifatts}') + print(f'LAG create_lag_interfaces for node {node} -> adding interface {ifatts} skip={skip_atts}') l.interfaces.append( ifatts ) - _sl = split_dual_mlag_link(l,topology) if dual_mlag else None - split_nodes = [ i.node for i in _sl.interfaces ] if _sl else [] - - l2_ifdata = create_l2_link_base(l,topology) - keep_attr = list(topology.defaults.lag.attributes.lag_member_ifattr) - for member in members: - member = l2_ifdata + member # Copy L2 data into member link - member = data.get_box({ k:v for k,v in member.items() if k in keep_attr }) # Filter out things not needed - member.linkindex = len(topology.links)+1 - parent = _sl if _sl and member.interfaces[0].node in split_nodes else l - member.lag._parentindex = parent.linkindex # Keep track of parent - if log.debug_active('lag'): - print(f'LAG create_lag_member_links -> adding link {member}') - topology.links.append(member) + if dual_mlag: # After creating interfaces, check if we need to split them + split_dual_mlag_link(l,topology) """ create_peer_links -- creates and configures physical link(s) for given peer link """ -def create_peer_links(l: Box, topology: Box) -> bool: +def create_peer_links(l: Box, topology: Box) -> None: """ check_same_pair - Verifies that the given member connects the same pair of nodes as the first @@ -264,10 +283,10 @@ def check_same_pair(member: Box) -> bool: return True members = normalized_members(l,topology,peerlink=True) - l2_ifdata = create_l2_link_base(l,topology) + l2_linkdata = create_l2_link_base(l,topology) for idx,member in enumerate(members): - member = l2_ifdata + member # Copy L2 data into member link + member = l2_linkdata + member # Copy L2 data into member link if idx==0: # For the first member, use the existing link topology.links[l.linkindex-1] = l + member # Update topology (l is a copy) first_pair = [ i.node for i in member.interfaces ] @@ -276,50 +295,47 @@ def check_same_pair(member: Box) -> bool: log.error(f'Nodes {first_pair} on MLAG peerlink {member._linkname} have different device types ({_devs})', category=log.IncorrectValue, module='lag') - return False + return for node in first_pair: if not check_mlag_support(node,l._linkname,topology): - return False + return if log.debug_active('lag'): print(f'LAG create_peer_links -> updated first link {l} from {member} -> {topology.links[l.linkindex-1]}') else: if not check_same_pair(member): # Check that any additional links connect the same nodes - return False + return member.linkindex = len(topology.links)+1 - member.lag._parentindex = l.linkindex # Keep track of parent + member.lag._peerlink = l.linkindex # Keep track of parent if log.debug_active('lag'): print(f'LAG create_peer_links -> adding link {member}') topology.links.append(member) - - return True + + topology.links[l.linkindex-1].pop("lag.members",None) # Cleanup """ -process_lag_links - process all links with 'lag' attribute +process_lag_link - process link with 'lag' attribute to create links for lag.members + Returns True iff a virtual_lag was created """ -def process_lag_links(topology: Box) -> None: - for l in list(topology.links): # Make a copy of the list, gets modified - if 'lag' not in l: - continue - elif not 'members' in l.lag: - log.error(f'must define "lag.members" on LAG link {l._linkname}', - category=log.IncorrectAttr, - module='lag') - continue - elif not _types.must_be_list(parent=l.lag,key='members',path=l._linkname,module='lag'): - continue - - peerlink_id = l.get(PEERLINK_ID_ATT,None) # Turn internal MLAG links into p2p links - if peerlink_id: - if peerlink_id is True: # Auto-assign peerlink ID if requested - l[PEERLINK_ID_ATT] = _dataplane.get_next_id(PEERLINK_ID_SET) - l.type = 'p2p' - l.prefix = False # L2-only - if not create_peer_links(l,topology): # Check for errors - return - else: - l.type = 'lag' - create_lag_member_links(l,topology) - topology.links[l.linkindex-1].lag.pop("members",None) +def process_lag_link(link: Box, topology: Box) -> bool: + if not 'members' in link.lag: + log.error(f'must define "lag.members" on LAG link {link._linkname}', + category=log.IncorrectAttr, + module='lag') + return False + elif not _types.must_be_list(parent=link.lag,key='members',path=link._linkname,module='lag'): + return False + + peerlink_id = link.get(PEERLINK_ID_ATT,None) # Turn internal MLAG links into p2p links + if peerlink_id: + if peerlink_id is True: # Auto-assign peerlink ID if requested + link[PEERLINK_ID_ATT] = _dataplane.get_next_id(PEERLINK_ID_SET) + link.type = 'p2p' + link.prefix = False # L2-only + create_peer_links(link,topology) + return False + else: + link._virtual_lag = True # Temporary virtual link, removed in module_post_link_transform + return create_lag_member_links(link,topology) # # populate_mlag_peer - Lookup the IPv4 loopback address for the mlag peer, and derive a virtual MAC to use @@ -369,15 +385,46 @@ def populate_mlag_peer(node: Box, intf: Box, topology: Box) -> None: class LAG(_Module): """ - module_pre_transform -- Add links listed in each lag.members to the topology + module_pre_transform -- Analyze any user provided lag.ifindex values and peerlink ids, + convert lag.members to links and create 'lag' type interfaces + + Note: link.interfaces must be populated before vlan.link_pre_transform is called """ def module_pre_transform(self, topology: Box) -> None: if log.debug_active('lag'): - print(f'LAG module_pre_transform') + print(f'LAG module_pre_transform: Convert lag.members into additional topology.links') + + if not 'links' in topology: + return + populate_lag_id_set(topology) populate_peerlink_id_set(topology) - process_lag_links(topology) # Expand lag.members into additional p2p links + for link in list(topology.links): # Make a copy, may get modified + if 'lag' in link: + if process_lag_link(link,topology): + create_lag_interfaces(link,topology) # Create lag interfaces + + """ + link_pre_link_transform - rename interface '_type' to 'type' (after validation) + + The interface 'type' attribute is added internally, and cannot be defined in the data model. + It should have been called '_type' to begin with, but that ship has sailed a while ago. This module + implements a workaround by calling it '_type' during validation (allowing it to be skipped), and then + renaming it to 'type' here + """ + def link_pre_link_transform(self, link: Box, topology: Box) -> None: + for intf in link.interfaces: + if intf.get('_type',None)=='lag': + intf.type = intf.pop('_type') + + """ + module_post_link_transform - remove temporary 'virtual_lag' links + """ + def module_post_link_transform(self, topology: Box) -> None: + if log.debug_active('lag'): + print(f'LAG module_post_link_transform: Cleanup "virtual_lag" links') + topology.links = [ link for link in topology.links if '_virtual_lag' not in link ] """ After attribute propagation and consolidation, verify that requested features are supported. @@ -390,20 +437,25 @@ def node_post_transform(self, node: Box, topology: Box) -> None: has_peerlink = False uses_mlag = False for i in node.interfaces: - if i.get(PEERLINK_ID_ATT,None): # Fill in peer loopback IP and vMAC for MLAG peer links + if i.get(PEERLINK_ID_ATT,None): # Fill in peer loopback IP and vMAC for MLAG peer links populate_mlag_peer(node,i,topology) has_peerlink = True elif i.type=='lag': node_atts = { k:v for k,v in node.get('lag',{}).items() if k!='mlag'} - i.lag = node_atts + i.lag # Merge node level settings with interface overrides - # i.pop('mtu',None) # Next PR: Remove any MTU settings - inherited from members + i.lag = node_atts + i.lag # Merge node level settings with interface overrides + i.pop('mtu',None) # Remove any MTU settings - inherited from members if 'mode' in i.lag: log.error(f'lag.mode {i.lag.mode} used by node {node.name} is deprecated, use only 802.3ad', category=Warning, module='lag') if i.lag.mode!='802.3ad': - i.lag.lacp = 'off' # Disable LACP for other modes + i.lag.lacp = 'off' # Disable LACP for other modes + + linkindex = i.pop('linkindex',None) # Remove linkindex (copied from link that no longer exists) + for m in node.interfaces: # Update members to point to lag.ifindex, replacing linkindex + if m.get('lag._parentindex',None)==linkindex: + m.lag._parentindex = i.lag.ifindex # Make _parentindex point to lag.ifindex instead lacp_mode = i.get('lag.lacp_mode') if lacp_mode=='passive' and not features.lag.get('passive',False): @@ -422,4 +474,4 @@ def node_post_transform(self, node: Box, topology: Box) -> None: category=log.IncorrectAttr, module='lag') - node.pop('_lag_ifindex',None) # Cleanup + node.pop('_lag_ifindex',None) # Cleanup diff --git a/netsim/modules/lag.yml b/netsim/modules/lag.yml index 0653c0c7ac..1e005f980d 100644 --- a/netsim/modules/lag.yml +++ b/netsim/modules/lag.yml @@ -39,21 +39,21 @@ attributes: # _mlag: bool # Copy only these L2 attributes into LAG physical link members - lag_l2_ifattr: + lag_l2_linkattr: mtu: bandwidth: # Keep only these attributes on member links - lag_member_ifattr: + lag_member_linkattr: mtu: bandwidth: - type: - prefix: _linkname: interfaces: + # prefix: # Don't copy these attributes to lag interfaces lag_no_propagate: interfaces: _linkname: name: + mtu: diff --git a/tests/errors/link-invalid-type.log b/tests/errors/link-invalid-type.log index e47a24f608..e1f37082a0 100644 --- a/tests/errors/link-invalid-type.log +++ b/tests/errors/link-invalid-type.log @@ -1,4 +1,4 @@ IncorrectValue in links: attribute links[1].type has invalid value(s): wtf -... valid values are: lan,p2p,stub,loopback,tunnel,vlan_member,lag +... valid values are: lan,p2p,stub,loopback,tunnel,vlan_member ... use 'netlab show attributes link' to display valid attributes Fatal error in netlab: Cannot proceed beyond this point due to errors, exiting diff --git a/tests/integration/lag/04-host-mlag.yml b/tests/integration/lag/04-host-mlag.yml index b1c2b97b68..62099b85f5 100644 --- a/tests/integration/lag/04-host-mlag.yml +++ b/tests/integration/lag/04-host-mlag.yml @@ -22,11 +22,9 @@ links: # 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: diff --git a/tests/integration/lag/07-mlag-trunk.yml b/tests/integration/lag/07-mlag-trunk.yml index 6791a61b71..d409bbf6bc 100644 --- a/tests/integration/lag/07-mlag-trunk.yml +++ b/tests/integration/lag/07-mlag-trunk.yml @@ -6,11 +6,11 @@ message: | groups: _auto_create: true switches: - members: [s1, s2] - module: [lag, vlan] + members: [ s1, s2 ] + module: [ lag, vlan ] hosts: - members: [h1, h2] - module: [lag, vlan] # Host side must support lag to present single MAC on both interfaces + members: [ h1, h2 ] + module: [ lag, vlan ] # Host side must support lag to present single MAC on both interfaces device: frr vlans: @@ -33,19 +33,19 @@ links: - h1: s2: ifindex: 5 - vlan.trunk: [red] + vlan.trunk: [ red ] - lag: - members: [h2-s1, h2-s2] + members: [ h2-s1, h2-s2 ] vlan.access: red validate: ping: description: Pinging H2 from H1 - nodes: [h1] + nodes: [ h1 ] wait_msg: Waiting for STP to enable the ports wait: 45 plugin: ping(nodes.h2.interfaces[-1].ipv4,af='ipv4') ping_gw: description: Pinging gateway from H1 - nodes: [h1] + nodes: [ h1 ] plugin: ping(nodes.s1.interfaces[-1].ipv4,af='ipv4') diff --git a/tests/integration/lag/10-mlag-m-to-m-different-vlans.yml b/tests/integration/lag/10-mlag-m-to-m-different-vlans.yml index 67f0218dc0..2e2d6f902b 100644 --- a/tests/integration/lag/10-mlag-m-to-m-different-vlans.yml +++ b/tests/integration/lag/10-mlag-m-to-m-different-vlans.yml @@ -1,7 +1,13 @@ message: | The device under test are two pairs of switches, interconnected through - dual-sided MLAG links each carrying a different set of vlans The hosts should - be able to ping each other and their gateway + dual-sided MLAG links each carrying a different set of vlans. + This illustrates the need for 'split_dual_mlag_link' in the lag module. + + The devices are only pairwise adjacent in OSPF, a1-a2 and b1-b2 + + The hosts should be able to ping each other and various gateways + +defaults.device: eos prefix: p2p1: @@ -9,7 +15,7 @@ prefix: allocation: p2p # Oddly needed p2p2: pool: p2p - allocation: p2p # Oddly needed + allocation: p2p vlans: ospf-pair1: @@ -32,7 +38,6 @@ groups: switches-a: members: [a1, a2] module: [lag, vlan, ospf] - device: eos vlans: ospf-pair1: @@ -40,7 +45,6 @@ groups: switches-b: members: [b1, b2] module: [lag, vlan, ospf] - device: eos vlans: ospf-pair2: @@ -60,15 +64,13 @@ links: mlag.peergroup: 2 vlan.trunk: [ospf-pair2] - lag: - # mlag: True members: - a1: b1: - vlan.trunk: [red] + vlan.trunk: [red] # Only 'red' - a2: b2: - vlan.trunk: [red, blue] - # vlan.trunk: [red] + vlan.trunk: [red, blue] # Both red and blue validate: ping: @@ -77,7 +79,11 @@ validate: wait_msg: Waiting for STP to enable the ports wait: 45 plugin: ping('h2') - ping_gw: - description: Pinging gateway from H1 + ping_gw_red: + description: Pinging red gateway on B1 from H1 nodes: [h1] - plugin: ping(nodes.b1.interfaces[4].ipv4,af='ipv4') + plugin: ping(nodes.b1.interfaces[-1].ipv4,af='ipv4') + ping_gw_blue: + description: Pinging blue gateway on A2 from H2 + nodes: [h2] + plugin: ping(nodes.a2.interfaces[-2].ipv4,af='ipv4') diff --git a/tests/topology/expected/lag-l2.yml b/tests/topology/expected/lag-l2.yml index e0e1b75ade..4372611841 100644 --- a/tests/topology/expected/lag-l2.yml +++ b/tests/topology/expected/lag-l2.yml @@ -5,38 +5,17 @@ lag: lacp: fast lacp_mode: active links: -- _linkname: links[1] - bridge: input_1 - interfaces: - - ifindex: 30000 - ifname: port-channel1 - lag: - ifindex: 1 - node: r1 - - ifindex: 30000 - ifname: port-channel1 - lag: - ifindex: 1 - node: r2 - lag: {} - linkindex: 1 - mtu: 1600 - node_count: 2 - prefix: false - stp: - enable: false - type: lag - _linkname: links[1].lag[1] interfaces: - ifindex: 1 - ifname: Ethernet1 + ifname: ethernet1/1/1 node: r1 - ifindex: 1 - ifname: Ethernet1 + ifname: ethernet1/1/1 node: r2 lag: _parentindex: 1 - linkindex: 2 + linkindex: 4 mtu: 1600 node_count: 2 prefix: false @@ -44,18 +23,74 @@ links: - _linkname: links[1].lag[2] interfaces: - ifindex: 2 - ifname: Ethernet2 + ifname: ethernet1/1/2 node: r1 - ifindex: 2 - ifname: Ethernet2 + ifname: ethernet1/1/2 node: r2 lag: _parentindex: 1 - linkindex: 3 + linkindex: 5 mtu: 1600 node_count: 2 prefix: false type: p2p +- _linkname: links[2].lag[1] + interfaces: + - ifindex: 3 + ifname: ethernet1/1/3 + node: r1 + - ifindex: 3 + ifname: ethernet1/1/3 + node: r2 + lag: + _parentindex: 2 + linkindex: 6 + node_count: 2 + prefix: false + type: p2p +- _linkname: links[2].lag[2] + interfaces: + - ifindex: 4 + ifname: ethernet1/1/4 + node: r1 + - ifindex: 4 + ifname: ethernet1/1/4 + node: r2 + lag: + _parentindex: 2 + linkindex: 7 + node_count: 2 + prefix: false + type: p2p +- _linkname: links[3].lag[1] + interfaces: + - ifindex: 5 + ifname: ethernet1/1/5 + node: r1 + - ifindex: 5 + ifname: ethernet1/1/5 + node: r2 + lag: + _parentindex: 3 + linkindex: 8 + node_count: 2 + prefix: false + type: p2p +- _linkname: links[3].lag[2] + interfaces: + - ifindex: 6 + ifname: ethernet1/1/6 + node: r1 + - ifindex: 6 + ifname: ethernet1/1/6 + node: r2 + lag: + _parentindex: 3 + linkindex: 9 + node_count: 2 + prefix: false + type: p2p module: - lag - vlan @@ -65,13 +100,10 @@ nodes: r1: af: ipv4: true - box: ceos:4.32.1F + box: vrnetlab/vr-ftosv clab: - env: - CLAB_MGMT_VRF: management - INTFTYPE: et - kind: ceos - device: eos + kind: vr-ftosv + device: dellos10 hostname: clab-input-r1 id: 1 interfaces: @@ -81,8 +113,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 1 - mtu: 1600 name: r1 -> r2 neighbors: - ifname: port-channel1 @@ -91,30 +121,106 @@ nodes: enable: false type: lag virtual_interface: true + - ifindex: 30001 + ifname: port-channel2 + lag: + ifindex: 2 + lacp: slow + lacp_mode: active + name: r1 -> r2 + neighbors: + - ifname: port-channel2 + node: r2 + type: lag + virtual_interface: true + - ifindex: 30002 + ifname: port-channel3 + lag: + ifindex: 3 + lacp: fast + lacp_mode: active + name: r1 -> r2 + neighbors: + - ifname: port-channel3 + node: r2 + type: lag + virtual_interface: true - clab: - name: et1 + name: eth1 ifindex: 1 - ifname: Ethernet1 + ifname: ethernet1/1/1 lag: _parentindex: 1 - linkindex: 2 + linkindex: 4 mtu: 1600 name: r1 -> r2 neighbors: - - ifname: Ethernet1 + - ifname: ethernet1/1/1 node: r2 type: p2p - clab: - name: et2 + name: eth2 ifindex: 2 - ifname: Ethernet2 + ifname: ethernet1/1/2 lag: _parentindex: 1 - linkindex: 3 + linkindex: 5 mtu: 1600 name: r1 -> r2 neighbors: - - ifname: Ethernet2 + - ifname: ethernet1/1/2 + node: r2 + type: p2p + - clab: + name: eth3 + ifindex: 3 + ifname: ethernet1/1/3 + lag: + _parentindex: 2 + linkindex: 6 + mtu: 1500 + name: r1 -> r2 + neighbors: + - ifname: ethernet1/1/3 + node: r2 + type: p2p + - clab: + name: eth4 + ifindex: 4 + ifname: ethernet1/1/4 + lag: + _parentindex: 2 + linkindex: 7 + mtu: 1500 + name: r1 -> r2 + neighbors: + - ifname: ethernet1/1/4 + node: r2 + type: p2p + - clab: + name: eth5 + ifindex: 5 + ifname: ethernet1/1/5 + lag: + _parentindex: 3 + linkindex: 8 + mtu: 1500 + name: r1 -> r2 + neighbors: + - ifname: ethernet1/1/5 + node: r2 + type: p2p + - clab: + name: eth6 + ifindex: 6 + ifname: ethernet1/1/6 + lag: + _parentindex: 3 + linkindex: 9 + mtu: 1500 + name: r1 -> r2 + neighbors: + - ifname: ethernet1/1/6 node: r2 type: p2p lag: @@ -122,19 +228,20 @@ nodes: lacp_mode: active loopback: ifindex: 0 - ifname: Loopback0 + ifname: loopback0 ipv4: 10.0.0.1/32 neighbors: [] type: loopback virtual_interface: true mgmt: - ifname: Management0 + ifname: mgmt1/1/1 ipv4: 192.168.121.101 mac: 08:4f:a9:00:00:01 module: - lag - vlan - stp + mtu: 1500 name: r1 stp: enable: true @@ -142,13 +249,10 @@ nodes: r2: af: ipv4: true - box: ceos:4.32.1F + box: vrnetlab/vr-ftosv clab: - env: - CLAB_MGMT_VRF: management - INTFTYPE: et - kind: ceos - device: eos + kind: vr-ftosv + device: dellos10 hostname: clab-input-r2 id: 2 interfaces: @@ -156,10 +260,8 @@ nodes: ifname: port-channel1 lag: ifindex: 1 - lacp: fast + lacp: slow lacp_mode: active - linkindex: 1 - mtu: 1600 name: r2 -> r1 neighbors: - ifname: port-channel1 @@ -168,50 +270,127 @@ nodes: enable: false type: lag virtual_interface: true + - ifindex: 30001 + ifname: port-channel2 + lag: + ifindex: 2 + lacp: slow + lacp_mode: active + name: r2 -> r1 + neighbors: + - ifname: port-channel2 + node: r1 + type: lag + virtual_interface: true + - ifindex: 30002 + ifname: port-channel3 + lag: + ifindex: 3 + lacp: fast + lacp_mode: active + name: r2 -> r1 + neighbors: + - ifname: port-channel3 + node: r1 + type: lag + virtual_interface: true - clab: - name: et1 + name: eth1 ifindex: 1 - ifname: Ethernet1 + ifname: ethernet1/1/1 lag: _parentindex: 1 - linkindex: 2 + linkindex: 4 mtu: 1600 name: r2 -> r1 neighbors: - - ifname: Ethernet1 + - ifname: ethernet1/1/1 node: r1 type: p2p - clab: - name: et2 + name: eth2 ifindex: 2 - ifname: Ethernet2 + ifname: ethernet1/1/2 lag: _parentindex: 1 - linkindex: 3 + linkindex: 5 mtu: 1600 name: r2 -> r1 neighbors: - - ifname: Ethernet2 + - ifname: ethernet1/1/2 + node: r1 + type: p2p + - clab: + name: eth3 + ifindex: 3 + ifname: ethernet1/1/3 + lag: + _parentindex: 2 + linkindex: 6 + mtu: 1500 + name: r2 -> r1 + neighbors: + - ifname: ethernet1/1/3 + node: r1 + type: p2p + - clab: + name: eth4 + ifindex: 4 + ifname: ethernet1/1/4 + lag: + _parentindex: 2 + linkindex: 7 + mtu: 1500 + name: r2 -> r1 + neighbors: + - ifname: ethernet1/1/4 + node: r1 + type: p2p + - clab: + name: eth5 + ifindex: 5 + ifname: ethernet1/1/5 + lag: + _parentindex: 3 + linkindex: 8 + mtu: 1500 + name: r2 -> r1 + neighbors: + - ifname: ethernet1/1/5 + node: r1 + type: p2p + - clab: + name: eth6 + ifindex: 6 + ifname: ethernet1/1/6 + lag: + _parentindex: 3 + linkindex: 9 + mtu: 1500 + name: r2 -> r1 + neighbors: + - ifname: ethernet1/1/6 node: r1 type: p2p lag: - lacp: fast + lacp: slow lacp_mode: active loopback: ifindex: 0 - ifname: Loopback0 + ifname: loopback0 ipv4: 10.0.0.2/32 neighbors: [] type: loopback virtual_interface: true mgmt: - ifname: Management0 + ifname: mgmt1/1/1 ipv4: 192.168.121.102 mac: 08:4f:a9:00:00:02 module: - lag - vlan - stp + mtu: 1500 name: r2 stp: enable: true diff --git a/tests/topology/expected/lag-l3-access-vlan.yml b/tests/topology/expected/lag-l3-access-vlan.yml index ce93b4670e..34c8f83b91 100644 --- a/tests/topology/expected/lag-l3-access-vlan.yml +++ b/tests/topology/expected/lag-l3-access-vlan.yml @@ -5,37 +5,6 @@ lag: lacp: fast lacp_mode: active links: -- _linkname: links[1] - bridge: input_1 - interfaces: - - _vlan_mode: irb - ifindex: 30000 - ifname: bond1 - ipv4: 172.16.0.1/24 - lag: - ifindex: 1 - node: r1 - vlan: - access: v1 - - _vlan_mode: irb - ifindex: 30000 - ifname: bond1 - ipv4: 172.16.0.2/24 - lag: - ifindex: 1 - node: r2 - vlan: - access: v1 - lag: - lacp: 'off' - linkindex: 1 - node_count: 2 - prefix: - allocation: id_based - ipv4: 172.16.0.0/24 - type: lag - vlan: - access: v1 - _linkname: links[1].lag[1] interfaces: - ifindex: 1 @@ -105,8 +74,6 @@ nodes: ifindex: 1 lacp: 'off' lacp_mode: active - linkindex: 1 - mtu: 1500 name: '[Access VLAN v1] r1 -> r2' neighbors: - ifname: bond1 @@ -215,8 +182,6 @@ nodes: ifindex: 1 lacp: 'off' lacp_mode: active - linkindex: 1 - mtu: 1500 name: '[Access VLAN v1] r2 -> r1' neighbors: - ifname: bond1 diff --git a/tests/topology/expected/lag-l3.yml b/tests/topology/expected/lag-l3.yml index f9a197a0ae..e28790d2be 100644 --- a/tests/topology/expected/lag-l3.yml +++ b/tests/topology/expected/lag-l3.yml @@ -1,3 +1,9 @@ +gateway: + anycast: + mac: 0200.cafe.00ff + unicast: true + vrrp: + group: 1 input: - topology/input/lag-l3.yml - package:topology-defaults.yml @@ -5,27 +11,6 @@ lag: lacp: fast lacp_mode: active links: -- _linkname: links[1] - bridge: input_1 - interfaces: - - ifindex: 30000 - ifname: port-channel1 - ipv4: 10.1.0.1/30 - lag: - ifindex: 1 - node: r1 - - ifindex: 30000 - ifname: port-channel1 - ipv4: 10.1.0.2/30 - lag: - ifindex: 1 - node: r2 - lag: {} - linkindex: 1 - node_count: 2 - prefix: - ipv4: 10.1.0.0/30 - type: lag - _linkname: links[1].lag[1] interfaces: - ifindex: 1 @@ -36,7 +21,7 @@ links: node: r2 lag: _parentindex: 1 - linkindex: 2 + linkindex: 3 node_count: 2 prefix: false type: p2p @@ -50,13 +35,41 @@ links: node: r2 lag: _parentindex: 1 - linkindex: 3 + linkindex: 4 + node_count: 2 + prefix: false + type: p2p +- _linkname: links[2].lag[1] + interfaces: + - ifindex: 3 + ifname: ethernet1/1/3 + node: r1 + - ifindex: 3 + ifname: ethernet1/1/3 + node: r2 + lag: + _parentindex: 2 + linkindex: 5 + node_count: 2 + prefix: false + type: p2p +- _linkname: links[2].lag[2] + interfaces: + - ifindex: 4 + ifname: ethernet1/1/4 + node: r1 + - ifindex: 4 + ifname: ethernet1/1/4 + node: r2 + lag: + _parentindex: 2 + linkindex: 6 node_count: 2 prefix: false type: p2p module: +- gateway - lag -- vlan name: input nodes: r1: @@ -66,6 +79,9 @@ nodes: clab: kind: vr-ftosv device: dellos10 + gateway: + vrrp: + group: 1 hostname: clab-input-r1 id: 1 interfaces: @@ -76,8 +92,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 1 - mtu: 1500 name: r1 -> r2 neighbors: - ifname: port-channel1 @@ -85,13 +99,34 @@ nodes: node: r2 type: lag virtual_interface: true + - gateway: + id: -2 + ipv4: 10.11.12.254/24 + protocol: vrrp + vrrp: + group: 1 + ifindex: 30001 + ifname: port-channel2 + ipv4: 10.11.12.12/24 + lag: + ifindex: 2 + lacp: fast + lacp_mode: active + name: r1 -> r2 + neighbors: + - gateway: false + ifname: port-channel2 + ipv4: 10.11.12.2/24 + node: r2 + type: lag + virtual_interface: true - clab: name: eth1 ifindex: 1 ifname: ethernet1/1/1 lag: _parentindex: 1 - linkindex: 2 + linkindex: 3 mtu: 1500 name: r1 -> r2 neighbors: @@ -104,13 +139,39 @@ nodes: ifname: ethernet1/1/2 lag: _parentindex: 1 - linkindex: 3 + linkindex: 4 mtu: 1500 name: r1 -> r2 neighbors: - ifname: ethernet1/1/2 node: r2 type: p2p + - clab: + name: eth3 + ifindex: 3 + ifname: ethernet1/1/3 + lag: + _parentindex: 2 + linkindex: 5 + mtu: 1500 + name: r1 -> r2 + neighbors: + - ifname: ethernet1/1/3 + node: r2 + type: p2p + - clab: + name: eth4 + ifindex: 4 + ifname: ethernet1/1/4 + lag: + _parentindex: 2 + linkindex: 6 + mtu: 1500 + name: r1 -> r2 + neighbors: + - ifname: ethernet1/1/4 + node: r2 + type: p2p lag: lacp: fast lacp_mode: active @@ -127,7 +188,7 @@ nodes: mac: 08:4f:a9:00:00:01 module: - lag - - vlan + - gateway mtu: 1500 name: r1 r2: @@ -147,8 +208,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 1 - mtu: 1500 name: r2 -> r1 neighbors: - ifname: port-channel1 @@ -156,13 +215,36 @@ nodes: node: r1 type: lag virtual_interface: true + - ifindex: 30001 + ifname: port-channel2 + ipv4: 10.11.12.2/24 + lag: + ifindex: 2 + lacp: fast + lacp_mode: active + name: r2 -> r1 + neighbors: + - gateway: + anycast: + mac: 0200.cafe.00ff + unicast: true + id: -2 + ipv4: 10.11.12.254/24 + protocol: vrrp + vrrp: + group: 1 + ifname: port-channel2 + ipv4: 10.11.12.12/24 + node: r1 + type: lag + virtual_interface: true - clab: name: eth1 ifindex: 1 ifname: ethernet1/1/1 lag: _parentindex: 1 - linkindex: 2 + linkindex: 3 mtu: 1500 name: r2 -> r1 neighbors: @@ -175,13 +257,39 @@ nodes: ifname: ethernet1/1/2 lag: _parentindex: 1 - linkindex: 3 + linkindex: 4 mtu: 1500 name: r2 -> r1 neighbors: - ifname: ethernet1/1/2 node: r1 type: p2p + - clab: + name: eth3 + ifindex: 3 + ifname: ethernet1/1/3 + lag: + _parentindex: 2 + linkindex: 5 + mtu: 1500 + name: r2 -> r1 + neighbors: + - ifname: ethernet1/1/3 + node: r1 + type: p2p + - clab: + name: eth4 + ifindex: 4 + ifname: ethernet1/1/4 + lag: + _parentindex: 2 + linkindex: 6 + mtu: 1500 + name: r2 -> r1 + neighbors: + - ifname: ethernet1/1/4 + node: r1 + type: p2p lag: lacp: fast lacp_mode: active @@ -198,7 +306,6 @@ nodes: mac: 08:4f:a9:00:00:02 module: - lag - - vlan mtu: 1500 name: r2 provider: clab diff --git a/tests/topology/expected/lag-mlag-m_to_m.yml b/tests/topology/expected/lag-mlag-m_to_m.yml index 119255c803..20cdc2c557 100644 --- a/tests/topology/expected/lag-mlag-m_to_m.yml +++ b/tests/topology/expected/lag-mlag-m_to_m.yml @@ -51,77 +51,17 @@ links: node_count: 2 prefix: false type: p2p -- _linkname: links[3] - bridge: input_3 - interfaces: - - ifindex: 30000 - ifname: port-channel1 - lag: - _mlag: true - node: a2 - vlan: - trunk: - red: {} - - ifindex: 30000 - ifname: port-channel1 - lag: - _mlag: true - node: b2 - vlan: - trunk: - red: {} - lag: - ifindex: 1 - linkindex: 3 - node_count: 2 - prefix: {} - type: lag - vlan: - trunk: - red: {} -- _linkname: links[3]-2 - bridge: input_4 - interfaces: - - ifindex: 30000 - ifname: port-channel1 - lag: - _mlag: true - node: a1 - vlan: - trunk: - red: {} - - ifindex: 30000 - ifname: port-channel1 - lag: - _mlag: true - node: b1 - vlan: - trunk: - red: {} - lag: - ifindex: 1 - linkindex: 4 - node_count: 2 - prefix: {} - type: lag - vlan: - trunk: - red: {} - _linkname: links[3].lag[1] interfaces: - ifindex: 2 ifname: Ethernet2 - lag: - ifindex: 10 node: a1 - ifindex: 2 ifname: Ethernet2 - lag: - ifindex: 20 node: b1 lag: - _parentindex: 4 - linkindex: 5 + _parentindex: 6 + linkindex: 4 node_count: 2 prefix: false type: p2p @@ -129,17 +69,13 @@ links: interfaces: - ifindex: 2 ifname: Ethernet2 - lag: - ifindex: 10 node: a2 - ifindex: 2 ifname: Ethernet2 - lag: - ifindex: 20 node: b2 lag: _parentindex: 3 - linkindex: 6 + linkindex: 5 node_count: 2 prefix: false type: p2p @@ -218,17 +154,26 @@ nodes: - ifname: Ethernet1 node: a2 type: p2p + - ifindex: 2 + ifname: Ethernet2 + lag: + _parentindex: 10 + linkindex: 4 + name: a1 -> b1 + neighbors: + - ifname: Ethernet2 + node: b1 + type: p2p - ifindex: 30000 - ifname: port-channel1 + ifname: port-channel10 lag: _mlag: true - ifindex: 1 + ifindex: 10 lacp: fast lacp_mode: active - linkindex: 4 name: a1 -> b1 neighbors: - - ifname: port-channel1 + - ifname: port-channel20 node: b1 type: lag virtual_interface: true @@ -237,17 +182,6 @@ nodes: red: {} trunk_id: - 1000 - - ifindex: 2 - ifname: Ethernet2 - lag: - _parentindex: 4 - ifindex: 10 - linkindex: 5 - name: a1 -> b1 - neighbors: - - ifname: Ethernet2 - node: b1 - type: p2p - bridge: input_7 ifindex: 3 ifname: Ethernet3 @@ -338,16 +272,15 @@ nodes: node: a1 type: p2p - ifindex: 30000 - ifname: port-channel1 + ifname: port-channel10 lag: _mlag: true - ifindex: 1 + ifindex: 10 lacp: fast lacp_mode: active - linkindex: 3 name: a2 -> b2 neighbors: - - ifname: port-channel1 + - ifname: port-channel20 node: b2 type: lag virtual_interface: true @@ -359,9 +292,8 @@ nodes: - ifindex: 2 ifname: Ethernet2 lag: - _parentindex: 3 - ifindex: 10 - linkindex: 6 + _parentindex: 10 + linkindex: 5 name: a2 -> b2 neighbors: - ifname: Ethernet2 @@ -443,17 +375,26 @@ nodes: - ifname: Ethernet1 node: b2 type: p2p + - ifindex: 2 + ifname: Ethernet2 + lag: + _parentindex: 20 + linkindex: 4 + name: b1 -> a1 + neighbors: + - ifname: Ethernet2 + node: a1 + type: p2p - ifindex: 30000 - ifname: port-channel1 + ifname: port-channel20 lag: _mlag: true - ifindex: 1 + ifindex: 20 lacp: fast lacp_mode: active - linkindex: 4 name: b1 -> a1 neighbors: - - ifname: port-channel1 + - ifname: port-channel10 node: a1 type: lag virtual_interface: true @@ -462,17 +403,6 @@ nodes: red: {} trunk_id: - 1000 - - ifindex: 2 - ifname: Ethernet2 - lag: - _parentindex: 4 - ifindex: 20 - linkindex: 5 - name: b1 -> a1 - neighbors: - - ifname: Ethernet2 - node: a1 - type: p2p - bridge_group: 1 ifindex: 4 ifname: Vlan1000 @@ -550,16 +480,15 @@ nodes: node: b1 type: p2p - ifindex: 30000 - ifname: port-channel1 + ifname: port-channel20 lag: _mlag: true - ifindex: 1 + ifindex: 20 lacp: fast lacp_mode: active - linkindex: 3 name: b2 -> a2 neighbors: - - ifname: port-channel1 + - ifname: port-channel10 node: a2 type: lag virtual_interface: true @@ -571,9 +500,8 @@ nodes: - ifindex: 2 ifname: Ethernet2 lag: - _parentindex: 3 - ifindex: 20 - linkindex: 6 + _parentindex: 20 + linkindex: 5 name: b2 -> a2 neighbors: - ifname: Ethernet2 diff --git a/tests/topology/expected/lag-mlag.yml b/tests/topology/expected/lag-mlag.yml index baa979d004..8744f7dabd 100644 --- a/tests/topology/expected/lag-mlag.yml +++ b/tests/topology/expected/lag-mlag.yml @@ -31,144 +31,6 @@ links: node_count: 2 prefix: false type: p2p -- _linkname: links[2] - bridge: input_2 - interfaces: - - _vlan_mode: irb - ifindex: 30000 - ifname: bond1 - ipv4: 172.16.0.3/24 - lag: - ifindex: 1 - node: h1 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30000 - ifname: port-channel1 - ipv4: 172.16.0.1/24 - lag: - _mlag: true - node: s1 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30000 - ifname: port-channel1 - ipv4: 172.16.0.2/24 - lag: - _mlag: true - node: s2 - vlan: - access: red - lag: - ifindex: 1 - linkindex: 2 - node_count: 3 - prefix: - allocation: id_based - ipv4: 172.16.0.0/24 - type: lag - vlan: - access: red -- _linkname: links[3] - bridge: input_3 - interfaces: - - ifindex: 30001 - ifname: bond2 - lag: - ifindex: 2 - node: h1 - - ifindex: 30001 - ifname: port-channel2 - lag: - ifindex: 2 - node: s1 - lag: {} - linkindex: 3 - node_count: 2 - pool: l2only - type: lag -- _linkname: links[4] - bridge: input_4 - interfaces: - - _vlan_mode: irb - ifindex: 30000 - ifname: bond1 - ipv4: 172.16.0.4/24 - lag: - ifindex: 1 - node: h2 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30002 - ifname: port-channel3 - ipv4: 172.16.0.1/24 - lag: - _mlag: true - node: s1 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30001 - ifname: port-channel3 - ipv4: 172.16.0.2/24 - lag: - _mlag: true - node: s2 - vlan: - access: red - lag: - ifindex: 3 - linkindex: 4 - node_count: 3 - prefix: - allocation: id_based - ipv4: 172.16.0.0/24 - type: lag - vlan: - access: red -- _linkname: links[5] - bridge: input_5 - interfaces: - - _vlan_mode: irb - ifindex: 30001 - ifname: bond2 - ipv4: 172.16.0.4/24 - lag: - ifindex: 2 - node: h2 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30003 - ifname: port-channel4 - ipv4: 172.16.0.1/24 - lag: - _mlag: true - node: s1 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30002 - ifname: port-channel4 - ipv4: 172.16.0.2/24 - lag: - _mlag: true - node: s2 - vlan: - access: red - lag: - ifindex: 4 - linkindex: 5 - node_count: 3 - prefix: - allocation: id_based - ipv4: 172.16.0.0/24 - type: lag - vlan: - access: red - _linkname: links[1].peerlink[2] interfaces: - ifindex: 2 @@ -178,7 +40,7 @@ links: ifname: ethernet1/1/2 node: s1 lag: - _parentindex: 1 + _peerlink: 1 linkindex: 6 node_count: 2 prefix: false @@ -378,8 +240,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 2 - mtu: 1500 name: '[Access VLAN red] h1 -> [s1,s2]' neighbors: - ifname: port-channel1 @@ -399,8 +259,6 @@ nodes: ifindex: 2 lacp: fast lacp_mode: active - linkindex: 3 - mtu: 1500 name: h1 -> s1 neighbors: - ifname: port-channel2 @@ -411,7 +269,7 @@ nodes: - ifindex: 1 ifname: eth1 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 7 mtu: 1500 name: h1 -> s1 @@ -422,7 +280,7 @@ nodes: - ifindex: 2 ifname: eth2 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 8 mtu: 1500 name: h1 -> s1 @@ -433,7 +291,7 @@ nodes: - ifindex: 3 ifname: eth3 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 9 mtu: 1500 name: h1 -> s2 @@ -444,7 +302,7 @@ nodes: - ifindex: 4 ifname: eth4 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 10 mtu: 1500 name: h1 -> s2 @@ -455,7 +313,7 @@ nodes: - ifindex: 5 ifname: eth5 lag: - _parentindex: 3 + _parentindex: 2 linkindex: 11 mtu: 1500 name: h1 -> s1 @@ -466,7 +324,7 @@ nodes: - ifindex: 6 ifname: eth6 lag: - _parentindex: 3 + _parentindex: 2 linkindex: 12 mtu: 1500 name: h1 -> s1 @@ -545,8 +403,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 4 - mtu: 1500 name: '[Access VLAN red] h2 -> [s1,s2]' neighbors: - ifname: port-channel3 @@ -566,8 +422,6 @@ nodes: ifindex: 2 lacp: fast lacp_mode: active - linkindex: 5 - mtu: 1500 name: '[Access VLAN red] h2 -> [s1,s2]' neighbors: - ifname: port-channel4 @@ -584,7 +438,7 @@ nodes: - ifindex: 1 ifname: eth1 lag: - _parentindex: 4 + _parentindex: 1 linkindex: 13 mtu: 1500 name: h2 -> s1 @@ -595,7 +449,7 @@ nodes: - ifindex: 2 ifname: eth2 lag: - _parentindex: 4 + _parentindex: 1 linkindex: 14 mtu: 1500 name: h2 -> s1 @@ -606,7 +460,7 @@ nodes: - ifindex: 3 ifname: eth3 lag: - _parentindex: 4 + _parentindex: 1 linkindex: 15 mtu: 1500 name: h2 -> s2 @@ -617,7 +471,7 @@ nodes: - ifindex: 4 ifname: eth4 lag: - _parentindex: 4 + _parentindex: 1 linkindex: 16 mtu: 1500 name: h2 -> s2 @@ -628,7 +482,7 @@ nodes: - ifindex: 5 ifname: eth5 lag: - _parentindex: 5 + _parentindex: 2 linkindex: 17 mtu: 1500 name: h2 -> s1 @@ -639,7 +493,7 @@ nodes: - ifindex: 6 ifname: eth6 lag: - _parentindex: 5 + _parentindex: 2 linkindex: 18 mtu: 1500 name: h2 -> s2 @@ -729,8 +583,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 2 - mtu: 1500 name: '[Access VLAN red] s1 -> [h1,s2]' neighbors: - ifname: bond1 @@ -750,8 +602,6 @@ nodes: ifindex: 2 lacp: fast lacp_mode: active - linkindex: 3 - mtu: 1500 name: s1 -> h1 neighbors: - ifname: bond2 @@ -766,8 +616,6 @@ nodes: ifindex: 3 lacp: fast lacp_mode: active - linkindex: 4 - mtu: 1500 name: '[Access VLAN red] s1 -> [h2,s2]' neighbors: - ifname: bond1 @@ -788,8 +636,6 @@ nodes: ifindex: 4 lacp: fast lacp_mode: active - linkindex: 5 - mtu: 1500 name: '[Access VLAN red] s1 -> [h2,s2]' neighbors: - ifname: bond2 @@ -808,7 +654,7 @@ nodes: ifindex: 2 ifname: ethernet1/1/2 lag: - _parentindex: 1 + _peerlink: 1 linkindex: 6 mtu: 1500 name: s1 -> s2 @@ -821,7 +667,7 @@ nodes: ifindex: 3 ifname: ethernet1/1/3 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 7 mtu: 1500 name: s1 -> h1 @@ -834,7 +680,7 @@ nodes: ifindex: 4 ifname: ethernet1/1/4 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 8 mtu: 1500 name: s1 -> h1 @@ -847,7 +693,7 @@ nodes: ifindex: 5 ifname: ethernet1/1/5 lag: - _parentindex: 3 + _parentindex: 2 linkindex: 11 mtu: 1500 name: s1 -> h1 @@ -860,7 +706,7 @@ nodes: ifindex: 6 ifname: ethernet1/1/6 lag: - _parentindex: 3 + _parentindex: 2 linkindex: 12 mtu: 1500 name: s1 -> h1 @@ -873,7 +719,7 @@ nodes: ifindex: 7 ifname: ethernet1/1/7 lag: - _parentindex: 4 + _parentindex: 3 linkindex: 13 mtu: 1500 name: s1 -> h2 @@ -886,7 +732,7 @@ nodes: ifindex: 8 ifname: ethernet1/1/8 lag: - _parentindex: 4 + _parentindex: 3 linkindex: 14 mtu: 1500 name: s1 -> h2 @@ -899,7 +745,7 @@ nodes: ifindex: 9 ifname: ethernet1/1/9 lag: - _parentindex: 5 + _parentindex: 4 linkindex: 17 mtu: 1500 name: s1 -> h2 @@ -989,8 +835,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 2 - mtu: 1500 name: '[Access VLAN red] s2 -> [h1,s1]' neighbors: - ifname: bond1 @@ -1011,8 +855,6 @@ nodes: ifindex: 3 lacp: fast lacp_mode: active - linkindex: 4 - mtu: 1500 name: '[Access VLAN red] s2 -> [h2,s1]' neighbors: - ifname: bond1 @@ -1033,8 +875,6 @@ nodes: ifindex: 4 lacp: fast lacp_mode: active - linkindex: 5 - mtu: 1500 name: '[Access VLAN red] s2 -> [h2,s1]' neighbors: - ifname: bond2 @@ -1053,7 +893,7 @@ nodes: ifindex: 2 ifname: ethernet1/1/2 lag: - _parentindex: 1 + _peerlink: 1 linkindex: 6 mtu: 1500 name: s2 -> s1 @@ -1066,7 +906,7 @@ nodes: ifindex: 3 ifname: ethernet1/1/3 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 9 mtu: 1500 name: s2 -> h1 @@ -1079,7 +919,7 @@ nodes: ifindex: 4 ifname: ethernet1/1/4 lag: - _parentindex: 2 + _parentindex: 1 linkindex: 10 mtu: 1500 name: s2 -> h1 @@ -1092,7 +932,7 @@ nodes: ifindex: 5 ifname: ethernet1/1/5 lag: - _parentindex: 4 + _parentindex: 3 linkindex: 15 mtu: 1500 name: s2 -> h2 @@ -1105,7 +945,7 @@ nodes: ifindex: 6 ifname: ethernet1/1/6 lag: - _parentindex: 4 + _parentindex: 3 linkindex: 16 mtu: 1500 name: s2 -> h2 @@ -1118,7 +958,7 @@ nodes: ifindex: 7 ifname: ethernet1/1/7 lag: - _parentindex: 5 + _parentindex: 4 linkindex: 18 mtu: 1500 name: s2 -> h2 diff --git a/tests/topology/expected/lag-l3-vlan-trunk.yml b/tests/topology/expected/lag-vlan-trunk.yml similarity index 83% rename from tests/topology/expected/lag-l3-vlan-trunk.yml rename to tests/topology/expected/lag-vlan-trunk.yml index cf2221dbcd..bca6c0e858 100644 --- a/tests/topology/expected/lag-l3-vlan-trunk.yml +++ b/tests/topology/expected/lag-vlan-trunk.yml @@ -1,40 +1,10 @@ input: -- topology/input/lag-l3-vlan-trunk.yml +- topology/input/lag-vlan-trunk.yml - package:topology-defaults.yml lag: lacp: fast lacp_mode: active links: -- _linkname: links[1] - bridge: input_1 - interfaces: - - ifindex: 30000 - ifname: bond1 - lag: - ifindex: 1 - node: r1 - vlan: - trunk: - v1: {} - v2: {} - - ifindex: 30000 - ifname: bond1 - lag: - ifindex: 1 - node: r2 - vlan: - trunk: - v1: {} - v2: {} - lag: {} - linkindex: 1 - node_count: 2 - prefix: {} - type: lag - vlan: - trunk: - v1: {} - v2: {} - _linkname: links[1].lag[1] interfaces: - ifindex: 1 @@ -104,8 +74,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 1 - mtu: 1500 name: r1 -> r2 neighbors: - ifname: bond1 @@ -148,7 +116,7 @@ nodes: type: p2p - ifindex: 4 ifname: bond1.1000 - name: '[SubIf VLAN v1] r1 -> r2' + name: '[SubIf VLAN v1-irb] r1 -> r2' neighbors: - ifname: eth4 ipv4: 172.16.0.2/24 @@ -158,27 +126,26 @@ nodes: type: vlan_member virtual_interface: true vlan: - access: v1 + access: v1-irb access_id: 1000 - ifindex: 5 ifname: bond1.1001 - name: '[SubIf VLAN v2] r1 -> r2' + name: '[SubIf VLAN v2-bridge] r1 -> r2' neighbors: - ifname: eth5 - ipv4: 172.16.1.2/24 node: r2 parent_ifindex: 30000 parent_ifname: bond1 type: vlan_member virtual_interface: true vlan: - access: v2 + access: v2-bridge access_id: 1001 - bridge_group: 1 ifindex: 6 ifname: vlan1000 ipv4: 172.16.0.1/24 - name: VLAN v1 (1000) -> [r2] + name: VLAN v1-irb (1000) -> [r2] neighbors: - ifname: vlan1000 ipv4: 172.16.0.2/24 @@ -187,21 +154,19 @@ nodes: virtual_interface: true vlan: mode: irb - name: v1 + name: v1-irb - bridge_group: 2 ifindex: 7 ifname: vlan1001 - ipv4: 172.16.1.1/24 - name: VLAN v2 (1001) -> [r2] + name: VLAN v2-bridge (1001) -> [r2] neighbors: - ifname: vlan1001 - ipv4: 172.16.1.2/24 node: r2 type: svi virtual_interface: true vlan: - mode: irb - name: v2 + mode: bridge + name: v2-bridge lag: lacp: fast lacp_mode: active @@ -224,17 +189,17 @@ nodes: vlan: max_bridge_group: 2 vlans: - v1: + v1-irb: bridge_group: 1 id: 1000 mode: irb prefix: allocation: id_based ipv4: 172.16.0.0/24 - v2: + v2-bridge: bridge_group: 2 id: 1001 - mode: irb + mode: bridge prefix: allocation: id_based ipv4: 172.16.1.0/24 @@ -260,8 +225,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 1 - mtu: 1500 name: r2 -> r1 neighbors: - ifname: bond1 @@ -304,7 +267,7 @@ nodes: type: p2p - ifindex: 4 ifname: bond1.1000 - name: '[SubIf VLAN v1] r2 -> r1' + name: '[SubIf VLAN v1-irb] r2 -> r1' neighbors: - ifname: eth4 ipv4: 172.16.0.1/24 @@ -314,27 +277,26 @@ nodes: type: vlan_member virtual_interface: true vlan: - access: v1 + access: v1-irb access_id: 1000 - ifindex: 5 ifname: bond1.1001 - name: '[SubIf VLAN v2] r2 -> r1' + name: '[SubIf VLAN v2-bridge] r2 -> r1' neighbors: - ifname: eth5 - ipv4: 172.16.1.1/24 node: r1 parent_ifindex: 30000 parent_ifname: bond1 type: vlan_member virtual_interface: true vlan: - access: v2 + access: v2-bridge access_id: 1001 - bridge_group: 1 ifindex: 6 ifname: vlan1000 ipv4: 172.16.0.2/24 - name: VLAN v1 (1000) -> [r1] + name: VLAN v1-irb (1000) -> [r1] neighbors: - ifname: vlan1000 ipv4: 172.16.0.1/24 @@ -343,21 +305,19 @@ nodes: virtual_interface: true vlan: mode: irb - name: v1 + name: v1-irb - bridge_group: 2 ifindex: 7 ifname: vlan1001 - ipv4: 172.16.1.2/24 - name: VLAN v2 (1001) -> [r1] + name: VLAN v2-bridge (1001) -> [r1] neighbors: - ifname: vlan1001 - ipv4: 172.16.1.1/24 node: r1 type: svi virtual_interface: true vlan: - mode: irb - name: v2 + mode: bridge + name: v2-bridge lag: lacp: fast lacp_mode: active @@ -380,25 +340,26 @@ nodes: vlan: max_bridge_group: 2 vlans: - v1: + v1-irb: bridge_group: 1 id: 1000 mode: irb prefix: allocation: id_based ipv4: 172.16.0.0/24 - v2: + v2-bridge: bridge_group: 2 id: 1001 - mode: irb + mode: bridge prefix: allocation: id_based ipv4: 172.16.1.0/24 provider: clab vlans: - v1: + v1-irb: host_count: 0 id: 1000 + mode: irb neighbors: - ifname: vlan1000 ipv4: 172.16.0.2/24 @@ -409,15 +370,14 @@ vlans: prefix: allocation: id_based ipv4: 172.16.0.0/24 - v2: + v2-bridge: host_count: 0 id: 1001 + mode: bridge neighbors: - ifname: vlan1001 - ipv4: 172.16.1.2/24 node: r2 - ifname: vlan1001 - ipv4: 172.16.1.1/24 node: r1 prefix: allocation: id_based diff --git a/tests/topology/expected/node.clone-plugin-lag.yml b/tests/topology/expected/node.clone-plugin-lag.yml index 12388dbf98..2e8566bd35 100644 --- a/tests/topology/expected/node.clone-plugin-lag.yml +++ b/tests/topology/expected/node.clone-plugin-lag.yml @@ -29,152 +29,6 @@ links: node_count: 2 prefix: false type: p2p -- _linkname: links[2] - bridge: input_2 - interfaces: - - ifindex: 30000 - ifname: port-channel8 - node: r1 - - ifindex: 30000 - ifname: bond8 - node: h-01 - lag: - ifindex: 8 - linkindex: 2 - node_count: 2 - pool: l2only - type: lag -- _linkname: links[3] - bridge: input_3 - interfaces: - - ifindex: 30001 - ifname: port-channel9 - node: r1 - - ifindex: 30000 - ifname: bond9 - node: h-02 - lag: - ifindex: 9 - linkindex: 3 - node_count: 2 - pool: l2only - type: lag -- _linkname: links[4] - bridge: input_4 - interfaces: - - ifindex: 30000 - ifname: port-channel1 - lag: - ifindex: 1 - node: r2 - - ifindex: 30001 - ifname: bond9 - lag: - ifindex: 9 - node: h-01 - lag: {} - linkindex: 4 - node_count: 2 - pool: l2only - type: lag -- _linkname: links[5] - bridge: input_5 - interfaces: - - ifindex: 30001 - ifname: port-channel2 - lag: - ifindex: 2 - node: r2 - - ifindex: 30001 - ifname: bond10 - lag: - ifindex: 10 - node: h-02 - lag: {} - linkindex: 5 - node_count: 2 - pool: l2only - type: lag -- _linkname: links[6] - bridge: input_6 - interfaces: - - _vlan_mode: irb - ifindex: 30000 - ifname: bond1 - ipv4: 172.16.0.5/24 - lag: - ifindex: 1 - node: h2-01 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30002 - ifname: port-channel10 - ipv4: 172.16.0.1/24 - lag: - _mlag: true - node: r1 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30002 - ifname: port-channel10 - ipv4: 172.16.0.2/24 - lag: - _mlag: true - node: r2 - vlan: - access: red - lag: - ifindex: 10 - linkindex: 6 - node_count: 3 - prefix: - allocation: id_based - ipv4: 172.16.0.0/24 - type: lag - vlan: - access: red -- _linkname: links[7] - bridge: input_7 - interfaces: - - _vlan_mode: irb - ifindex: 30000 - ifname: bond1 - ipv4: 172.16.0.6/24 - lag: - ifindex: 1 - node: h2-02 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30003 - ifname: port-channel11 - ipv4: 172.16.0.1/24 - lag: - _mlag: true - node: r1 - vlan: - access: red - - _vlan_mode: irb - ifindex: 30003 - ifname: port-channel11 - ipv4: 172.16.0.2/24 - lag: - _mlag: true - node: r2 - vlan: - access: red - lag: - ifindex: 11 - linkindex: 7 - node_count: 3 - prefix: - allocation: id_based - ipv4: 172.16.0.0/24 - type: lag - vlan: - access: red - _linkname: links[2].lag[1] interfaces: - ifindex: 2 @@ -361,7 +215,6 @@ nodes: ifindex: 8 lacp: fast lacp_mode: active - linkindex: 2 name: h-01 -> r1 neighbors: - ifname: port-channel8 @@ -375,7 +228,6 @@ nodes: ifindex: 9 lacp: fast lacp_mode: active - linkindex: 4 name: h-01 -> r2 neighbors: - ifname: port-channel1 @@ -386,7 +238,7 @@ nodes: - ifindex: 1 ifname: eth1 lag: - _parentindex: 2 + _parentindex: 8 linkindex: 8 name: h-01 -> r1 neighbors: @@ -396,7 +248,7 @@ nodes: - ifindex: 2 ifname: eth2 lag: - _parentindex: 2 + _parentindex: 8 linkindex: 9 name: h-01 -> r1 neighbors: @@ -406,7 +258,7 @@ nodes: - ifindex: 3 ifname: eth3 lag: - _parentindex: 4 + _parentindex: 9 linkindex: 12 name: h-01 -> r2 neighbors: @@ -416,7 +268,7 @@ nodes: - ifindex: 4 ifname: eth4 lag: - _parentindex: 4 + _parentindex: 9 linkindex: 13 name: h-01 -> r2 neighbors: @@ -454,7 +306,6 @@ nodes: ifindex: 9 lacp: fast lacp_mode: active - linkindex: 3 name: h-02 -> r1 neighbors: - ifname: port-channel9 @@ -468,7 +319,6 @@ nodes: ifindex: 10 lacp: fast lacp_mode: active - linkindex: 5 name: h-02 -> r2 neighbors: - ifname: port-channel2 @@ -479,7 +329,7 @@ nodes: - ifindex: 1 ifname: eth1 lag: - _parentindex: 3 + _parentindex: 9 linkindex: 10 name: h-02 -> r1 neighbors: @@ -489,7 +339,7 @@ nodes: - ifindex: 2 ifname: eth2 lag: - _parentindex: 3 + _parentindex: 9 linkindex: 11 name: h-02 -> r1 neighbors: @@ -499,7 +349,7 @@ nodes: - ifindex: 3 ifname: eth3 lag: - _parentindex: 5 + _parentindex: 10 linkindex: 14 name: h-02 -> r2 neighbors: @@ -509,7 +359,7 @@ nodes: - ifindex: 4 ifname: eth4 lag: - _parentindex: 5 + _parentindex: 10 linkindex: 15 name: h-02 -> r2 neighbors: @@ -547,7 +397,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 6 name: '[Access VLAN red] h2-01 -> [r1,r2]' neighbors: - ifname: port-channel10 @@ -564,7 +413,7 @@ nodes: - ifindex: 1 ifname: eth1 lag: - _parentindex: 6 + _parentindex: 1 linkindex: 16 name: h2-01 -> r1 neighbors: @@ -574,7 +423,7 @@ nodes: - ifindex: 2 ifname: eth2 lag: - _parentindex: 6 + _parentindex: 1 linkindex: 17 name: h2-01 -> r2 neighbors: @@ -642,7 +491,6 @@ nodes: ifindex: 1 lacp: fast lacp_mode: active - linkindex: 7 name: '[Access VLAN red] h2-02 -> [r1,r2]' neighbors: - ifname: port-channel11 @@ -659,7 +507,7 @@ nodes: - ifindex: 1 ifname: eth1 lag: - _parentindex: 7 + _parentindex: 1 linkindex: 18 name: h2-02 -> r1 neighbors: @@ -669,7 +517,7 @@ nodes: - ifindex: 2 ifname: eth2 lag: - _parentindex: 7 + _parentindex: 1 linkindex: 19 name: h2-02 -> r2 neighbors: @@ -752,7 +600,6 @@ nodes: ifindex: 8 lacp: fast lacp_mode: active - linkindex: 2 name: r1 -> h-01 neighbors: - ifname: bond8 @@ -766,7 +613,6 @@ nodes: ifindex: 9 lacp: fast lacp_mode: active - linkindex: 3 name: r1 -> h-02 neighbors: - ifname: bond9 @@ -781,7 +627,6 @@ nodes: ifindex: 10 lacp: fast lacp_mode: active - linkindex: 6 name: '[Access VLAN red] r1 -> [h2-01,r2]' neighbors: - ifname: bond1 @@ -802,7 +647,6 @@ nodes: ifindex: 11 lacp: fast lacp_mode: active - linkindex: 7 name: '[Access VLAN red] r1 -> [h2-02,r2]' neighbors: - ifname: bond1 @@ -819,7 +663,7 @@ nodes: - ifindex: 2 ifname: Ethernet2 lag: - _parentindex: 2 + _parentindex: 8 linkindex: 8 name: r1 -> h-01 neighbors: @@ -829,7 +673,7 @@ nodes: - ifindex: 3 ifname: Ethernet3 lag: - _parentindex: 2 + _parentindex: 8 linkindex: 9 name: r1 -> h-01 neighbors: @@ -839,7 +683,7 @@ nodes: - ifindex: 4 ifname: Ethernet4 lag: - _parentindex: 3 + _parentindex: 9 linkindex: 10 name: r1 -> h-02 neighbors: @@ -849,7 +693,7 @@ nodes: - ifindex: 5 ifname: Ethernet5 lag: - _parentindex: 3 + _parentindex: 9 linkindex: 11 name: r1 -> h-02 neighbors: @@ -859,7 +703,7 @@ nodes: - ifindex: 6 ifname: Ethernet6 lag: - _parentindex: 6 + _parentindex: 10 linkindex: 16 name: r1 -> h2-01 neighbors: @@ -869,7 +713,7 @@ nodes: - ifindex: 7 ifname: Ethernet7 lag: - _parentindex: 7 + _parentindex: 11 linkindex: 18 name: r1 -> h2-02 neighbors: @@ -950,7 +794,7 @@ nodes: - ifindex: 2 ifname: Ethernet2 lag: - _parentindex: 6 + _parentindex: 10 linkindex: 17 name: r2 -> h2-01 neighbors: @@ -960,7 +804,7 @@ nodes: - ifindex: 3 ifname: Ethernet3 lag: - _parentindex: 7 + _parentindex: 11 linkindex: 19 name: r2 -> h2-02 neighbors: @@ -997,17 +841,30 @@ nodes: - ifindex: 6 ifname: Ethernet6 lag: - _parentindex: 4 + _parentindex: 1 linkindex: 12 name: r2 -> h-01 neighbors: - ifname: eth3 node: h-01 type: p2p + - ifindex: 7 + ifname: port-channel1 + lag: + ifindex: 1 + lacp: fast + lacp_mode: active + name: r2 -> h-01 + neighbors: + - ifname: bond9 + node: h-01 + pool: l2only + type: lag + virtual_interface: true - ifindex: 7 ifname: Ethernet7 lag: - _parentindex: 4 + _parentindex: 1 linkindex: 13 name: r2 -> h-01 neighbors: @@ -1017,7 +874,7 @@ nodes: - ifindex: 8 ifname: Ethernet8 lag: - _parentindex: 5 + _parentindex: 2 linkindex: 14 name: r2 -> h-02 neighbors: @@ -1025,36 +882,11 @@ nodes: node: h-02 type: p2p - ifindex: 9 - ifname: Ethernet9 - lag: - _parentindex: 5 - linkindex: 15 - name: r2 -> h-02 - neighbors: - - ifname: eth4 - node: h-02 - type: p2p - - ifindex: 30000 - ifname: port-channel1 - lag: - ifindex: 1 - lacp: fast - lacp_mode: active - linkindex: 4 - name: r2 -> h-01 - neighbors: - - ifname: bond9 - node: h-01 - pool: l2only - type: lag - virtual_interface: true - - ifindex: 30001 ifname: port-channel2 lag: ifindex: 2 lacp: fast lacp_mode: active - linkindex: 5 name: r2 -> h-02 neighbors: - ifname: bond10 @@ -1062,14 +894,23 @@ nodes: pool: l2only type: lag virtual_interface: true - - ifindex: 30002 + - ifindex: 9 + ifname: Ethernet9 + lag: + _parentindex: 2 + linkindex: 15 + name: r2 -> h-02 + neighbors: + - ifname: eth4 + node: h-02 + type: p2p + - ifindex: 30000 ifname: port-channel10 lag: _mlag: true ifindex: 10 lacp: fast lacp_mode: active - linkindex: 6 name: '[Access VLAN red] r2 -> [h2-01,r1]' neighbors: - ifname: bond1 @@ -1083,14 +924,13 @@ nodes: vlan: access: red access_id: 1000 - - ifindex: 30003 + - ifindex: 30001 ifname: port-channel11 lag: _mlag: true ifindex: 11 lacp: fast lacp_mode: active - linkindex: 7 name: '[Access VLAN red] r2 -> [h2-02,r1]' neighbors: - ifname: bond1 @@ -1108,7 +948,7 @@ nodes: lacp: fast lacp_mode: active libvirt: - nic_adapter_count: 10 + nic_adapter_count: 12 loopback: ifindex: 0 ifname: Loopback0 diff --git a/tests/topology/input/lag-l2.yml b/tests/topology/input/lag-l2.yml index eedd13a76f..dccb13f766 100644 --- a/tests/topology/input/lag-l2.yml +++ b/tests/topology/input/lag-l2.yml @@ -1,15 +1,36 @@ # # Basic L2 LAG example - single lag with 2 member links and custom MTU and STP settings # - defaults: provider: clab - device: eos + device: dellos10 module: [lag, stp, vlan] -nodes: [r1, r2] + +addressing: + p2p: + ipv4: False + +nodes: + r1: + + r2: + lag.lacp: slow # Test node level lag attribute + links: - mtu: 1600 # Test that MTU is copied to member links lag.members: [r1-r2, r1-r2] - prefix: false # port-channel on EOS cannot have IP (quirk candidate) stp.enable: false # STP parameters apply to port-channel, not member links + +- lag: + members: [r1-r2, r1-r2] + lacp: slow # Link level override + +- lag: + members: + - r1: + r2: + lag.lacp: fast # Interface level override + - r1: + r2: + lag.lacp: fast # Interface level override (one suffices, last one wins) diff --git a/tests/topology/input/lag-l3.yml b/tests/topology/input/lag-l3.yml index ca6961485b..59197adad7 100644 --- a/tests/topology/input/lag-l3.yml +++ b/tests/topology/input/lag-l3.yml @@ -6,7 +6,16 @@ defaults: provider: clab device: dellos10 -module: [lag, vlan] +module: [lag, gateway] nodes: [r1, r2] links: - lag.members: [r1-r2, r1-r2] + +- prefix: 10.11.12.0/24 # Custom link prefix + lag.members: + - r1: + gateway.protocol: vrrp # Gateway enabled on interface + ipv4: 12 # Custom relative IP + r2: + - r1: + r2: diff --git a/tests/topology/input/lag-l3-vlan-trunk.yml b/tests/topology/input/lag-vlan-trunk.yml similarity index 67% rename from tests/topology/input/lag-l3-vlan-trunk.yml rename to tests/topology/input/lag-vlan-trunk.yml index 4e61a6fb10..c0a953fbc8 100644 --- a/tests/topology/input/lag-l3-vlan-trunk.yml +++ b/tests/topology/input/lag-vlan-trunk.yml @@ -9,10 +9,13 @@ defaults: module: [lag, vlan] vlans: - v1: - v2: + v1-irb: + mode: irb + + v2-bridge: + mode: bridge nodes: [r1, r2] links: -- vlan.trunk: [v1, v2] +- vlan.trunk: [v1-irb, v2-bridge] lag.members: [r1-r2, r1-r2, r1-r2]