Re-Structured Documentation
This commit is contained in:
22
Networking/Docker/Creating a MACVLAN Sub-Interface.md
Normal file
22
Networking/Docker/Creating a MACVLAN Sub-Interface.md
Normal file
@ -0,0 +1,22 @@
|
||||
**Purpose**:
|
||||
You may find that you only have one network adapter on a server / VM and need to have multiple virtual networks associated with it. For example, Home Assistant exists on the `192.168.3.0/24` network but it needs to also access devices on the `192.168.4.0/24` surveillance network. To facilitate this, we will make a MACVLAN Sub-Interface. This will make a virtual interface that is parented to the actual physical interface.
|
||||
|
||||
!!! info "Assumptions"
|
||||
It is assumed that you are running Rocky Linux (or CentOS / RedHat).
|
||||
|
||||
## Create the Temporary 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
|
||||
```
|
||||
|
||||
## 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.
|
8
Networking/Docker/Docker Networking.md
Normal file
8
Networking/Docker/Docker Networking.md
Normal file
@ -0,0 +1,8 @@
|
||||
### Configure Docker Network
|
||||
We want to use a dedicated subnet / network specifically for containers, so they don't trample over the **SERVER** and **LAN** networks. If you are unsure of the name of the network adapter, in this case `eth0`, just type `ipaddr` in the terminal to list the network interfaces to locate it.
|
||||
```
|
||||
docker network create -d macvlan --subnet=192.168.5.0/24 --gateway=192.168.5.1 -o parent=eth0 docker_network
|
||||
```
|
||||
|
||||
!!! note
|
||||
Be sure to replace `eth0` with the correct interface name using `ip addr` in the terminal. e.g. It may appear as something else like `ens18`, etc. If the interface doesn't exist, Docker will produce an error complaining about it.
|
Reference in New Issue
Block a user