0
0
Dockerdevops~20 mins

Bridge network default behavior in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bridge Network Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Default IP assignment in Docker bridge network

When you create a container attached to the default Docker bridge network, how is its IP address assigned?

AThe container receives an IP address dynamically assigned from the bridge network's subnet by Docker's internal DHCP.
BThe container receives a static IP address defined in the Dockerfile.
CThe container shares the host machine's IP address directly without any separate IP.
DThe container does not get any IP address unless manually configured.
Attempts:
2 left
💡 Hint

Think about how Docker manages networking for containers by default.

💻 Command Output
intermediate
2:00remaining
Inspecting bridge network IP range

What is the output of the following command snippet that inspects the default bridge network's subnet?

docker network inspect bridge --format '{{range .IPAM.Config}}{{.Subnet}}{{end}}'
A172.17.0.0/16
B192.168.1.0/24
C10.0.0.0/8
DNo output, command fails
Attempts:
2 left
💡 Hint

The default Docker bridge network usually uses a private IP range starting with 172.

Troubleshoot
advanced
2:00remaining
Container cannot reach host on default bridge network

A container connected to the default bridge network cannot ping the host machine's IP address. What is the most likely reason?

AThe container's IP address conflicts with the host's IP address.
BDocker disables inter-container communication by default on the bridge network.
CThe host's firewall blocks traffic from the Docker bridge subnet.
DContainers on the default bridge network do not get DNS resolution.
Attempts:
2 left
💡 Hint

Consider network security settings on the host machine.

🔀 Workflow
advanced
2:00remaining
Connecting two containers on default bridge network

You want two containers on the default bridge network to communicate by name. What must you do?

ARestart Docker daemon to enable container name resolution on the default bridge network.
BManually edit /etc/hosts inside each container to add the other container's name and IP.
CUse the container's IP address directly because DNS is not supported on the default bridge network.
DCreate a user-defined bridge network instead, which supports automatic DNS resolution by container name.
Attempts:
2 left
💡 Hint

Think about Docker's networking features for name resolution.

Best Practice
expert
2:00remaining
Securing default bridge network communication

What is the best practice to restrict container communication on the default Docker bridge network?

AUse Docker's --icc=false option to disable inter-container communication on the default bridge network.
BAll of the above combined provide the best security.
CConfigure iptables rules on the host to block unwanted container traffic on the default bridge network.
DDisable the default bridge network and create isolated user-defined bridge networks with specific rules.
Attempts:
2 left
💡 Hint

Consider multiple layers of network security controls.