- AnsibleFest
- Products
- Community
- Webinars & Training
- Blog

Documentation

# cnos_static_route – Manage static IP routes on Lenovo CNOS network devices

New in version 2.8.

- Synopsis
- Parameters
- Notes
- Examples
- Return Values
- Status

## Synopsis

- This module provides declarative management of static IP routes on Lenovo CNOS network devices.

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
admin_distance - | Default: 1 | Admin distance of the static route.
aggregate - |  | List of static route definitions.
description - |  | Name of the static route aliases: description
interface - |  | Interface of the static route.
mask - |  | Network prefix mask of the static route.
next_hop - |  | Next hop IP of the static route.
prefix - |  | Network prefix of the static route.
state - | Choices: present ← absent | State of the static route configuration.
tag - |  | Set tag of the static route.

## Notes

Note

- Tested against CNOS 10.10.1

## Examples

    - name: configure static route
      cnos_static_route:
        prefix: 10.241.107.0
        mask: 255.255.255.0
        next_hop: 10.241.106.1

    - name: configure ultimate route with name and tag
      cnos_static_route:
        prefix: 10.241.107.0
        mask: 255.255.255.0
        interface: Ethernet1/13
        description: hello world
        tag: 100

    - name: remove configuration
      cnos_static_route:
        prefix: 10.241.107.0
        mask: 255.255.255.0
        next_hop: 10.241.106.0
        state: absent

    - name: Add static route aggregates
      cnos_static_route:
        aggregate:
          - { prefix: 10.241.107.0, mask: 255.255.255.0, next_hop: 10.241.105.0 }
          - { prefix: 10.241.106.0, mask: 255.255.255.0, next_hop: 10.241.104.0 }

    - name: Remove static route aggregates
      cnos_static_route:
        aggregate:
          - { prefix: 10.241.107.0, mask: 255.255.255.0, next_hop: 10.241.105.0 }
          - { prefix: 10.241.106.0, mask: 255.255.255.0, next_hop: 10.241.104.0 }
        state: absent

## Return Values

Common return values are documented here, the following are the fields unique to this module:

Key | Returned | Description
--- | --- | ---
commands list | always | The list of configuration mode commands to send to the device Sample: ['ip route 10.241.107.0 255.255.255.0 10.241.106.0']

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]

### Authors

- Anil Kumar Muraleedharan (@amuraleedhar)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.