diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-01-27 15:13:55 +0100 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-01-27 16:38:39 +0100 |
commit | 6961d912061c81b7a444e7c00163ae240e318c42 (patch) | |
tree | 2949cf26bf6a516da58475064e17c932cf273eb6 /docs/source/markdown/podman-network-create.1.md | |
parent | 5659b0734c628f3f42fd976b6ce91372be3019ae (diff) | |
download | podman-6961d912061c81b7a444e7c00163ae240e318c42.tar.gz podman-6961d912061c81b7a444e7c00163ae240e318c42.tar.bz2 podman-6961d912061c81b7a444e7c00163ae240e318c42.zip |
network create: allow multiple subnets
podman network create --subnet, --gateway and --ip-range can now be
specified multiple times to join the network to more than one subnet.
This is very useful if you want to use a dual stack network and assign a
fixed ipv4 and ipv6 subnet. The order of the options is important here,
the first --gateway/--ip-range will be assigned to the first subnet and
so on.
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'docs/source/markdown/podman-network-create.1.md')
-rw-r--r-- | docs/source/markdown/podman-network-create.1.md | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/source/markdown/podman-network-create.1.md b/docs/source/markdown/podman-network-create.1.md index 8a9b2f3cf..5be0c2595 100644 --- a/docs/source/markdown/podman-network-create.1.md +++ b/docs/source/markdown/podman-network-create.1.md @@ -46,7 +46,8 @@ The `macvlan` and `ipvlan` driver support the following options: #### **--gateway** Define a gateway for the subnet. If you want to provide a gateway address, you must also provide a -*subnet* option. +*subnet* option. Can be specified multiple times. +The argument order of the **--subnet**, **--gateway** and **--ip-range** options must match. #### **--internal** @@ -56,7 +57,8 @@ automatically disabled. #### **--ip-range** Allocate container IP from a range. The range must be a complete subnet and in CIDR notation. The *ip-range* option -must be used with a *subnet* option. +must be used with a *subnet* option. Can be specified multiple times. +The argument order of the **--subnet**, **--gateway** and **--ip-range** options must match. #### **--label** @@ -64,11 +66,13 @@ Set metadata for a network (e.g., --label mykey=value). #### **--subnet** -The subnet in CIDR notation. +The subnet in CIDR notation. Can be specified multiple times to allocate more than one subnet for this network. +The argument order of the **--subnet**, **--gateway** and **--ip-range** options must match. +This is useful to set a static ipv4 and ipv6 subnet. #### **--ipv6** -Enable IPv6 (Dual Stack) networking. +Enable IPv6 (Dual Stack) networking. If not subnets are given it will allocate a ipv4 and ipv6 subnet. ## EXAMPLE @@ -102,6 +106,12 @@ $ podman network create --subnet 192.168.55.0/24 --ip-range 192.168.55.128/25 cni-podman5 ``` +Create a network with a static ipv4 and ipv6 subnet and set a gateway. +``` +$ 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 +``` + Create a Macvlan based network using the host interface eth0. Macvlan networks can only be used as root. ``` # podman network create -d macvlan -o parent=eth0 newnet |