+ paths=paths
+ )
+ return route
+
+ @staticmethod
+ def vpp_route_add(node, network, prefix_len, **kwargs):
+ """Add route to the VPP node.
+
+ :param node: VPP node.
+ :param network: Route destination network address.
+ :param prefix_len: Route destination network prefix length.
+ :param kwargs: Optional key-value arguments:
+
+ gateway: Route gateway address. (str)
+ interface: Route interface. (str)
+ vrf: VRF table ID. (int)
+ count: number of IP addresses to add starting from network IP (int)
+ local: The route is local with same prefix (increment is 1).
+ If None, then is not used. (bool)
+ lookup_vrf: VRF table ID for lookup. (int)
+ multipath: Enable multipath routing. (bool)
+ weight: Weight value for unequal cost multipath routing. (int)
+
+ :type node: dict
+ :type network: str
+ :type prefix_len: int
+ :type kwargs: dict
+ """
+ count = kwargs.get(u"count", 1)
+
+ if count > 100:
+ gateway = kwargs.get(u"gateway", '')
+ interface = kwargs.get(u"interface", '')
+ vrf = kwargs.get(u"vrf", None)
+ multipath = kwargs.get(u"multipath", False)
+
+ with VatTerminal(node, json_param=False) as vat:
+
+ vat.vat_terminal_exec_cmd_from_template(
+ u"vpp_route_add.vat",
+ network=network,
+ prefix_length=prefix_len,
+ via=f"via {gateway}" if gateway else u"",
+ sw_if_index=f"sw_if_index "
+ f"{InterfaceUtil.get_interface_index(node, interface)}"
+ if interface else u"",
+ vrf=f"vrf {vrf}" if vrf else u"",
+ count=f"count {count}" if count else u"",
+ multipath=u"multipath" if multipath else u""
+ )
+ return
+
+ net_addr = ip_address(network)
+ cmd = u"ip_route_add_del"