Question 989 of 1,819
AI and Network OperationsmediumConfigurationObjective-mapped

Quick Answer

The correct answer is the playbook using `network_cli` connection with the three lines under `ios_config`: `interface Loopback0`, `ip address 10.0.0.1 255.255.255.0`, and `no shutdown`. This is correct because Ansible’s `network_cli` connection type is specifically designed for network device configuration over SSH, and the `ios_config` module applies configuration lines in order without needing the `parents` argument when you include the interface line directly in the `lines` list. The subnet mask must be in dotted-decimal format (255.255.255.0) rather than CIDR notation, as Cisco IOS expects the traditional mask syntax. On the CCNA 200-301 v2 exam, this question tests your understanding of Ansible playbook syntax for Cisco IOS-XE automation, a key automation skill now integrated into the exam blueprint. A common trap is using `shutdown` instead of `no shutdown`, which would disable the interface, or using `parents` when the question explicitly forbids it. Memory tip: think “three lines, no parents, mask in dots” to recall the correct structure.

CCNA AI and Network Operations Practice Question

This 200-301 practice question tests your understanding of ai and network operations. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

You are connected to R1 via the console. R1 is a Cisco IOS-XE router. The network manager wants to use an Ansible playbook to configure a loopback interface with IP address 10.0.0.1/24 on R1. You need to write the Ansible YAML playbook that connects to R1 and configures this interface. The playbook must not use the 'parents' argument in the ios_config module.

Question 1mediumConfiguration
Read the full Ansible explanation →

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

- name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - no shutdown

Option A is correct because it uses the network_cli connection type, applies the correct subnet mask (255.255.255.0), includes 'no shutdown' to enable the interface, and does not use the 'parents' argument, meeting the requirement. Option B is wrong because it uses an 'ssh' connection (not network_cli) and writes the IP address in CIDR notation (/24) instead of the required dotted-decimal mask. Option C is wrong because it uses 'shutdown' instead of 'no shutdown', which disables the interface. Option D is wrong because it uses the 'parents' argument, which the stem explicitly forbids, even though the configuration would otherwise be valid.

Key principle: Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • - name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - no shutdown

    Why this is correct

    This playbook correctly uses the ios_config module with network_cli connection to apply the required CLI commands. The lines list includes the interface configuration commands in the correct order, and the connection type is appropriate for Cisco IOS-XE devices.

    Related concept

    CIDR notation defines the prefix length.

  • - name: Configure Loopback hosts: R1 gather_facts: no connection: ssh tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1/24 - no shutdown

    Why it's wrong here

    This is incorrect because the connection type should be 'network_cli' for Cisco IOS devices, not 'ssh'. Additionally, the IP address format in the ios_config lines should use the subnet mask (255.255.255.0) rather than CIDR notation (/24).

  • - name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - shutdown

    Why it's wrong here

    This is incorrect because the 'shutdown' command disables the interface, whereas the requirement is to configure and enable it. The correct command is 'no shutdown' to bring the interface up.

  • - name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - no shutdown parents: interface Loopback0

    Why it's wrong here

    This is incorrect because the 'parents' directive is used when the lines are subcommands of a parent configuration block, but here the lines already include the 'interface Loopback0' command. Using 'parents' would cause the playbook to enter interface configuration mode twice, leading to an error.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The 200-301 exam frequently reuses these exact scenarios with slightly different constraints.

- name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - no shutdownCorrect answer

Why this is correct

This playbook correctly uses the ios_config module with network_cli connection to apply the required CLI commands. The lines list includes the interface configuration commands in the correct order, and the connection type is appropriate for Cisco IOS-XE devices.

- name: Configure Loopback hosts: R1 gather_facts: no connection: ssh tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1/24 - no shutdownWrong answer — click to see why

Why this is wrong here

The specific factual error: Ansible's ios_config module requires the 'network_cli' connection plugin for Cisco IOS devices, and the 'ip address' command expects a subnet mask, not CIDR prefix length.

