2, count + 2): # 0: network address, 1: local vpp address
mac = "02:%02x:00:00:ff:%02x" % (self.sw_if_index, i)
ip4 = "172.16.%u.%u" % (self.sw_if_index, i)
- ip6 = "fd01:%04x::%04x" % (self.sw_if_index, i)
+ ip6 = "fd01:%x::%x" % (self.sw_if_index, i)
host = Host(mac, ip4, ip6)
self._remote_hosts.append(host)
self._hosts_by_mac[mac] = host
self.has_ip4_config = False
self.ip4_table_id = 0
- self._local_ip6 = "fd01:%04x::1" % self.sw_if_index
+ self._local_ip6 = "fd01:%x::1" % self.sw_if_index
self._local_ip6n = socket.inet_pton(socket.AF_INET6, self.local_ip6)
self.local_ip6_prefix_len = 64
self.has_ip6_config = False
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."""
+ for host in self._remote_hosts:
+ macn = host.mac.replace(":", "").decode('hex')
+ self.test.vapi.ip_neighbor_add_del(
+ self.sw_if_index, macn, host.ip6n, is_ipv6=1)
+
def unconfig(self):
"""Unconfigure IPv6 and IPv4 address on the VPP interface."""
self.unconfig_ip4()
"""Configure IPv6 RA suppress on the VPP interface."""
self.test.vapi.sw_interface_ra_suppress(self.sw_if_index)
- def ip6_ra_config(self, suppress=0, send_unicast=0):
+ def ip6_ra_config(self, no=0, suppress=0, send_unicast=0):
"""Configure IPv6 RA suppress on the VPP interface."""
self.test.vapi.ip6_sw_interface_ra_config(self.sw_if_index,
+ no,
suppress,
send_unicast)