diff --git a/docs/vyos.vyos.vyos_nhrp_module.rst b/docs/vyos.vyos.vyos_nhrp_module.rst new file mode 100644 index 00000000..f0f2c35b --- /dev/null +++ b/docs/vyos.vyos.vyos_nhrp_module.rst @@ -0,0 +1,722 @@ +.. _vyos.vyos.vyos_nhrp_module: + + +******************* +vyos.vyos.vyos_nhrp +******************* + +**NHRP resource module** + + +Version added: 7.0.0 + +.. contents:: + :local: + :depth: 1 + + +Synopsis +-------- +- This module manages the Next Hop Resolution Protocol (NHRP) configuration of tunnel interfaces on devices running VyOS, as used for DMVPN. + + + + +Parameters +---------- + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterChoices/DefaultsComments
+
+ config + +
+ dictionary +
+
+ +
The NHRP configuration.
+
+
+ tunnels + +
+ list + / elements=dictionary +
+
+ +
NHRP configuration per tunnel interface.
+
+
+ authentication + +
+ string +
+
+ +
The authentication password, sent in clear text in NHRP packets.
+
Up to 8 characters, without spaces.
+
+
+ holdtime + +
+ integer +
+
+ +
The holding time of NHRP registrations and resolutions, in seconds (1-65000).
+
+
+ map + +
+ list + / elements=dictionary +
+
+ +
Static mappings of tunnel addresses to NBMA addresses.
+
+
+ nbma + +
+ string +
+
+ +
The NBMA (underlay) address of the peer, or local for this router.
+
+
+ tunnel_ip + +
+ string + / required +
+
+ +
The tunnel (protocol) address of the peer.
+
+
+ mtu + +
+ integer +
+
+ +
The MTU advertised in NHRP registrations (68-16000).
+
+
+ multicast + +
+ list + / elements=string +
+
+ +
Where multicast traffic is sent, as protocol addresses or dynamic for all dynamically learned peers.
+
A hub typically uses dynamic, so that routing protocols reach all spokes.
+
+
+ name + +
+ string + / required +
+
+ +
The tunnel interface name, for example tun0.
+
+
+ network_id + +
+ integer +
+
+ +
The NHRP network identifier of the tunnel.
+
+
+ nhs + +
+ list + / elements=dictionary +
+
+ +
The next hop servers (hubs) this router registers with.
+
+
+ nbma + +
+ list + / elements=string +
+
+ +
The NBMA (underlay) addresses of the server.
+
+
+ tunnel_ip + +
+ string + / required +
+
+ +
The tunnel address of the server, or dynamic to learn it from the server.
+
+
+ redirect + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Whether to send NHRP traffic indication (redirect) messages, typically on a hub.
+
+
+ registration_no_unique + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Whether to allow a peer to register with a changing NBMA address.
+
+
+ shortcut + +
+ boolean +
+
+
    Choices: +
  • no
  • +
  • yes
  • +
+
+
Whether to create shortcut routes from NHRP redirects, typically on a spoke.
+
+
+ running_config + +
+ string +
+
+ +
This option is used only with state parsed.
+
The value of this option should be the output received from the VyOS device by executing the command show configuration commands | grep 'protocols nhrp'.
+
The state parsed reads the configuration from running_config option and transforms it into Ansible structured data as per the resource module's argspec and the value is then returned in the parsed key within the result.
+
+
+ state + +
+ string +
+
+
    Choices: +
  • merged ←
  • +
  • replaced
  • +
  • overridden
  • +
  • deleted
  • +
  • gathered
  • +
  • rendered
  • +
  • parsed
  • +
