Q. Which network driver is used for multi-host networking?

  • (A) bridge
  • (B) overlay
  • (C) none
  • (D) macvlan
πŸ’¬ Discuss
βœ… Correct Answer: (B) overlay
Explanation: The 'overlay' driver allows communication between containers on different Docker hosts.

Q. Which command lists all Docker networks?

  • (A) docker network show
  • (B) docker list networks
  • (C) docker network ls
  • (D) docker networks
πŸ’¬ Discuss
βœ… Correct Answer: (C) docker network ls
Explanation: `docker network ls` shows all existing Docker networks.

Q. Which command is used to connect a container to a network?

  • (A) docker attach network
  • (B) docker network connect
  • (C) docker connect container
  • (D) docker join network
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker network connect
Explanation: `docker network connect` attaches a container to a user-defined network.

Q. What happens when a container is started with --network=none?

  • (A) It uses the default bridge network
  • (B) It is isolated from all networks
  • (C) It connects to the host network
  • (D) It joins a user-defined bridge
πŸ’¬ Discuss
βœ… Correct Answer: (B) It is isolated from all networks
Explanation: `--network=none` isolates the container from all networking.

Q. Which driver should be used to assign a container an IP from the local LAN?

  • (A) host
  • (B) bridge
  • (C) macvlan
  • (D) overlay
πŸ’¬ Discuss
βœ… Correct Answer: (C) macvlan
Explanation: `macvlan` allows containers to appear as physical devices on the network and can be assigned LAN IPs.

Q. What is required to use the overlay network?

  • (A) Bridge container
  • (B) Docker daemon restart
  • (C) Swarm mode
  • (D) Network port exposure
πŸ’¬ Discuss
βœ… Correct Answer: (C) Swarm mode
Explanation: Overlay networks are used in Docker Swarm mode for multi-host networking.

Q. How can you inspect a Docker network?

  • (A) docker inspect network
  • (B) docker network inspect
  • (C) docker show network
  • (D) docker network status
πŸ’¬ Discuss
βœ… Correct Answer: (B) docker network inspect
Explanation: `docker network inspect` provides details about a network, including attached containers.

Q. Which network driver provides the highest level of network isolation?

  • (A) none
  • (B) bridge
  • (C) host
  • (D) macvlan
πŸ’¬ Discuss
βœ… Correct Answer: (A) none
Explanation: The 'none' driver disables all networking for the container.

Q. Can you connect a container to multiple Docker networks?

  • (A) Yes
  • (B) No
  • (C) Only on bridge
  • (D) Only in Swarm
πŸ’¬ Discuss
βœ… Correct Answer: (A) Yes
Explanation: A container can be connected to multiple networks using `docker network connect`.

Q. What is the default subnet range of the Docker bridge network?

  • (A) 192.168.0.0/16
  • (B) 172.17.0.0/16
  • (C) 10.0.0.0/8
  • (D) 172.30.0.0/16
πŸ’¬ Discuss
βœ… Correct Answer: (B) 172.17.0.0/16
Explanation: Docker assigns the default bridge network a subnet of 172.17.0.0/16.