network create: add --interface-name

Allow users to customize the network_interface option is the network
config. For bridge this allows users to change the bridge name and for
maclvan it will be the same as `--opt parent=...`.
However the main reason for this option is to allow netavark plugins to
make use of it. I demoed the host-device plugin which makes use of this
as an example. While we could let users set them via --opt it is more
natural to just use the field which is designed for that purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-04-04 17:39:51 +02:00
parent 6f2a61a156
commit ed99a979ce
5 changed files with 68 additions and 25 deletions

View File

@ -9,7 +9,7 @@ podman\-network-create - Create a Podman network
## DESCRIPTION
Create a network configuration for use with Podman. By default, Podman creates a bridge connection.
A *Macvlan* connection can be created with the *-d macvlan* option. A parent device for macvlan can
be designated with the *-o parent=`<device>`* option.
be designated with the *-o parent=`<device>`* or *--network-interface=`<device>`* option.
If no options are provided, Podman will assign a free subnet and name for the network.
@ -48,6 +48,12 @@ The argument order of the **--subnet**, **--gateway** and **--ip-range** options
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
#### **--interface-name**=*name*
This option maps the the *network_interface* option in the network config, see **podman network inspect**.
Depending on the driver this can have different effects, for `bridge` it will be the bridge interface name.
For `macvlan` and `ipvlan` this will be the parent device on the host. It is the same as `--opt parent=...`.
#### **--internal**
Restrict external access of this network. Note when using this option, the dnsname plugin will be