LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

podman-network

Create and manage Podman networks

TLDR

List networks
$ podman network ls
copy
Create a network
$ podman network create [name]
copy
Create a network on a subnet
$ podman network create --subnet 10.89.1.0/24 [name]
copy
Inspect a network
$ podman network inspect [name]
copy
Connect a container
$ podman network connect [name] [container]
copy
Disconnect a container
$ podman network disconnect [name] [container]
copy
Remove unused networks
$ podman network prune
copy
Remove networks
$ podman network rm [name]
copy

SYNOPSIS

podman network subcommand

DESCRIPTION

podman network manages networks for Podman containers. Podman uses Netavark as the network backend. On a network with DNS enabled, aardvark-dns registers each container under its name and under its short ID.The default rootful bridge network is named `podman` and uses `10.88.0.0/16`. Rootless containers use pasta by default, which copies addresses from the host and does not use that bridge. Both the default subnet and pasta options can be changed in `containers.conf`.

PARAMETERS

ls

List networks. list is an alias.
create name
Create a network. With no --subnet, Podman picks a free network from `10.89.0.0/24` upward. --driver selects `bridge`, `macvlan`, or `ipvlan`. --gateway, --ip-range, --ipv6, --internal, --disable-dns, and --label set the usual options.
inspect name...
Print the configuration of one or more networks.
connect network container
Attach a container. --alias adds a DNS name.
disconnect network container
Detach a container.
exists name
Exit successfully when the network exists.
rm name...
Remove networks. remove is an alias.
prune
Remove networks that no container is using.
reload
Reload network configuration for containers.
update name
Change an existing network, including adding or removing subnets.

INSTALL

sudo apt install podman
copy
sudo dnf install podman
copy
sudo pacman -S podman
copy
sudo apk add podman
copy
sudo zypper install podman
copy
brew install podman
copy
nix profile install nixpkgs#podman
copy

CAVEATS

Removing a network that a container still uses fails until the container is disconnected or removed. Changing the default subnet applies when no containers are running. prune asks for confirmation unless --force is passed.

SEE ALSO

RESOURCES

Copied to clipboard
Kai