github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/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 is using the `dnsname` CNI plugin, these aliases
    16  can be used for name resolution on the given network.  Multiple *--alias* options may be specified as input.
    17  NOTE: A container will only have access to aliases on the first network that it joins.  This is a limitation
    18  that will be removed in a later release.
    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 a container named *web* to a network named *test*
    32  ```
    33  podman network connect test web
    34  ```
    35  
    36  Connect a container name *web* to a network named *test* with two aliases: web1 and web2
    37  ```
    38  podman network connect --alias web1 --alias web2 test web
    39  ```
    40  
    41  Connect a container name *web* to a network named *test* 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-disconnect(1)](podman-network-disconnect.1.md)**
    48  
    49  ## HISTORY
    50  November 2020, Originally compiled by Brent Baude <bbaude@redhat.com>