+ :type kwargs: dict
+ """
+
+ gateway = kwargs.get("gateway", '')
+ intf = kwargs.get("interface", '')
+ use_sw_index = kwargs.get("use_sw_index", True)
+ resolve_attempts = kwargs.get("resolve_attempts", 10)
+ count = kwargs.get("count", 1)
+ vrf = kwargs.get("vrf", None)
+ l_vrf = kwargs.get("lookup_vrf", None)
+ multipath = kwargs.get("multipath", False)
+ weight = kwargs.get("weight", None)
+ local = kwargs.get("local", False)
+
+ if intf:
+ if use_sw_index:
+ int_cmd = ('sw_if_index {}'.
+ format(Topology.get_interface_sw_index(node, intf)))
+ else:
+ int_cmd = intf
+ else:
+ int_cmd = ''
+
+ with VatTerminal(node, json_param=False) as vat:
+ vat.vat_terminal_exec_cmd_from_template(
+ 'add_route.vat',
+ network=network,
+ prefix_length=prefix_len,
+ via='via {}'.format(gateway) if gateway else '',
+ vrf='vrf {}'.format(vrf) if vrf else '',
+ interface=int_cmd,
+ resolve_attempts='resolve-attempts {}'.
+ format(resolve_attempts) if resolve_attempts else '',
+ count='count {}'.format(count) if count else '',
+ lookup_vrf='lookup-in-vrf {}'.format(l_vrf) if l_vrf else '',
+ multipath='multipath' if multipath else '',
+ weight='weight {}'.format(weight) if weight else '',
+ local='local' if local else '')
+
+ @staticmethod
+ def add_fib_table(node, table_id, ipv6=False):
+ """Create new FIB table according to ID.
+
+ :param node: Node to add FIB on.
+ :param table_id: FIB table ID.
+ :param ipv6: Is this an IPv6 table
+ :type node: dict
+ :type table_id: int
+ :type ipv6: bool