9.4. Connecting a container to a network
Use the podman network connect command to connect the container to the network.
Prerequisites
-
The
container-toolsmeta-package is installed. -
A network has been created by using the
podman network createcommand. - A container has been created.
Procedure
Connect a container named
mycontainerto a network namedmynet:# podman network connect mynet mycontainer
Verification
Verify that the
mycontaineris connected to themynetnetwork:# podman inspect --format='{{.NetworkSettings.Networks}}' mycontainer map[podman:0xc00042ab40 mynet:0xc00042ac60]You can see that
mycontaineris connected tomynetandpodmannetworks.