.nh
.TH podman-network-create 1
.SH NAME
.PP
podman-network-create - Create a Podman network

.SH SYNOPSIS
.PP
\fBpodman network create\fP  [\fIoptions\fP] [\fIname\fP]

.SH DESCRIPTION
.PP
Create a network configuration for use with Podman. By default, Podman creates a bridge connection.
A \fIMacvlan\fP connection can be created with the \fI-d macvlan\fP option. A parent device for macvlan or
ipvlan can be designated with the \fI-o parent=\fB\fC<device>\fR\fP or \fI--network-interface=\fB\fC<device>\fR\fP option.

.PP
If no options are provided, Podman will assign a free subnet and name for the network.

.PP
Upon completion of creating the network, Podman will display the name of the newly added network.

.PP
NOTE: The support for the network name pasta is deprecated and will be removed in the next major
release because it is used as a special network mode in \fBpodman run/create --network\fP\&.

.SH OPTIONS
.SS \fB--disable-dns\fP
.PP
Disables the DNS plugin for this network which if enabled, can perform container to container name
resolution. It is only supported with the \fB\fCbridge\fR driver, for other drivers it will be always disabled.

.SS \fB--dns\fP=\fIip\fP
.PP
Set network-scoped DNS resolver/nameserver for containers in this network. If not set, the host servers from \fB\fC/etc/resolv.conf\fR will be used.  It can be overwritten on the container level with the \fB\fCpodman run/create --dns\fR option. This option can be specified multiple times to set more than one IP.

.SS \fB--driver\fP, \fB-d\fP=\fIdriver\fP
.PP
Driver to manage the network. Currently \fB\fCbridge\fR, \fB\fCmacvlan\fR and \fB\fCipvlan\fR are supported. Defaults to \fB\fCbridge\fR\&.
As rootless the \fB\fCmacvlan\fR and \fB\fCipvlan\fR driver have no access to the host network interfaces because rootless networking requires a separate network namespace.

.PP
The netavark backend allows the use of so called \fInetavark plugins\fP, see the
plugin-API.md
documentation in netavark. The binary must be placed in a specified directory
so podman can discover it, this list is set in \fB\fCnetavark_plugin_dirs\fR in
\fBcontainers.conf(5)\fP
under the \fB\fC[network]\fR section.

.PP
The name of the plugin can then be used as driver to create a network for your plugin.
The list of all supported drivers and plugins can be seen with \fB\fCpodman info --format {{.Plugins.Network}}\fR\&.

.SS \fB--gateway\fP=\fIip\fP
.PP
Define a gateway for the subnet. To provide a gateway address, a
\fIsubnet\fP option is required. Can be specified multiple times.
The argument order of the \fB--subnet\fP, \fB--gateway\fP and \fB--ip-range\fP options must match.

.SS \fB--ignore\fP
.PP
Ignore the create request if a network with the same name already exists instead of failing.
Note, trying to create a network with an existing name and different parameters, will not change the configuration of the existing one

.SS \fB--interface-name\fP=\fIname\fP
.PP
This option maps the the \fInetwork_interface\fP option in the network config, see \fBpodman network inspect\fP\&.
Depending on the driver this can have different effects, for \fB\fCbridge\fR it will be the bridge interface name.
For \fB\fCmacvlan\fR and \fB\fCipvlan\fR this will be the parent device on the host. It is the same as \fB\fC--opt parent=...\fR\&.

.SS \fB--internal\fP
.PP
Restrict external access of this network. Note when using this option, the dnsname plugin will be
automatically disabled.

.SS \fB--ip-range\fP=\fIrange\fP
.PP
Allocate container IP from a range.  The range must be a complete subnet and in CIDR notation.  The \fIip-range\fP option
must be used with a \fIsubnet\fP option. Can be specified multiple times.
The argument order of the \fB--subnet\fP, \fB--gateway\fP and \fB--ip-range\fP options must match.

.SS \fB--ipam-driver\fP=\fIdriver\fP
.PP
Set the ipam driver (IP Address Management Driver) for the network. When unset podman will choose an
ipam driver automatically based on the network driver.

.PP
Valid values are:

