You are reading an unmaintained version of the Ansible documentation. Unmaintained Ansible versions can contain unfixed security vulnerabilities (CVE). Please upgrade to a maintained version. See the latest Ansible documentation .
junos_static_route - Manage static IP routes on Juniper JUNOS network devices
This module provides declarative management of static IP routes on Juniper JUNOS network devices.
parameter
required
default
choices
comments
active
no
True
Specifies whether or not the configuration is active or deactivated
address
yes
Network address with prefix of the static route.
aliases: prefix
aggregate
no
List of static route definitions
next_hop
yes
Next hop IP of the static route.
preference
no
Global admin preference of the static route.
aliases: admin_distance
qualified_next_hop
no
Qualified next hop IP of the static route. Qualified next hops allow to associate preference with a particular next-hop address.
qualified_preference
no
Assign preference for qualified next hop.
state
no
present
State of the static route configuration.
- name : configure static route
junos_static_route :
address : 192.168.2.0/24
next_hop : 10.0.0.1
preference : 10
qualified_next_hop : 10.0.0.2
qualified_preference : 3
state : present
- name : delete static route
junos_static_route :
address : 192.168.2.0/24
state : absent
- name : deactivate static route configuration
junos_static_route :
address : 192.168.2.0/24
next_hop : 10.0.0.1
preference : 10
qualified_next_hop : 10.0.0.2
qualified_preference : 3
state : present
active : False
- name : activate static route configuration
junos_static_route :
address : 192.168.2.0/24
next_hop : 10.0.0.1
preference : 10
qualified_next_hop : 10.0.0.2
qualified_preference : 3
state : present
active : True
- name : Configure static route using aggregate
junos_static_route :
aggregate :
- { address : 4.4.4.0/24 , next_hop : 3.3.3.3 , qualified_next_hop : 5.5.5.5 , qualified_preference : 30 }
- { address : 5.5.5.0/24 , next_hop : 6.6.6.6 , qualified_next_hop : 7.7.7.7 , qualified_preference : 12 }
preference : 10
- name : Delete static route using aggregate
junos_static_route :
aggregate :
- address : 4.4.4.0/24
- address : 5.5.5.0/24
state : absent
Common return values are documented here Return Values , the following are the fields unique to this module:
name
description
returned
type
sample
diff.prepared
Configuration difference before and after applying change.
when configuration is changed and diff option is enabled.
string
[edit routing-options static]
route 2.2.2.0/24 { ... }
+ route 4.4.4.0/24 {
next-hop 3.3.3.3;
qualified-next-hop 5.5.5.5 {
+ preference 30;
}
+ preference 10; + }
Note
This module requires the netconf system service be enabled on the remote device being managed.
Tested against vSRX JUNOS version 15.1X49-D15.4, vqfx-10000 JUNOS Version 15.1X53-D60.4.
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For more information about Red Hat’s this support of this module, please
refer to this knowledge base article<https://access.redhat.com/articles/rhel-top-support-policies>
For help in developing on modules, should you be so inclined, please read Community Information & Contributing , Testing Ansible and Developing Modules .
Copyright © 2017 Red Hat, Inc.
Last updated on Nov 15, 2022.
Ansible docs are generated from GitHub sources using Sphinx using a theme provided by Read the Docs . . Module documentation is not edited directly, but is generated from the source code for the modules. To submit an update to module docs, edit the 'DOCUMENTATION' metadata in the modules directory of the core source code repository .