Remove a network

Delete unused networks by using the podman network rm command. Note that you cannot remove a network if it is currently in use by any containers.

Before you begin

  • The container-tools meta-package is installed.

Procedure

  1. List all networks:
    # podman network ls
    NETWORK ID    NAME        VERSION     PLUGINS
    2f259bab93aa  podman      0.4.0       bridge,portmap,firewall,tuning
    11c844f95e28  mynet       0.4.0       bridge,portmap,firewall,tuning,dnsname
  2. Remove the mynet network:
    # podman network rm mynet
    mynet
    Note

    If the removed network has associated containers with it, you have to use the podman network rm -f command to delete containers and pods.

Results

  • Check if mynet network was removed:
    # podman network ls
    NETWORK ID    NAME        VERSION     PLUGINS
    2f259bab93aa  podman      0.4.0       bridge,portmap,firewall,tuning

    For more information, see podman-network-rm(1) man page on your system.