From d28ab7ff7c6bf1a8ccc1d033e0564749beeedfac Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 6 Feb 2025 17:22:19 -0700 Subject: [PATCH] Update Networking/Docker/Creating a MACVLAN Sub-Interface.md --- .../Docker/Creating a MACVLAN Sub-Interface.md | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Networking/Docker/Creating a MACVLAN Sub-Interface.md b/Networking/Docker/Creating a MACVLAN Sub-Interface.md index f116ce0..14627bd 100644 --- a/Networking/Docker/Creating a MACVLAN Sub-Interface.md +++ b/Networking/Docker/Creating a MACVLAN Sub-Interface.md @@ -4,19 +4,16 @@ You may find that you only have one network adapter on a server / VM and need to !!! info "Assumptions" It is assumed that you are running Rocky Linux (or CentOS / RedHat). -## Create the Temporary Interface +## Create the Permanent Interface You will begin with making a new interface, it will have the name `macvlan0`. ``` sh -ip link add macvlan0 link eno1 type macvlan mode bridge -ip addr add 192.168.4.100/24 dev macvlan0 -ip link set macvlan0 up +nmcli connection add type macvlan ifname macvlan0 dev ens18 mode bridge ipv4.method manual ipv4.addresses 192.168.4.100/24 +nmcli connection up macvlan0 +nmcli connection show ``` ## 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` ``` sh docker network create -d macvlan --subnet=192.168.4.0/24 --gateway=192.168.4.1 -o parent=macvlan0 surveillance_network -``` - -!!! warning "Not Reboot-Persistent Yet" - Unfortunately due to a lack of documentation yet, I do not have a permanent configuration change to make this persistent, as such, you will need to re-run the commands above (at least the "Temporary Interface" section) in order to get it operational again after a system reboot. \ No newline at end of file +``` \ No newline at end of file