+
+
The state the configuration should be left in.
+
+
+ + +Notes +----- + +.. note:: + - Tested against VyOS 1.5.1. + - This module works with connection ``network_cli``. + - The tunnel interfaces themselves (encapsulation, source, addresses) are managed with :ref:`vyos.vyos.vyos_interfaces ` and :ref:`vyos.vyos.vyos_l3_interfaces `, and their IPsec protection with :ref:`vyos.vyos.vyos_vpn_ipsec `. + - VyOS requires tunnels used by NHRP to have a /32 address. + + + +Examples +-------- + +.. code-block:: yaml + + # Using merged + + # Before state: + # ------------- + # + # vyos@vyos:~$ show configuration commands | grep 'protocols nhrp' + # + + - name: Configure a DMVPN hub tunnel + vyos.vyos.vyos_nhrp: + config: + tunnels: + - name: tun0 + authentication: secret + holdtime: 300 + multicast: + - dynamic + redirect: true + registration_no_unique: true + state: merged + + # Task output + # ----------- + # + # commands: + # - set protocols nhrp tunnel tun0 authentication 'secret' + # - set protocols nhrp tunnel tun0 holdtime 300 + # - set protocols nhrp tunnel tun0 redirect + # - set protocols nhrp tunnel tun0 registration-no-unique + # - set protocols nhrp tunnel tun0 multicast dynamic + + # Using merged, on a spoke + + - name: Configure a DMVPN spoke tunnel + vyos.vyos.vyos_nhrp: + config: + tunnels: + - name: tun0 + authentication: secret + shortcut: true + nhs: + - tunnel_ip: dynamic + nbma: + - 192.0.2.1 + multicast: + - dynamic + state: merged + + # Task output + # ----------- + # + # commands: + # - set protocols nhrp tunnel tun0 authentication 'secret' + # - set protocols nhrp tunnel tun0 shortcut + # - set protocols nhrp tunnel tun0 multicast dynamic + # - set protocols nhrp tunnel tun0 nhs tunnel-ip dynamic nbma 192.0.2.1 + + # Using replaced + + # Before state: + # ------------- + # + # set protocols nhrp tunnel tun0 authentication 'secret' + # set protocols nhrp tunnel tun0 holdtime '300' + # set protocols nhrp tunnel tun0 multicast 'dynamic' + # set protocols nhrp tunnel tun0 redirect + + - name: Replace the configuration of tun0 + vyos.vyos.vyos_nhrp: + config: + tunnels: + - name: tun0 + authentication: secret + multicast: + - dynamic + state: replaced + + # Task output + # ----------- + # + # commands: + # - delete protocols nhrp tunnel tun0 holdtime + # - delete protocols nhrp tunnel tun0 redirect + + # Using overridden + + # Before state: + # ------------- + # + # set protocols nhrp tunnel tun0 authentication 'secret' + # set protocols nhrp tunnel tun1 shortcut + + - name: Override the NHRP configuration with one tunnel + vyos.vyos.vyos_nhrp: + config: + tunnels: + - name: tun0 + authentication: secret + state: overridden + + # Task output + # ----------- + # + # commands: + # - delete protocols nhrp tunnel tun1 + + # Using deleted + + - name: Delete the NHRP configuration of one tunnel + vyos.vyos.vyos_nhrp: + config: + tunnels: + - name: tun1 + state: deleted + + - name: Delete all NHRP configuration + vyos.vyos.vyos_nhrp: + state: deleted + + # Task output (all NHRP configuration) + # ------------------------------------ + # + # commands: + # - delete protocols nhrp + + # Using gathered + + - name: Gather the NHRP configuration + vyos.vyos.vyos_nhrp: + state: gathered + + # Task output + # ----------- + # + # gathered: + # tunnels: + # - name: tun0 + # authentication: secret + # holdtime: 300 + # multicast: + # - dynamic + # redirect: true + + # Using rendered + + - name: Render the commands for a spoke tunnel + vyos.vyos.vyos_nhrp: + config: + tunnels: + - name: tun0 + nhs: + - tunnel_ip: 10.0.0.1 + nbma: + - 192.0.2.1 + state: rendered + + # Task output + # ----------- + # + # rendered: + # - set protocols nhrp tunnel tun0 nhs tunnel-ip 10.0.0.1 nbma 192.0.2.1 + + # Using parsed + + - name: Parse NHRP configuration from device output + vyos.vyos.vyos_nhrp: + running_config: | + set protocols nhrp tunnel tun0 map tunnel-ip '10.0.0.2' nbma '192.0.2.2' + set protocols nhrp tunnel tun0 shortcut + state: parsed + + # Task output + # ----------- + # + # parsed: + # tunnels: + # - name: tun0 + # map: + # - tunnel_ip: 10.0.0.2 + # nbma: 192.0.2.2 + # shortcut: true + + + +Return Values +------------- +Common return values are documented `here `_, the following are the fields unique to this module: + +.. raw:: html + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyReturnedDescription
+
+ after + +
+ dictionary +
+
when changed +
The resulting configuration after module execution.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ before + +
+ dictionary +
+
when state is merged, replaced, overridden or deleted +
The configuration prior to the module execution.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ commands + +
+ list +
+
when state is merged, replaced, overridden or deleted +
The set of commands pushed to the remote device.
+
+
Sample:
+
["set protocols nhrp tunnel tun0 authentication 'secret'", 'set protocols nhrp tunnel tun0 nhs tunnel-ip dynamic nbma 192.0.2.1']
+
+
+ gathered + +
+ dictionary +
+
when state is gathered +
Facts about the network resource gathered from the remote device as structured data.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ parsed + +
+ dictionary +
+
when state is parsed +
The device native config provided in running_config option parsed into structured data as per module argspec.
+
+
Sample:
+
This output will always be in the same format as the module argspec.
+
+
+ rendered + +
+ list +
+
when state is rendered +
The provided configuration in the task rendered in device-native format (offline).
+
+
Sample:
+
['set protocols nhrp tunnel tun0 shortcut']
+
+

+ + +Status +------ + + +Authors +~~~~~~~ + +- Evgeny Molotkov (@omnom62)