2.160. vpp_interface module

class vpp_interface.VppInterface(test)

Bases: object

Generic VPP interface.

add_sub_if(sub_if)

Register a sub-interface with this interface.

Parameters

sub_if – sub-interface

admin_down()

Put interface ADMIN-down.

admin_up()

Put interface ADMIN-UP.

assert_interface_state(admin_up_down, link_up_down, expect_event=False)
config_ip4()

Configure IPv4 address on the VPP interface.

config_ip6()

Configure IPv6 address on the VPP interface.

configure_ipv4_neighbors()

For every remote host assign neighbor’s MAC to IPv4 addresses.

Parameters

vrf_id – The FIB table / VRF ID. (Default value = 0)

configure_ipv6_neighbors()

For every remote host assign neighbor’s MAC to IPv6 addresses.

Parameters

vrf_id – The FIB table / VRF ID. (Default value = 0)

disable_ipv6_ra()

Configure IPv6 RA suppress on the VPP interface.

disable_mpls()

Enable MPLS on the VPP interface.

property dump

RAW result of sw_interface_dump for this interface.

enable_mpls()

Enable MPLS on the VPP interface.

generate_remote_hosts(count=1)

Generate and add remote hosts for the interface.

Parameters

count (int) – Number of generated remote hosts.

get_interface_config_from_dump(dump)
get_rx_stats()
get_tx_stats()
host_by_ip4(ip)
Parameters

ip – IPv4 address to find host by.

Returns

Host object assigned to interface.

host_by_ip6(ip)
Parameters

ip – IPv6 address to find host by.

Returns

Host object assigned to interface.

host_by_mac(mac)
Parameters

mac – MAC address to find host by.

Returns

Host object assigned to interface.

ip6_disable()

Put interface ADMIN-DOWN.

ip6_enable()

IPv6 Enable interface

ip6_ra_config(no=0, suppress=0, send_unicast=0)

Configure IPv6 RA suppress on the VPP interface.

ip6_ra_prefix(prefix, is_no=0, off_link=0, no_autoconfig=0, use_default=0)

Configure IPv6 RA suppress on the VPP interface.

prefix can be a string in the format of ‘<address>/<length_in_bits>’ or ipaddress.ipnetwork object (if strict.)

is_interface_config_in_dump(dump)
is_ip4_entry_in_fib_dump(dump)

Put interface link-state-down.

Put interface link-state-UP.

property local_addr
property local_ip4

Local IPv4 address on VPP interface (string).

property local_ip4_prefix

Local IPv4 prefix

property local_ip4_prefix_len

Local IPv4 prefix length

property local_ip6

Local IPv6 address on VPP interface (string).

property local_ip6_ll

Local IPv6 link-local address on VPP interface (string).

property local_ip6_prefix

Local IPv4 prefix

property local_ip6_prefix_len

Local IPv6 prefix length

property local_mac

MAC-address of the VPP interface.

property name

Name of the interface.

query_vpp_config()
property remote_addr
property remote_hosts

Remote hosts list

property remote_ip4

IPv4 address of remote peer “connected” to this interface.

property remote_ip6

IPv6 address of remote peer “connected” to this interface.

property remote_ip6_ll

Link-local IPv6 address of remote peer “connected” to this interface.

property remote_mac

MAC-address of the remote interface “connected” to this interface

set_ip4_mtu(mtu)
set_ip6_mtu(mtu)
set_l3_mtu(mtu)
set_mac(mac)
set_mpls_mtu(mtu)
set_proxy_arp(enable=1)

Set the interface to enable/disable Proxy ARP

set_sw_if_index(sw_if_index)
set_table_ip4(table_id)

Set the interface in a IPv4 Table.

Note

Must be called before configuring IP4 addresses.

set_table_ip6(table_id)

Set the interface in a IPv6 Table.

Note

Must be called before configuring IP6 addresses.

set_unnumbered(ip_sw_if_index)

Set the interface to unnumbered via ip_sw_if_index

property sw_if_index

Interface index assigned by VPP.

property test

Test case creating this interface.

unconfig()

Unconfigure IPv6 and IPv4 address on the VPP interface.

unconfig_ip4()

Remove IPv4 address on the VPP interface.

unconfig_ip6()

Remove IPv6 address on the VPP interface.

unset_unnumbered(ip_sw_if_index)

Unset the interface to unnumbered via ip_sw_if_index