github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-network-create.1.md (about)

     1  % podman-network-create(1)
     2  
     3  ## NAME
     4  podman\-network-create - Create a Podman CNI network
     5  
     6  ## SYNOPSIS
     7  **podman network create**  [*options*] name
     8  
     9  ## DESCRIPTION
    10  Create a CNI-network configuration for use with Podman. By default, Podman creates a bridge connection. A
    11  *Macvlan* connection can be created with the *macvlan* option. In the case of *Macvlan* connections, the
    12  CNI *dhcp* plugin needs to be activated or the container image must have a DHCP client to interact
    13  with the host network's DHCP server.
    14  
    15  If no options are provided, Podman will assign a free subnet and name for your network.
    16  
    17  Upon completion of creating the network, Podman will display the path to the newly added network file.
    18  
    19  ## OPTIONS
    20  #### **--disable-dns**
    21  
    22  Disables the DNS plugin for this network which if enabled, can perform container to container name
    23  resolution.
    24  
    25  #### **--driver**, **-d**
    26  
    27  Driver to manage the network (default "bridge").  Currently only `bridge` is supported.
    28  
    29  #### **--gateway**
    30  
    31  Define a gateway for the subnet. If you want to provide a gateway address, you must also provide a
    32  *subnet* option.
    33  
    34  #### **--internal**
    35  
    36  Restrict external access of this network
    37  
    38  #### **--ip-range**
    39  
    40  Allocate container IP from a range.  The range must be a complete subnet and in CIDR notation.  The *ip-range* option
    41  must be used with a *subnet* option.
    42  
    43  #### **--macvlan**
    44  
    45  Create a *Macvlan* based connection rather than a classic bridge.  You must pass an interface name from the host for the
    46  Macvlan connection.
    47  
    48  #### **--subnet**
    49  
    50  The subnet in CIDR notation.
    51  
    52  #### **--ipv6**
    53  
    54  Enable IPv6 (Dual Stack) networking. You must pass a IPv6 subnet. The *subnet* option must be used with the *ipv6* option.
    55  
    56  ## EXAMPLE
    57  
    58  Create a network with no options
    59  ```
    60  # podman network create
    61  /etc/cni/net.d/cni-podman-4.conflist
    62  ```
    63  
    64  Create a network named *newnet* that uses *192.5.0.0/16* for its subnet.
    65  ```
    66  # podman network create --subnet 192.5.0.0/16 newnet
    67  /etc/cni/net.d/newnet.conflist
    68  ```
    69  
    70  Create an IPv6 network named *newnetv6*, you must specify the subnet for this network, otherwise the command will fail.
    71  For this example, we use *2001:db8::/64* for its subnet.
    72  ```
    73  # podman network create --subnet 2001:db8::/64 --ipv6 newnetv6
    74  /etc/cni/net.d/newnetv6.conflist
    75  ```
    76  
    77  Create a network named *newnet* that uses *192.168.33.0/24* and defines a gateway as *192.168.133.3*
    78  ```
    79  # podman network create --subnet 192.168.33.0/24 --gateway 192.168.33.3 newnet
    80  /etc/cni/net.d/newnet.conflist
    81  ```
    82  
    83  Create a network that uses a *192.168.55.0/24** subnet and has an IP address range of *192.168.55.129 - 192.168.55.254*.
    84  ```
    85  # podman network create --subnet 192.168.55.0/24 --ip-range 192.168.55.128/25
    86  /etc/cni/net.d/cni-podman-5.conflist
    87  ```
    88  
    89  Create a Macvlan based network using the host interface eth0
    90  ```
    91  # podman network create --macvlan eth0 newnet
    92  /etc/cni/net.d/newnet.conflist
    93  ```
    94  
    95  ## SEE ALSO
    96  podman(1), podman-network(1), podman-network-inspect(1)
    97  
    98  ## HISTORY
    99  August 2019, Originally compiled by Brent Baude <bbaude@redhat.com>