.RS
.IP \(bu 2
\fB\fCdhcp\fR: IP addresses are assigned from a dhcp server on the network. This driver is not yet supported with netavark. For CNI the \fIdhcp\fP plugin needs to be activated before.
.IP \(bu 2
\fB\fChost-local\fR: IP addresses are assigned locally.
.IP \(bu 2
\fB\fCnone\fR: No ip addresses are assigned to the interfaces.

.RE

.PP
View the driver in the \fBpodman network inspect\fP output under the \fB\fCipam_options\fR field.

.SS \fB--ipv6\fP
.PP
Enable IPv6 (Dual Stack) networking. If not subnets are given it will allocate an ipv4 and an ipv6 subnet.

.SS \fB--label\fP=\fIlabel\fP
.PP
Set metadata for a network (e.g., --label mykey=value).

.SS \fB--opt\fP, \fB-o\fP=\fIoption\fP
.PP
Set driver specific options.

.PP
All drivers accept the \fB\fCmtu\fR and \fB\fCmetric\fR options.

.RS
.IP \(bu 2
\fB\fCmtu\fR: Sets the Maximum Transmission Unit (MTU) and takes an integer value.
.IP \(bu 2
\fB\fCmetric\fR Sets the Route Metric for the default route created in every container joined to this network. Accepts a positive integer value. Can only be used with the Netavark network backend.

.RE

.PP
Additionally the \fB\fCbridge\fR driver supports the following options:

.RS
.IP \(bu 2
\fB\fCvlan\fR: This option assign VLAN tag and enables vlan_filtering. Defaults to none.
.IP \(bu 2
\fB\fCisolate\fR: This option isolates networks by blocking traffic between those that have this option enabled.
.IP \(bu 2
\fB\fCcom.docker.network.bridge.name\fR: This option assigns the given name to the created Linux Bridge
.IP \(bu 2
\fB\fCcom.docker.network.driver.mtu\fR: Sets the Maximum Transmission Unit (MTU) and takes an integer value.

.RE

.PP
The \fB\fCmacvlan\fR and \fB\fCipvlan\fR driver support the following options:

.RS
.IP \(bu 2
\fB\fCparent\fR: The host device which should be used for the macvlan interface. Defaults to the default route interface.
.IP \(bu 2
\fB\fCmode\fR: This option sets the specified ip/macvlan mode on the interface.
.RS
.IP \(bu 2
Supported values for \fB\fCmacvlan\fR are \fB\fCbridge\fR, \fB\fCprivate\fR, \fB\fCvepa\fR, \fB\fCpassthru\fR\&. Defaults to \fB\fCbridge\fR\&.
.IP \(bu 2
Supported values for \fB\fCipvlan\fR are \fB\fCl2\fR, \fB\fCl3\fR, \fB\fCl3s\fR\&. Defaults to \fB\fCl2\fR\&.

.RE


.RE

.SS \fB--subnet\fP=\fIsubnet\fP
.PP
The subnet in CIDR notation. Can be specified multiple times to allocate more than one subnet for this network.
The argument order of the \fB--subnet\fP, \fB--gateway\fP and \fB--ip-range\fP options must match.
This is useful to set a static ipv4 and ipv6 subnet.

.SH EXAMPLE
.PP
Create a network with no options.

.PP
.RS

.nf
$ podman network create
podman2

.fi
.RE

.PP
Create a network named \fInewnet\fP that uses \fI192.5.0.0/16\fP for its subnet.

.PP
.RS

.nf
$ podman network create --subnet 192.5.0.0/16 newnet
newnet

.fi
.RE

.PP
Create an IPv6 network named \fInewnetv6\fP with a subnet of \fI2001:db8::/64\fP\&.

.PP
.RS

.nf
$ podman network create --subnet 2001:db8::/64 --ipv6 newnetv6
newnetv6

.fi
.RE

.PP
Create a network named \fInewnet\fP that uses \fI192.168.33.0/24\fP and defines a gateway as \fI192.168.133.3\fP\&.

.PP
.RS

.nf
$ podman network create --subnet 192.168.33.0/24 --gateway 192.168.33.3 newnet
newnet

.fi
.RE

.PP
Create a network that uses a *192.168.55.0/24** subnet and has an IP address range of \fI192.168.55.129 - 192.168.55.254\fP\&.

.PP
.RS

.nf
$ podman network create --subnet 192.168.55.0/24 --ip-range 192.168.55.128/25
podman5

.fi
.RE

.PP
Create a network with a static ipv4 and ipv6 subnet and set a gateway.

.PP
.RS

.nf
$ podman network create --subnet 192.168.55.0/24 --gateway 192.168.55.3 --subnet fd52:2a5a:747e:3acd::/64 --gateway fd52:2a5a:747e:3acd::10
podman4

.fi
.RE

.PP
Create a Macvlan based network using the host interface eth0. Macvlan networks can only be used as root.

.PP
.RS

.nf
$ sudo podman network create -d macvlan -o parent=eth0 --subnet 192.5.0.0/16 newnet
newnet

.fi
.RE

.SH SEE ALSO
.PP
\fBpodman(1)\fP, \fBpodman-network(1)\fP, \fBpodman-network-inspect(1)\fP, \fBpodman-network-ls(1)\fP, \fBcontainers.conf(5)\fP

.SH HISTORY
.PP
August 2021, Updated with the new network format by Paul Holzinger pholzing@redhat.com
\[la]mailto:pholzing@redhat.com\[ra]

.PP
August 2019, Originally compiled by Brent Baude bbaude@redhat.com
\[la]mailto:bbaude@redhat.com\[ra]
