Create a network
Create custom networks for your containers by using the podman network create command. You can configure external access or create isolated internal networks for secure container communication.
Before you begin
- The
container-toolsmeta-package is installed.
About this task
By default, Podman creates an external network. You can create an internal network in which containers can communicate with other containers on the host, but cannot connect to networks outside the host.
Procedure
mynet:
# podman network create mynet
/etc/cni/net.d/mynet.conflist
Results
- List all networks:
# podman network lsNETWORK ID NAME VERSION PLUGINS 2f259bab93aa podman 0.4.0 bridge,portmap,firewall,tuning 11c844f95e28 mynet 0.4.0 bridge,portmap,firewall,tuning,dnsnameYou can see the created
mynetnetwork and defaultpodmannetwork.
Beginning with Podman 4.0, the DNS plugin is enabled by default if you create a new external network by using the podman network create command.
Refer to podman-network-create(1) man page on your system for more information.