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-tools module is installed.

Procedure

  1. Optional: If you want to use the pasta network mode, install the passt package:

    $ {PackageManager} install passt
  2. Run the container based on the registry.access.redhat.com/ubi10/ubi image:

    $ podman run --network=<netwok_mode> -d --name=myubi registry.access.redhat.com/ubi10/ubi

    The <netwok_mode> is the required network mode. Alternatively, you can use the default_rootless_network_cmd option in the containers.conf file 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>
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部