Question 388 of 510
Scripting, Containers and AutomationmediumMultiple SelectObjective-mapped

Quick Answer

The correct answer is Bridge and Macvlan, as these are the two container networking modes that allow a container to have its own IP address on the host network. Macvlan achieves this by assigning each container a unique MAC and IP address directly from the host’s physical subnet, making the container appear as an independent device on the same network. Bridge mode, by contrast, creates a virtual switch like docker0 and assigns containers IPs from a private subnet, then uses NAT to connect them to the host network—so while the IP is private, it is still the container’s own address on the host’s network. On the CompTIA Linux+ XK0-005 exam, this question tests your understanding of how containers interface with the host’s networking stack, often tripping candidates who confuse host mode (which shares the host’s IP) with these two. A common trap is assuming only Macvlan gives a unique IP, but Bridge does too, just on a different subnet. Remember: “Bridge builds a private block, Macvlan mirrors the main street”—both give the container its own address.

XK0-005 Scripting, Containers and Automation Practice Question

This XK0-005 practice question tests your understanding of scripting, containers and automation. Match the stated requirement to the specific cloud service, access model, or configuration option — many options are valid in isolation but not for this scenario. 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.

Which TWO container networking modes allow a container to have its own IP address on the host network? (Choose TWO.)

Question 1mediummulti select
Full question →

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

Macvlan

Macvlan mode assigns each container a unique MAC address and IP address from the host's physical network, making the container appear as a separate device on the same subnet. Bridge mode creates a virtual bridge (typically docker0) and assigns containers IPs from a private subnet, allowing them to communicate with the host network via NAT. Both modes give the container its own IP address on the host network, though bridge uses a private range while macvlan uses the host's subnet directly.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

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

  • Macvlan

    Why this is correct

    Container gets its own MAC/IP on physical network.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Host

    Why it's wrong here

    Container uses host's IP, no own IP.

  • None

    Why it's wrong here

    No network access.

  • Overlay

    Why it's wrong here

    Overlay is for cross-host, but still gives own IP? Actually overlay gives own IP on overlay network, but it's not the host network. The question says 'on the host network'. Overlay is separate. So not correct.

  • Bridge

    Why this is correct

    Containers get IPs on the bridge network.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates often confuse 'own IP address' with 'own network namespace'—Host mode gives the container its own namespace but shares the host's IP, while Bridge gives a private IP that is not directly on the host's physical subnet, leading some to incorrectly select Host or Overlay.

Detailed technical explanation

How to think about this question

In macvlan mode, the host's physical interface is configured with multiple MAC addresses, and the kernel's bridge/forwarding logic handles traffic without NAT, enabling direct layer-2 connectivity. Bridge mode uses iptables rules for NAT (masquerading) and port mapping, which can introduce performance overhead and complexity in firewall rules. A subtle behavior: macvlan can cause issues with DHCP servers that limit leases per MAC address, and it requires the host's physical interface to be in promiscuous mode.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A help-desk technician troubleshoots why a newly connected PC cannot reach shared printers on the same floor. The cable is good, the switch port is active, but the PC is in VLAN 20 and the printers are in VLAN 10. The uplink trunk only allows VLAN 10. A trunk being up does not mean every VLAN crosses it.

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related XK0-005 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 XK0-005 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 XK0-005 question test?

Scripting, Containers and Automation — This question tests Scripting, Containers and Automation — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Macvlan — Macvlan mode assigns each container a unique MAC address and IP address from the host's physical network, making the container appear as a separate device on the same subnet. Bridge mode creates a virtual bridge (typically docker0) and assigns containers IPs from a private subnet, allowing them to communicate with the host network via NAT. Both modes give the container its own IP address on the host network, though bridge uses a private range while macvlan uses the host's subnet directly.

What should I do if I get this XK0-005 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

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

Last reviewed: Jun 25, 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 XK0-005 practice question is part of Courseiva's free CompTIA 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 XK0-005 exam.