1podman-network-create(1)    General Commands Manual   podman-network-create(1)
2
3
4

NAME

6       podman-network-create - Create a Podman network
7
8

SYNOPSIS

10       podman network create  [options] [name]
11
12

DESCRIPTION

14       Create  a network configuration for use with Podman. By default, Podman
15       creates a bridge connection.  A Macvlan connection can be created  with
16       the  -d  macvlan  option.  A parent device for macvlan or ipvlan can be
17       designated with the -o parent=<device> or  --network-interface=<device>
18       option.
19
20
21       If  no  options are provided, Podman assigns a free subnet and name for
22       the network.
23
24
25       Upon completion of creating the network, Podman displays  the  name  of
26       the newly added network.
27
28
29       NOTE:  The  support for the network name "pasta" is deprecated and will
30       be removed in the next major release because it is used  as  a  special
31       network mode in podman run/create --network.
32
33

OPTIONS

35   --disable-dns
36       Disables  the DNS plugin for this network which if enabled, can perform
37       container to container name resolution. It is only supported  with  the
38       bridge driver, for other drivers it is always disabled.
39
40
41   --dns=ip
42       Set  network-scoped DNS resolver/nameserver for containers in this net‐
43       work. If not set, the host servers from /etc/resolv.conf is  used.   It
44       can  be  overwritten  on the container level with the podman run/create
45       --dns option. This option can be specified multiple times to  set  more
46       than one IP.
47
48
49   --driver, -d=driver
50       Driver  to manage the network. Currently bridge, macvlan and ipvlan are
51       supported. Defaults to bridge.  As  rootless  the  macvlan  and  ipvlan
52       driver  have  no access to the host network interfaces because rootless
53       networking requires a separate network namespace.
54
55
56       The netavark backend allows the use of so called netavark plugins,  see
57       the  plugin-API.md documentation in netavark. The binary must be placed
58       in a specified directory so podman can discover it, this list is set in
59       netavark_plugin_dirs in containers.conf(5) under the [network] section.
60
61
62       The  name  of the plugin can then be used as driver to create a network
63       for your plugin.  The list of all supported drivers and plugins can  be
64       seen with podman info --format {{.Plugins.Network}}.
65
66
67   --gateway=ip
68       Define a gateway for the subnet. To provide a gateway address, a subnet
69       option is required. Can be specified multiple times.  The argument  or‐
70       der of the --subnet, --gateway and --ip-range options must match.
71
72
73   --ignore
74       Ignore  the  create request if a network with the same name already ex‐
75       ists instead of failing.  Note, trying to create a network with an  ex‐
76       isting  name and different parameters does not change the configuration
77       of the existing one.
78
79
80   --interface-name=name
81       This option maps the network_interface option in  the  network  config,
82       see  podman  network  inspect.   Depending on the driver, this can have
83       different effects; for bridge, it uses the bridge interface name.   For
84       macvlan and ipvlan, it is the parent device on the host. It is the same
85       as --opt parent=....
86
87
88   --internal
89       Restrict external access of this network when using a  bridge  network.
90       Note when using the CNI backend DNS will be automatically disabled, see
91       --disable-dns.
92
93
94       When using the macvlan or ipvlan driver with  this  option  no  default
95       route  will  be  added  to the container.  Because it bypasses the host
96       network stack no additional restrictions can be set by podman and if  a
97       privileged  container  is run it can set a default route themselves. If
98       this is a concern then the container connections should be  blocked  on
99       your actual network gateway.
100
101
102   --ip-range=range
103       Allocate  container  IP from a range. The range must be a either a com‐
104       plete subnet in CIDR notation or be  in  the  <startIP>-<endIP>  syntax
105       which  allows  for  a  more flexible range compared to the CIDR subnet.
106       The ip-range option must be used with a subnet option. Can be specified
107       multiple  times.   The  argument  order  of the --subnet, --gateway and
108       --ip-range options must match.
109
110
111   --ipam-driver=driver
112       Set the ipam driver (IP Address Management  Driver)  for  the  network.
113       When  unset  podman  chooses  an ipam driver automatically based on the
114       network driver.
115
116
117       Valid values are:
118
119
120dhcp: IP addresses are assigned from a dhcp server on the net‐
121                work.  This driver is not yet supported with netavark. For CNI
122                the dhcp plugin needs to be activated before.
123
124host-local: IP addresses are assigned locally.
125
126none: No ip addresses are assigned to the interfaces.
127
128
129
130       View the driver in the podman network inspect output under the ipam_op‐
131       tions field.
132
133
134   --ipv6
135       Enable  IPv6 (Dual Stack) networking. If no subnets are given, it allo‐
136       cates an ipv4 and an ipv6 subnet.
137
138
139   --label=label
140       Set metadata for a network (e.g., --label mykey=value).
141
142
143   --opt, -o=option
144       Set driver specific options.
145
146
147       All drivers accept the mtu, metric, no_default_route and options.
148
149
150mtu: Sets the Maximum Transmission Unit (MTU) and takes an in‐
151                teger value.
152
153metric  Sets the Route Metric for the default route created in
154                every container joined to this network. Accepts a positive in‐
155                teger  value. Can only be used with the Netavark network back‐
156                end.
157
158no_default_route: If set to 1, Podman will  not  automatically
159                add a default route to subnets. Routes can still be added man‐
160                ually by creating a custom route using --route.
161
162
163
164       Additionally the bridge driver supports the following options:
165
166
167vlan: This option assign VLAN tag and enables  vlan_filtering.
168                Defaults to none.
169
170isolate: This option isolates networks by blocking traffic be‐
171                tween those that have this option enabled.
172
173com.docker.network.bridge.name: This option assigns the  given
174                name to the created Linux Bridge
175
176com.docker.network.driver.mtu:  Sets  the Maximum Transmission
177                Unit (MTU) and takes an integer value.
178
179
180
181       The macvlan and ipvlan driver support the following options:
182
183
184parent: The host device which is used for the  macvlan  inter‐
185                face. Defaults to the default route interface.
186
187mode:  This  option  sets the specified ip/macvlan mode on the
188                interface.
189
190                • Supported values for  macvlan  are  bridge,  private,  vepa,
191                  passthru. Defaults to bridge.
192
193                • Supported values for ipvlan are l2, l3, l3s. Defaults to l2.
194
195
196
197
198
199       Additionally the macvlan driver supports the bclim option:
200
201
202bclim:  Set the threshold for broadcast queueing. Must be a 32
203                bit integer. Setting  this  value  to  -1  disables  broadcast
204                queueing altogether.
205
206
207
208   --route=route
209       A  static  route  in  the  format <destination in CIDR notation>,<gate‐
210       way>,<route metric (optional)>. This route will be added to every  con‐
211       tainer  in  this  network. Only available with the netavark backend. It
212       can be specified multiple times if more than one static  route  is  de‐
213       sired.
214
215
216   --subnet=subnet
217       The  subnet  in CIDR notation. Can be specified multiple times to allo‐
218       cate more than one subnet for this network.  The argument order of  the
219       --subnet,  --gateway and --ip-range options must match.  This is useful
220       to set a static ipv4 and ipv6 subnet.
221
222

