Update Networking/Docker/Creating a MACVLAN Sub-Interface.md
This commit is contained in:
@ -7,13 +7,13 @@ You may find that you only have one network adapter on a server / VM and need to
|
|||||||
## Create the Permanent Interface
|
## Create the Permanent Interface
|
||||||
You will begin with making a new interface, it will have the name `macvlan0`.
|
You will begin with making a new interface, it will have the name `macvlan0`.
|
||||||
``` sh
|
``` sh
|
||||||
nmcli connection add type macvlan ifname macvlan0 dev ens18 mode bridge ipv4.method manual ipv4.addresses 192.168.4.100/24
|
nmcli connection add type macvlan ifname surveillance dev ens18 mode bridge ipv4.method manual ipv4.addresses 192.168.4.100/24
|
||||||
nmcli connection up macvlan0
|
nmcli connection up macvlan-surveillance
|
||||||
nmcli connection show
|
nmcli connection show
|
||||||
```
|
```
|
||||||
|
|
||||||
## Bind a Docker Network to the Sub-Interface
|
## Bind a Docker Network to the Sub-Interface
|
||||||
Now you need to run the following command to allow docker to use this interface for the `surveillance_network`
|
Now you need to run the following command to allow docker to use this interface for the `surveillance_network`
|
||||||
``` sh
|
``` sh
|
||||||
docker network create -d macvlan --subnet=192.168.4.0/24 --gateway=192.168.4.1 -o parent=macvlan0 surveillance_network
|
docker network create -d macvlan --subnet=192.168.4.0/24 --gateway=192.168.4.1 -o parent=surveillance surveillance_network
|
||||||
```
|
```
|
Reference in New Issue
Block a user