9.5. Disconnecting a container from a network
Use the podman network disconnect command to disconnect the container from the network.
Prerequisites
-
The
container-toolsmeta-package is installed. -
A network has been created by using the
podman network createcommand. - A container is connected to a network.
Procedure
Disconnect the container named
mycontainerfrom the network namedmynet:# podman network disconnect mynet mycontainer
Verification
Verify that the
mycontaineris disconnected from themynetnetwork:# podman inspect --format='{{.NetworkSettings.Networks}}' mycontainer map[podman:0xc000537440]You can see that
mycontaineris disconnected from themynetnetwork,mycontaineris only connected to the defaultpodmannetwork.Refer to
podman-network-disconnect(1)man page on your system for more information.