github.com/containers/podman/v5@v5.1.0-rc1/docs/source/markdown/podman-network-connect.1.md (about)

     1  % podman-network-connect 1
     2  
     3  ## NAME
     4  podman\-network\-connect - Connect a container to a network
     5  
     6  ## SYNOPSIS
     7  **podman network connect** [*options*] network container
     8  
     9  ## DESCRIPTION
    10  Connects a container to a network. A container can be connected to a network by name or by ID.
    11  Once connected, the container can communicate with other containers in the same network.
    12  
    13  ## OPTIONS
    14  #### **--alias**=*name*
    15  Add network-scoped alias for the container. If the network has DNS enabled (`podman network inspect -f {{.DNSEnabled}} <NAME>`),
    16  these aliases can be used for name resolution on the given network.  Multiple *--alias* options may be specified as input.
    17  NOTE: When using CNI, a container only has access to aliases on the first network that it joins. This limitation does
    18  not exist with netavark/aardvark-dns.
    19  
    20  #### **--ip**=*address*
    21  Set a static ipv4 address for this container on this network.
    22  
    23  #### **--ip6**=*address*
    24  Set a static ipv6 address for this container on this network.
    25  
    26  #### **--mac-address**=*address*
    27  Set a static mac address for this container on this network.
    28  
    29  ## EXAMPLE
    30  
    31  Connect specified container to a named network:
    32  ```
    33  podman network connect test web
    34  ```
    35  
    36  Connect specified container to named network with two aliases:
    37  ```
    38  podman network connect --alias web1 --alias web2 test web
    39  ```
    40  
    41  Connect specified container to named network with a static ip:
    42  ```
    43  podman network connect --ip 10.89.1.13 test web
    44  ```
    45  
    46  ## SEE ALSO
    47  **[podman(1)](podman.1.md)**, **[podman-network(1)](podman-network.1.md)**, **[podman-network-inspect(1)](podman-network-inspect.1.md)**, **[podman-network-disconnect(1)](podman-network-disconnect.1.md)**
    48  
    49  ## HISTORY
    50  November 2020, Originally compiled by Brent Baude <bbaude@redhat.com>