Skip to content

interface

Thomas Mangin edited this page Nov 14, 2026 · 6 revisions

Pre-Alpha. This page describes behavior that may change.

OS network interface monitoring and management. Discovers interfaces, manages units, addresses, bridges, VLANs, and sysctl settings, and publishes interface and address events to the bus.

Category

Core.

Configuration

Loaded automatically when an interface configuration block is present. The config root is interface.

interface {
    ethernet eth0 {
        mtu 9000;
        unit 0 {
            ipv4 {
                address [ 10.0.0.1/24 ];
            }
        }
    }
    dummy lo1 {
        unit 0 {
            ipv4 {
                address [ 10.255.0.1/32 ];
            }
        }
    }
}

The YANG schema supports ethernet, dummy, veth, bridge, and loopback interface types. Each interface carries physical properties (MTU, MAC address, disable) and a list of logical units with addresses, VLAN IDs, sysctl overrides, and traffic mirroring configuration.

Behaviour

On startup the plugin loads a backend (netlink on Linux by default), applies the declared interface configuration, and starts a monitor that watches for OS-level interface changes. The monitor publishes events to the bus:

  • interface/created for a new link.
  • interface/up and interface/down for link state transitions. A deleted link publishes interface/down, carrying its type and MTU.
  • interface/addr-added and interface/addr-removed for IP address changes. addr-added also fires once for every address the kernel holds when the monitor starts, and for each retained address a replay publishes; addr-removed also fires when the address's interface is deleted.
  • interface/dhcp-acquired, interface/dhcp-renewed, and interface/dhcp-expired for DHCP events.

A consumer that starts late subscribes to the address events, then emits interface/address-replay-request. The active monitor answers by publishing its current usable addresses as ordinary addr-added events. Replay and live changes share one publication order, so a removed address cannot come back from an older snapshot, and requests coalesce while a replay is pending. A request starts no backend and gets no answer while the interface provider is inactive. The VPP monitor seeds the addresses it retains from the interface and address API dumps.

An address the kernel announces before its link (an interface created and addressed straight away, ip link add then ip addr add) is no longer lost: the monitor asks the kernel for that link by index and announces the address under its name. If that lookup fails for any reason other than the link being gone, the monitor logs it at WARN and raises a doctor-iface-address-unattributed error naming the address, the index and the kernel's error, with the commands that add the address again.

Configuration reloads use a journaled transaction. The apply phase records a rollback closure that re-applies the previous config, and emits an interface/rollback event if the transaction is rolled back. The interface journals survive the inner operation commit: a later owner failure or a failed publication of the outer candidate replays their original inverses, and only acceptance of the whole reload releases them. Restoring a config also restores the active interface configuration and reconciles its DHCP, PPPoE and Router Advertisement workers.

Each apply also reconciles the addresses of every enabled unit to what the config names (leases, SLAAC and kernel link-locals stay), keeps unnumbered /32s in step with their donor, and hands the backend the complete reverse-path check set. See Interfaces configuration.

Link and address events fan out to every subscriber: the BGP reactor, iface-dhcp, iface-ra, VRRP, and the routing protocol transports. A subscriber that falls behind under a burst of events never loses the interface's final state: the fan-out discards its OLDEST buffered event to make room, never the newest, so a subscriber that catches up sees the state the interface actually ended in. Each discard is counted in ze_iface_resolver_events_dropped_total, labelled by the logical interface name.

The interface model follows a JunOS-style two-layer design: physical interface plus logical units.

disable on an interface or a unit stops every service it runs: no address, no DHCP client, no router advertisement, and a device or VLAN subinterface Ze created is deleted. See Disabling an interface or a unit.

A commit whose interface listing cannot be read is refused rather than planned as though no address moved, so a BGP session bound to an address that moves between interfaces is stopped as it should be.

Interactions

  • The BGP reactor subscribes to interface events to react to link-state changes.
  • iface-netlink is the default Linux backend that performs the actual netlink operations.
  • iface-dhcp is a separate plugin for DHCP client behaviour on managed interfaces.
  • iface-ra sends IPv6 Router Advertisements on the units that enable them. The component parses the configuration and decides which senders run; the plugin owns the socket and the timers. Remove the plugin and no sender starts.
  • fib-kernel consumes interface events to keep the Linux FIB consistent.

Every route this component installs in the kernel carries rtm_protocol 253, which show route renders as ze-iface, and a removal matches on that protocol. This covers the DHCPv4 client, the IPv6 RA default-route manager, the PPPoE client, and the PPP NCPs.

Source

main/internal/component/iface/

See also

Home

About

First Steps

Configuration

Operation

Interfaces

Plugins

Plugin Development

Chaos Testing

Blueprints

Development

Reference

Clone this wiki locally