Whenever you deal with networking you likely need ips and thus subnets. Podman is no different and uses some default subnets that you should be aware of. This post shows you what these are and how to change them if there is already a subnet in this range on your network.
The default bridge network (called podman) uses 10.88.0.0/16 as a subnet. When podman runs as root this network is used as default, it is the same as adding
--network bridge or
--network podman. This subnet can be changed in containers.conf under the
[network] section. Set the
default_subnet to any subnet that is free in your environment. There you could also change the name from podman to something else with the
default_network key. Note that you should only do this when no containers are running.
When podman is run as rootless the internet connectivity is provided with slirp4netns by default. Slirp4nents uses 10.0.2.0/24 for its default network. This can also be changed in containers.conf but under the
[engine] section. Use the
network_cmd_options key and add
["cidr=X.X.X.X/24"] as value. Note that slirp4netns needs a network prefix size between 1 and 25. This option accepts an array so you could add more options comma separated as described in the man page. If you just want to change this for one container you can also specify it on the cli with
When using the default network as rootless, i.e.
--network podman/bridge, then it also uses the same subnet as described above in addition to the slirp4netns subnet.
Podman network create
When a new network is created with podman network create and no subnet is given with
--subnet podman will start picking a free subnet from 10.89.0.0/24 to 10.255.255.0/24. Use the
default_subnet_pools option under the
[network] section in containers.conf to change the range and/or size that is assigned by default.
Leave a Reply