.. _vyos.rest.vyos_bgp_address_family_module: ********************************* vyos.rest.vyos_bgp_address_family ********************************* **Manage BGP address-family configuration on VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages BGP address-family configuration on VyOS devices via the REST API. - Covers global address-family (networks, redistribution) and per-neighbor address-family settings. - BGP must be configured first using :ref:`vyos.rest.vyos_bgp_global `. - Uses REST API (``connection=httpapi``) instead of CLI. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
BGP address-family configuration.
address_family
list / elements=dictionary
Global BGP address-family settings.
afi
string / required
    Choices:
  • ipv4
  • ipv6
Address family identifier.
networks
list / elements=dictionary
Networks to advertise.
backdoor
boolean
    Choices:
  • no
  • yes
Network backdoor.
prefix
string / required
Network prefix.
route_map
string
Route map to apply.
redistribute
list / elements=dictionary
Redistribute routes from other protocols.
metric
integer
Metric for redistributed routes.
protocol
string / required
    Choices:
  • connected
  • kernel
  • ospf
  • ospfv3
  • rip
  • ripng
  • static
Protocol to redistribute.
route_map
string
Route map to apply.
as_number
integer / required
BGP autonomous system number (required for context).
neighbors
list / elements=dictionary
Per-neighbor address-family settings.
address_family
list / elements=dictionary
Address-family settings for this neighbor.
afi
string / required
    Choices:
  • ipv4
  • ipv6
Address family identifier.
allowas_in
integer
Accept as-path with my AS present.
attribute_unchanged
dictionary
BGP attributes to leave unchanged.
as_path
boolean
    Choices:
  • no
  • yes
Leave as-path unchanged.
med
boolean
    Choices:
  • no
  • yes
Leave MED unchanged.
next_hop
boolean
    Choices:
  • no
  • yes
Leave next-hop unchanged.
capability
dictionary
Advertise capability to the peer.
orf
string
    Choices:
  • receive
  • send
ORF capability.
default_originate
boolean
    Choices:
  • no
  • yes
Send default route to neighbor.
distribute_list
dictionary
Filter updates using access-list.
export
integer
Access-list to filter outbound updates.
import
integer
Access-list to filter inbound updates.
maximum_prefix
integer
Maximum number of prefixes to accept.
nexthop_self
boolean
    Choices:
  • no
  • yes
Set next-hop to self.
prefix_list
dictionary
Filter updates using prefix-list.
export
string
Prefix-list to filter outbound updates.
import
string
Prefix-list to filter inbound updates.
route_map
dictionary
Route map to apply.
export
string
Route map for outbound updates.
import
string
Route map for inbound updates.
route_reflector_client
boolean
    Choices:
  • no
  • yes
Configure as route reflector client.
route_server_client
boolean
    Choices:
  • no
  • yes
Configure as route server client.
soft_reconfiguration
boolean
    Choices:
  • no
  • yes
Enable soft reconfiguration inbound.
unsuppress_map
string
Route-map to selectively unsuppress suppressed routes.
weight
integer
Default weight for routes from this neighbor.
neighbor_address
string / required
Neighbor IP address.
state
string
    Choices:
  • merged ←
  • replaced
  • deleted
  • gathered
Desired state of the BGP address-family configuration.
merged adds or updates without removing existing config.
replaced replaces the entire BGP address-family configuration.
deleted removes BGP address-family configuration.
gathered returns current configuration as structured data.

Notes ----- .. note:: - Requires ``ansible_connection=httpapi`` with the VyOS httpapi plugin. - ``ansible_network_os`` must be set to ``vyos.rest.vyos``. - BGP must be configured first using :ref:`vyos.rest.vyos_bgp_global `. Examples -------- .. code-block:: yaml - name: Merge BGP address-family configuration vyos.rest.vyos_bgp_address_family: config: as_number: 65000 address_family: - afi: ipv4 networks: - prefix: 192.0.2.0/24 redistribute: - protocol: connected metric: 10 neighbors: - neighbor_address: 192.0.2.1 address_family: - afi: ipv4 soft_reconfiguration: true nexthop_self: true - afi: ipv6 soft_reconfiguration: true state: merged - name: Delete all BGP address-family configuration vyos.rest.vyos_bgp_address_family: config: as_number: 65000 state: deleted - name: Gather BGP address-family configuration vyos.rest.vyos_bgp_address_family: 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
dictionary
when changed
BGP address-family configuration after this module ran.

before
dictionary
always
BGP address-family configuration before this module ran.

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

gathered
dictionary
when state is gathered
Current BGP address-family configuration as structured data.

response
dictionary
always
Raw API response.

saved
boolean
when changed
Whether the config was saved after changes.



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