import socket
from util import Host
+from vpp_neighbor import VppNeighbor
class VppInterface(object):
self.has_ip6_config = False
self.has_ip6_config = False
- def configure_ipv6_neighbors(self):
- """For every remote host assign neighbor's MAC to IPv6 address."""
+ def configure_ipv6_neighbors(self, vrf_id=0):
+ """For every remote host assign neighbor's MAC to IPv6 addresses.
+
+ :param vrf_id: The FIB table / VRF ID. (Default value = 0)
+ """
for host in self._remote_hosts:
macn = host.mac.replace(":", "").decode('hex')
+ ipn = host.ip6n
self.test.vapi.ip_neighbor_add_del(
- self.sw_if_index, macn, host.ip6n, is_ipv6=1)
+ self.sw_if_index, macn, ipn, vrf_id, is_ipv6=1)
def unconfig(self):
"""Unconfigure IPv6 and IPv4 address on the VPP interface."""
i.table_id == self.ip4_table_id:
return True
return False
+
+ def set_unnumbered(self, ip_sw_if_index):
+ """ Set the interface to unnumbered via ip_sw_if_index """
+ self.test.vapi.sw_interface_set_unnumbered(
+ self.sw_if_index,
+ ip_sw_if_index)
+
+ def set_proxy_arp(self, enable=1):
+ """ Set the interface to enable/disable Proxy ARP """
+ self.test.vapi.proxy_arp_intfc_enable_disable(
+ self.sw_if_index,
+ enable)