Ansible ios_static_route configures static routes

300-435 By islever Editorial Last updated

Short answer

A The Ansible ios_static_route module creates static route entries by writing ip route lines on IOS.

Question

What is Ansible ios_static_route?
  1. Configures static routes on IOS Correct Answer
  2. Configures BGP
  3. Configures OSPF
  4. Configures VLAN

Key Takeaways

The Ansible cisco.ios.ios_static_route module creates static route entries on Cisco IOS by writing ip route configuration lines. Option A is correct because the module handles only static routes, while BGP, OSPF and VLAN tasks belong to the ios_bgp, ios_ospf and ios_vlans modules respectively. The module's name and its idempotent prefix/mask/next_hop parameters make static routing the clear answer.

Expert Analysis

ios_static_route module creates static route entries.

The deciding fact for ios_static_route is its name: the Ansible cisco.ios.ios_static_route module operates on the ip route configuration line of Cisco IOS, which is where static route entries are written. Choosing option A therefore matches the module's one job — creating, updating or removing static route entries — while the other three options name routing or switching features that belong to entirely different modules.

Why the other options fail. Option B, "Configures BGP," would be handled by ios_bgp or ios_bgp_global, modules that set router bgp parameters such as ASN, neighbors and address families; nothing in an ip route statement touches BGP. Option C, "Configures OSPF," would be handled by ios_ospf / ios_ospf_v2, which manage router ospf process IDs, networks and areas — again a different configuration hierarchy than a single static prefix with a next hop. Option D, "Configures VLAN," is not a routing task at all: ios_vlans manages VLAN database entries (and ios_l2_interface_* handles switchport membership), so a static-route module can never create or delete a VLAN.

How the module is actually used. An Ansible task targeting this module supplies prefix, mask and next_hop (optionally route_tag or state: absent), and the module renders the corresponding ip route <prefix> <mask> <next-hop> line, then diffs it against the running configuration. Because the module is stateful and idempotent, running a playbook twice converges rather than appending duplicate entries — the same idempotency pattern Ansible applies to ios_static_route's siblings.

One mechanism this question relies on but never states. The relevant rule is the routing decision order: on IOS, a static route with a lower administrative distance wins over a dynamic route for the same prefix (a directly connected route at AD 0 and an OSPF-learned route at AD 110 both rank above a static entry at AD 1). The ios_static_route module's practical purpose is to inject exactly such a preferred or more specific path — for example, pointing 10.99.0.0/24 at next hop 192.0.2.1 when OSPF would otherwise advertise a less direct path. This is why the module is distinct from the OSPF and BGP modules: it writes a single explicit forwarding decision instead of participating in a routing protocol.

On the exam, treat module naming as the shortcut — Ansible network modules follow <os>_<feature> (and here <os>_<protocol>_<feature>), so ios_static_route maps directly to static routes on IOS, and the three distractors each correspond to a different, correctly named module (ios_bgp_global, ios_ospf_v2, ios_vlans).

Exam Strategy

In Ansible network automation questions, read the module name as <os>_<feature> and let it decide the answer before reading the options. Here ios_static_route names the feature outright, so the three distractors (BGP, OSPF, VLAN) are simply other features owned by other ios_* modules. On the real exam, if two options both seem plausible, pick the one whose feature matches the module's own token and skip any option describing a protocol or L2 construct the module cannot touch.

Practice All 300-435 Questions

Access 150 questions with complete answers and detailed explanations.

View Full 300-435 Practice Test →

← Back to 300-435 Study Guide