EXAMPLE

224       Create a network with no options.
225
226
227              $ podman network create
228              podman2
229
230
231
232       Create a network named newnet that uses 192.5.0.0/16 for its subnet.
233
234
235              $ podman network create --subnet 192.5.0.0/16 newnet
236              newnet
237
238
239
240       Create an IPv6 network named newnetv6 with a subnet of 2001:db8::/64.
241
242
243              $ podman network create --subnet 2001:db8::/64 --ipv6 newnetv6
244              newnetv6
245
246
247
248       Create a network named newnet that uses 192.168.33.0/24 and  defines  a
249       gateway as 192.168.133.3.
250
251
252              $ podman network create --subnet 192.168.33.0/24 --gateway 192.168.33.3 newnet
253              newnet
254
255
256
257       Create  a  network that uses a 192.168.55.0/24 subnet and has an IP ad‐
258       dress range of 192.168.55.129 - 192.168.55.254.
259
260
261              $ podman network create --subnet 192.168.55.0/24 --ip-range 192.168.55.128/25
262              podman5
263
264
265
266       Create a network with a static ipv4 and ipv6 subnet and set a gateway.
267
268
269              $ 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
270              podman4
271
272
273
274       Create a network with a static subnet and a static route.
275
276
277              $ podman network create --subnet 192.168.33.0/24 --route 10.1.0.0/24,192.168.33.10 newnet
278
279
280
281       Create a network with a static subnet and a static route without a  de‐
282       fault route.
283
284
285              $ 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
286
287
288
289       Create  a  Macvlan based network using the host interface eth0. Macvlan
290       networks can only be used as root.
291
292
293              $ sudo podman network create -d macvlan -o parent=eth0 --subnet 192.5.0.0/16 newnet
294              newnet
295
296
297

SEE ALSO

299       podman(1),  podman-network(1),  podman-network-inspect(1),  podman-net‐
300       work-ls(1), containers.conf(5)
301
302

HISTORY

304       August  2021,  Updated  with  the  new network format by Paul Holzinger
305       pholzing@redhat.com ⟨mailto:pholzing@redhat.com⟩
306
307
308       August 2019,  Originally  compiled  by  Brent  Baude  bbaude@redhat.com
309       ⟨mailto:bbaude@redhat.com⟩
310
311
312
313                                                      podman-network-create(1)
Impressum