Networking Flashcards
What are the 5 different network drivers?
- Bridge
- Host
- Overlay
- MACVLAN
- None
What are the 5 attributes of the Container Networking Model (CNM)?
- Sandbox
- Endpoint
- Network
- Network Drivers
- IPAM Drivers
What is the default network driver used when creating a container without specifying?
bridge network
Command to create a user defined bridge network?
docker network create –driver bridge mybridge
How to run a docker container in a specific network?
docker run –name mycontainer –network mybridge ubuntu
Name 4 differences between user defined and the default bridge network?
- User defines allows for embedded DNS for other containers on same bridge using container names
- User defined provides better isolation
- Containers can be attached/detached without stopping them on user defined bridge
- User defined bridges are configured inside docker, default bridge is not.
What is the main characteristic of the Host network driver?
Ports are opened directly from the host to the container. Ports do not need to be published
What is a use case for using the Host network?
Running a container which monitors the hosts eth0 interface
What network access does the None network driver have?
No access to/from the host or to/from other containers
How to publish all ports of a container to the host with the run command?
Use -P (–publish-all)
What is the legacy approach for linking containers?
docker run –name my_ubuntu –link source_container:alias_for_container ubuntu
How to encrypt an overlay network upon creation?
docker network create –opt encrypted –driver overlay my_network
How does docker encrypt overlay networks?
IPSEC tunnels between nodes