10.3. Setting the network mode
You can use the podman run command with the --network option to select the network mode.
Prerequisites
-
The
container-toolsmodule is installed.
Procedure
Optional: If you want to use the
pastanetwork mode, install thepasstpackage:$ {PackageManager} install passtRun the container based on the
registry.access.redhat.com/ubi10/ubiimage:$ podman run --network=<netwok_mode> -d --name=myubi registry.access.redhat.com/ubi10/ubiThe
<netwok_mode>is the required network mode. Alternatively, you can use thedefault_rootless_network_cmdoption in thecontainers.conffile to switch the default network mode.注意The default network mode for rootless containers is
slirp4netns.
Verification
Verify the setting of the network mode:
$ podman inspect --format {{.HostConfig.NetworkMode}} myubi <netwok_mode>