Page MenuHomeVyOS Platform

Replacing Vyatta::Interface perl
Open, Requires assessmentPublicFEATURE REQUEST


As T1756 evolved, I basically ended up starting a rewrite of the old perl Vyatta::Interface module to make it a bit easier to work with in Python.

The attached pull request is the result of that work. Right now, only wireguard is supported, but as the scaffolding is now built, I think adding the rest of the interface types should go quickly


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Internal change (not visible to end users)

Event Timeline

Example output. Note this is all programmatically generated in Python now instead of parsing the output of wg

interface: wg0
  description: KROY
  public key: RIbtUTCfgzNjnLNPQ/ulkGnnB2vMWHm7l2H/xUfbyjc=
  private key: (hidden)
  listening port: 2224

  peer: ERX-Test
    public key: CF1CsALd2x8KuN6uIMTAYs0ZMtc0rRMEqw4rU2qY5Co=
    allowed ips:, 2001:XXX:xxx:XXX::60/128
    persistent keepalive: every 15 seconds

  peer: MBP-kroy
    public key: HBbvhFP8+uR8KaS+O3mp1MQJn1bFKYpyPOHDILL8SHE=
    allowed ips:, 2001:XXX:xxx:XXX::40/128
    persistent keepalive: every 15 seconds

  peer: iMac-kroy
    public key: F5MbW7ye7DsoxdOacrdhLPQIksjxN5UdNV+pGFHqehc=
    latest handshake: 0:01:24
    status: active
    endpoint: xx.xx.xx.xx:53770
    allowed ips:, 2001:XXX:xxx:XXX::30/128
    transfer: 434 MB received, 5 GB sent
    persistent keepalive: every 15 seconds

  peer: iPhone-kroy
    public key: BknHcLFo8nOo8Dwq2CjaC/TedchKQ0ebxC7GYn7Al00=
    allowed ips:, 2001:XXX:xxx:XXX::20/128
    persistent keepalive: every 15 seconds

      bytes    packets    errors    dropped    overrun    mcast
  455449452    3481153         0       5663          0        0

       bytes    packets    errors    dropped    carrier    collisions
  5812316456    5555760         0       4408          0             0
hagbard added a subscriber: hagbard.

looks neat. I merged in in already. Can you add some explanation to please.


This pull request rewrites all the functionality of and lays the framework for the rest of

Example usage:

#!/usr/bin/env python3
from vyos.interface import Interface

intf = Interface("eth0.7")

Why not single source also the op-mode part into


This eliminates the redundant and merges the op_mode displaying code into

Once the other interface types have their op_mode display code moved here, there will be a bit of refactoring needed to display the various types of interfaces differently.

erkin set Issue type to Internal change (not visible to end users).Aug 31 2021, 6:28 PM