.. _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) on VyOS devices using the HTTPS REST API. - IP address configuration is handled by :ref:`vyos.rest.vyos_l3_interfaces `. 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.
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 state: merged - name: Disable an interface vyos.rest.vyos_interfaces: config: - name: eth1 enabled: false state: merged - name: Delete interface description 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)