I have a single home server with a single NIC. I intend to run numerous services – some will be internet exposed, some will not.
For the sake of simplicity, let’s say I have a:
- a host called
serverwith oneeth0 -
dmzcontainer that’ll accept traffic from the internet (using a port forward on my router) -
trustcontainer that’ll just accept traffic from other devices on my home network
The way I see it, I have two options:
- have both containers running on two different bridged networks (so the two containers can’t talk to each other) and use port-mapping/publish to route traffic from my host to the docker container and:
- open
:1234and:6789ofeth0ofserver - my router port forwards
WAN:443(from internet) toserver:1234and docker forwards:1234to:2345of thedmzcontainer - docker forwards
:6789to:7890of thetrustcontainer
- open
- use
macvlan:- create a 802.1Q trunk on
eth0ofserverthen - create
macvlannetworks with IP ranges that match my router such that containers created in these networks have IPs from those VLANs that my router can see:-
eth0.10fornetwork_dmz -
eth0.20fornetwork_trust
-
- open ports on the individual VLANs:
-
:1234oneth0.10 -
:6789oneth0.20
-
- port forward
WAN:443to the IP ofdmzthat is ineth0.10VLAN
- create a 802.1Q trunk on
I am having a hard time determining if it is worth it to go through all the effort to use macvlan?