.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\fR\fP or \fI--network-interface=\fB\fR\fP option. .PP If no options are provided, Podman assigns a free subnet and name for the network. .PP Upon completion of creating the network, Podman displays the name of the newly added network. .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 \fBbridge\fR driver, for other drivers it is 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/etc/resolv.conf\fR is used. It can be overwritten on the container level with the \fBpodman 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 \fBbridge\fR, \fBmacvlan\fR and \fBipvlan\fR are supported. Defaults to \fBbridge\fR\&. As rootless the \fBmacvlan\fR and \fBipvlan\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 \fBnetavark_plugin_dirs\fR in \fBcontainers.conf(5)\fP under the \fB[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 \fBpodman info --format {{.Plugins.Network}}\fR\&. .PP Note that the \fBmacvlan\fR and \fBipvlan\fR drivers do not support port forwarding. Support for port forwarding with a plugin depends on the implementation of the plugin. .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 does not change the configuration of the existing one. .SS \fB--interface-name\fP=\fIname\fP .PP This option maps the \fInetwork_interface\fP option in the network config, see \fBpodman network inspect\fP\&. Depending on the driver, this can have different effects; for \fBbridge\fR, it uses the bridge interface name. For \fBmacvlan\fR and \fBipvlan\fR, it is the parent device on the host. It is the same as \fB--opt parent=...\fR\&. .SS \fB--internal\fP .PP Restrict external access of this network when using a \fBbridge\fR network. Note when using the CNI backend DNS will be automatically disabled, see \fB--disable-dns\fP\&. .PP When using the \fBmacvlan\fR or \fBipvlan\fR driver with this option no default route will be added to the container. Because it bypasses the host network stack no additional restrictions can be set by podman and if a privileged container is run it can set a default route themselves. If this is a concern then the container connections should be blocked on your actual network gateway. .SS \fB--ip-range\fP=\fIrange\fP .PP Allocate container IP from a range. The range must be a either a complete subnet in CIDR notation or be in the \fB-\fR syntax which allows for a more flexible range compared to the CIDR subnet. 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 chooses an ipam driver automatically based on the network driver. .PP Valid values are: .RS .IP \(bu 2 \fBdhcp\fR: IP addresses are assigned from a dhcp server on the network. When using the netavark backend the \fBnetavark-dhcp-proxy.socket\fR must be enabled in order to start the dhcp-proxy when a container is started, for CNI use the \fBcni-dhcp.socket\fR unit instead. .IP \(bu 2 \fBhost-local\fR: IP addresses are assigned locally. .IP \(bu 2 \fBnone\fR: No ip addresses are assigned to the interfaces. .RE .PP View the driver in the \fBpodman network inspect\fP output under the \fBipam_options\fR field. .SS \fB--ipv6\fP .PP Enable IPv6 (Dual Stack) networking. If no subnets are given, it allocates 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 \fBmtu\fR, \fBmetric\fR, \fBno_default_route\fR and options. .RS .IP \(bu 2 \fBmtu\fR: Sets the Maximum Transmission Unit (MTU) and takes an integer value. .IP \(bu 2 \fBmetric\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. .IP \(bu 2 \fBno_default_route\fR: If set to 1, Podman will not automatically add a default route to subnets. Routes can still be added manually by creating a custom route using \fB--route\fR\&. .RE .PP Additionally the \fBbridge\fR driver supports the following options: .RS .IP \(bu 2 \fBvlan\fR: This option assign VLAN tag and enables vlan_filtering. Defaults to none. .IP \(bu 2 \fBisolate\fR: This option isolates networks by blocking traffic between those that have this option enabled. .IP \(bu 2 \fBcom.docker.network.bridge.name\fR: This option assigns the given name to the created Linux Bridge .IP \(bu 2 \fBcom.docker.network.driver.mtu\fR: Sets the Maximum Transmission Unit (MTU) and takes an integer value. .IP \(bu 2 \fBvrf\fR: This option assigns a VRF to the bridge interface. It accepts the name of the VRF and defaults to none. Can only be used with the Netavark network backend. .RE .PP The \fBmacvlan\fR and \fBipvlan\fR driver support the following options: .RS .IP \(bu 2 \fBparent\fR: The host device which is used for the macvlan interface. Defaults to the default route interface. .IP \(bu 2 \fBmode\fR: This option sets the specified ip/macvlan mode on the interface. .RS .IP \(bu 2 Supported values for \fBmacvlan\fR are \fBbridge\fR, \fBprivate\fR, \fBvepa\fR, \fBpassthru\fR\&. Defaults to \fBbridge\fR\&. .IP \(bu 2 Supported values for \fBipvlan\fR are \fBl2\fR, \fBl3\fR, \fBl3s\fR\&. Defaults to \fBl2\fR\&. .RE .RE .PP Additionally the \fBmacvlan\fR driver supports the \fBbclim\fR option: .RS .IP \(bu 2 \fBbclim\fR: Set the threshold for broadcast queueing. Must be a 32 bit integer. Setting this value to \fB-1\fR disables broadcast queueing altogether. .RE .SS \fB--route\fP=\fIroute\fP .PP A static route in the format \fB,,\fR\&. This route will be added to every container in this network. Only available with the netavark backend. It can be specified multiple times if more than one static route is desired. .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. .EX $ podman network create podman2 .EE .PP Create a network named \fInewnet\fP that uses \fI192.5.0.0/16\fP for its subnet. .EX $ podman network create --subnet 192.5.0.0/16 newnet newnet .EE .PP Create an IPv6 network named \fInewnetv6\fP with a subnet of \fI2001:db8::/64\fP\&. .EX $ podman network create --subnet 2001:db8::/64 --ipv6 newnetv6 newnetv6 .EE .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\&. .EX $ podman network create --subnet 192.168.33.0/24 --gateway 192.168.33.3 newnet newnet .EE .PP Create a network that uses a \fI192.168.55.0/24\fP subnet and has an IP address range of \fI192.168.55.129 - 192.168.55.254\fP\&. .EX $ podman network create --subnet 192.168.55.0/24 --ip-range 192.168.55.128/25 podman5 .EE .PP Create a network with a static ipv4 and ipv6 subnet and set a gateway. .EX $ 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 .EE .PP Create a network with a static subnet and a static route. .EX $ podman network create --subnet 192.168.33.0/24 --route 10.1.0.0/24,192.168.33.10 newnet .EE .PP Create a network with a static subnet and a static route without a default route. .EX $ podman network create --subnet 192.168.33.0/24 --route 10.1.0.0/24,192.168.33.10 --opt no_default_route=1 newnet .EE .PP Create a Macvlan based network using the host interface eth0. Macvlan networks can only be used as root. .EX $ sudo podman network create -d macvlan -o parent=eth0 --subnet 192.5.0.0/16 newnet newnet .EE .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]