Docker Community Forums

Share and learn in the Docker community.

Use several network interface under Debian and Docker?


I’m building a personal NAS (OMV) under Debian 10, and I’m going ton run Docker on it.

I’ve three network cards and I would like to use them to isolate some services: for example use a network interface for NAS service and another network interface for OpenVPN Container.

Is it possible to associate a Container to a specific network interface?
Do all network interface can be on the same network (different IP addresses from the same VLAN), or does it require differents VLAN (one by network interface)?

Thank you for your help and your advices :slight_smile:


Not directly. Though, you could create a macvlan (own ip + own mac) or ipvlan (own ip, shares mac of parent interface, wouldn’t use it) docker network and use a specific interface as parent interface for the network. As a result the container can use an ip of the same subnet the parent interface is in. N.B.: a macvlan parent interface is not allowed to directly communicate with it’s child interfaces and the other way arround - it can be worked arround by adding a child interface to the host directly. I am sure the forum search will yield plenty of usefull hits for macvlan.

Generaly, If somone is not clear about the concepts of docker, it usualy makes more sense to share the goal, instead of asking specifc questions about the problem of the minute. Established solutions from the vm world, might not always be the best (or even possible) solutions in the container world.