network: add support for MACVLAN source mode

Add support for creating a MACVLAN interface in "source" mode by
specifying Mode=source in the [MACVLAN] section of a .netdev file.

A list of allowed MAC addresses for the corresponding MACVLAN can also
be specified with the SourceMACAddress= option of the [MACVLAN] section.

An example .netdev file:

    [NetDev]
    Name=macvlan0
    Kind=macvlan
    MACAddress=02:DE:AD:BE:EF:00

    [MACVLAN]
    Mode=source
    SourceMACAddress=02:AB:AB:AB:AB:01 02:CD:CD:CD:CD:01
    SourceMACAddress=02:EF:EF:EF:EF:01

The same keys can also be specified in [MACVTAP] for MACVTAP kinds of
interfaces, with the same semantics.
This commit is contained in:
Alvin Šipraga
2020-07-08 18:01:52 +02:00
parent 24e2494407
commit 0d0de133f0
8 changed files with 72 additions and 2 deletions
@@ -6,6 +6,7 @@ Id=
GVRP=
[MACVLAN]
Mode=
SourceMACAddress=
[WireGuard]
ListenPort=
PrivateKey=
@@ -14,6 +15,7 @@ FwMark=
FirewallMark=
[MACVTAP]
Mode=
SourceMACAddress=
[Match]
Architecture=
Host=