Why candidates choose this

Candidates might think 'ssh' is acceptable because Ansible uses SSH for many connections, but network_cli is specifically needed for network device modules. Also, CIDR notation is common in other contexts, leading to confusion.

- name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - shutdownWrong answer — click to see why

Why this is wrong here

The specific factual error: The 'shutdown' command administratively disables an interface, which is opposite to the intended action of enabling it.

Why candidates choose this

Candidates might confuse 'shutdown' with 'no shutdown' or forget that interfaces are often shut by default, so they may think 'shutdown' is needed to enable it.

- name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - no shutdown parents: interface Loopback0Wrong answer — click to see why

Why this is wrong here

Uses the 'parents' argument, which is not allowed by the requirement.

Why candidates choose this

Candidates might think 'parents' is required to enter interface configuration mode, but the ios_config module can accept the full commands directly in the lines list.

Analysis generated from the official 200-301blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

Common exam traps

Common exam trap: usable hosts are not the same as total addresses

Subnetting questions often tempt you into counting all addresses. In normal IPv4 subnets, the network and broadcast addresses are not usable host addresses.

Trap categories for this question

  • Command / output trap

    This is incorrect because the 'shutdown' command disables the interface, whereas the requirement is to configure and enable it. The correct command is 'no shutdown' to bring the interface up.

Detailed technical explanation

How to think about this question

Subnetting questions test whether you can identify the network, broadcast address, usable range, mask and correct subnet. Slow down enough to calculate the block size correctly.

KKey Concepts to Remember

  • CIDR notation defines the prefix length.
  • Block size helps identify subnet boundaries.
  • Network and broadcast addresses are not usable hosts in normal IPv4 subnets.
  • The required host count determines the smallest suitable subnet.

TExam Day Tips

  • Write the block size before choosing the subnet.
  • Check whether the question asks for hosts, subnets or a specific address range.
  • Do not confuse /24, /25, /26 and /27 host counts.

Key takeaway

Count usable hosts — not total addresses — and remember that the network and broadcast addresses are not available to hosts in standard IPv4 subnets.

Real-world example

How this comes up in practice

A network engineer segments a warehouse floor into three subnets: 20 scanners, 5 printers, and 2 management hosts. Picking the wrong mask wastes addresses or leaves too few usable hosts. Exam questions test whether you can apply CIDR notation, calculate block size, and identify the correct usable-host range for a given prefix.

What to study next

Got this wrong? Here's your next step.

Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related 200-301 subnetting questions on CIDR, address ranges, and subnet selection.

Related practice questions

Related 200-301 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free 200-301 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this 200-301 question test?

AI and Network Operations — This question tests AI and Network Operations — CIDR notation defines the prefix length..

What is the correct answer to this question?

The correct answer is: - name: Configure Loopback hosts: R1 gather_facts: no connection: network_cli tasks: - name: Configure interface ios_config: lines: - interface Loopback0 - ip address 10.0.0.1 255.255.255.0 - no shutdown — Option A is correct because it uses the network_cli connection type, applies the correct subnet mask (255.255.255.0), includes 'no shutdown' to enable the interface, and does not use the 'parents' argument, meeting the requirement. Option B is wrong because it uses an 'ssh' connection (not network_cli) and writes the IP address in CIDR notation (/24) instead of the required dotted-decimal mask. Option C is wrong because it uses 'shutdown' instead of 'no shutdown', which disables the interface. Option D is wrong because it uses the 'parents' argument, which the stem explicitly forbids, even though the configuration would otherwise be valid.

What should I do if I get this 200-301 question wrong?

Review block sizes, usable host formulas (2^n − 2), and how to find network and broadcast addresses for /24 through /30. Then practise related 200-301 subnetting questions on CIDR, address ranges, and subnet selection.

What is the key concept behind this question?

CIDR notation defines the prefix length.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More 200-301 practice questions

Last reviewed: Jun 7, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This 200-301 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-301 exam.