.. _vyos.rest.vyos_interfaces_module: ************************* vyos.rest.vyos_interfaces ************************* **Manage interface configuration on VyOS devices via REST API.** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages L2 interface configuration (description, MTU, speed, duplex, enabled, VRF assignment, VLAN sub-interfaces) on VyOS devices using the HTTPS REST API. - IP address configuration is handled by :ref:`vyos.rest.vyos_l3_interfaces `. - Covers 11 interface types (ethernet, bonding, loopback, tunnel, wireguard, vti, dummy, openvpn, pppoe, wireless, bridge), resolved from the interface name. The current CLI collection module documents a narrower, deliberate scope of 5 types (ethernet, bonding, vxlan, loopback, vti) -- this module's broader coverage is a deliberate choice, not an oversight, and the additional types beyond CLI's documented set are not independently re-verified against the device schema here (matching the original module's own scope, carried over unchanged). Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
list / elements=dictionary
List of interface configurations.
description
string
Interface description.
duplex
string
    Choices:
  • auto
  • full
  • half
Interface duplex setting.
enabled
boolean
    Choices:
  • no
  • yes ←
Whether the interface is enabled. False sets the disable flag.
mtu
integer
Interface MTU.
name
string / required
Full interface name (e.g. eth0, bond0, lo).
speed
string
    Choices:
  • auto
  • 10
  • 100
  • 1000
  • 2500
  • 10000
Interface speed setting.
vifs
list / elements=dictionary
802.1Q VLAN sub-interfaces.
description
string
Sub-interface description.
enabled
boolean
    Choices:
  • no
  • yes ←
Whether the sub-interface is enabled.
mtu
integer
Sub-interface MTU.
vlan_id
integer / required
VLAN ID for this sub-interface.
vrf
string
VRF instance to bind this interface to.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
merged - Merge config with existing interface settings.
replaced - Replace config for listed interfaces.
overridden - Replace config for all interfaces.
deleted - Remove listed interface config or all interface config.
gathered - Read interface config from device without changes.

See Also -------- .. seealso:: :ref:`vyos.vyos.vyos_interfaces_module` The official documentation on the **vyos.vyos.vyos_interfaces** module. :ref:`vyos.rest.vyos_l3_interfaces_module` The official documentation on the **vyos.rest.vyos_l3_interfaces** module. Examples -------- .. code-block:: yaml - name: Merge interface configuration vyos.rest.vyos_interfaces: config: - name: eth0 description: Management interface mtu: 1500 enabled: true vrf: mgmt vifs: - vlan_id: 200 description: VIF 200 state: merged - name: Disable an interface vyos.rest.vyos_interfaces: config: - name: eth1 enabled: false state: merged - name: Delete interface config vyos.rest.vyos_interfaces: config: - name: eth0 state: deleted - name: Gather current interface configuration vyos.rest.vyos_interfaces: state: gathered Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
list
when changed
Interface configuration after this module ran.

before
list
always
Interface configuration before this module ran.

commands
list
always
List of API command tuples sent to the device.

gathered
list
when state is gathered
Current interface configuration as structured data.

response
dictionary
when changes are applied
Raw API response.

saved
boolean
when changes are applied
Whether the config was saved after changes.



Status ------ Authors ~~~~~~~ - VyOS Community (@vyos)