Is this possible: having containers get their own IP from the router.

kiwleni

New Member
Dec 24, 2021
1
0
1
34
I'm a home user, not a trained networking expert. I use Docker to run a few containers of use, mostly as a hobby. I like running docker containers for my simple app needs, as there are a lot of containers for various uses and trying them out isn't hard, but in some cases I'd rather they acted more like VMs: showing up as separate machines on the network.
In the past I've made use of a Macvlan network to have some of my containers get their own IP on the network but it suffered from two problems:
First, the docker server was handing out those IPs instead of just having them ask the router. I was able to make this work, but it wasn't optimal.
Second, Macvlans as a feature isolate the host, so I wasn't able to get any containers on the Macvlan network to see and interact with anything on the same physical device, only other things on the network. I've heard there are ways around this, but they aren't well documented or explained, and some have warnings that
cinema hd it's ephemeral, it will need to be done again any time the machine reboots.
I'm wondering if there are ways of addressing these issues that are within my more limited abilities? Like, can I simply define the network for the Macvlan as being my whole network and tell it to use my router as the gateway instead of the docker server, effectively telling it to ask my router for an IP? Is there actually an easy to understand guide to making a permanent bridge between the macvlans and the host system? Does using ipvlan instead of Macvlan solve some of this?
 
Last edited:
I'm a home user, not a trained networking expert. I use Docker to run a few containers of use, mostly as a hobby. I like running docker containers for my simple app needs, as there are a lot of containers for various uses and trying them out isn't hard, but in some cases I'd rather they acted more like VMs: showing up as separate machines on the network.
In the past I've made use of a Macvlan network to have some of my containers get their own IP on the network but it suffered from two problems:
First, the docker server was handing out those IPs instead of just having them ask the router. I was able to make this work, but it wasn't optimal.
Second, Macvlans as a feature isolate the host, so I wasn't able to get any containers on the Macvlan network to see and interact with anything on the same physical device, only other things on the network. I've heard there are ways around this, but they aren't well documented or explained, and some have warnings that
cinemahd it's ephemeral, it will need to be done again any time the machine reboots.
I'm wondering if there are ways of addressing these issues that are within my more limited abilities? Like, can I simply define the network for the Macvlan as being my whole network and tell it to use my router as the gateway instead of the docker server, effectively telling it to ask my router for an IP? Is there actually an easy to understand guide to making a permanent bridge between the macvlans and the host system? Does using ipvlan instead of Macvlan solve some of this?
Tks you so much
 
I'm a home user, not a trained networking expert. I use Docker to run a few containers of use, mostly as a hobby. I like running docker containers for my simple app needs, as there are a lot of containers for various uses and trying them out isn't hard, but in some cases I'd rather they acted more like VMs: showing up as separate machines on the network.
In the past I've made use of a Macvlan network to have some of my containers get their own IP on the network but it suffered from two problems:
First, the docker server was handing out those IPs instead of just having them ask the router. I was able to make this work, but it wasn't optimal.
Second, Macvlans as a feature isolate the host, so I wasn't able to get any containers on the Macvlan network to see and interact with anything on the same physical device, only other things on the network. I've heard there are ways around this, but they aren't well documented or explained, and some have warnings that spotiflyer it's ephemeral, it will need to be done again any time the machine reboots.
I'm wondering if there are ways of addressing these issues that are within my more limited abilities? Like, can I simply define the network for the Macvlan as being my whole network and tell it to use my router as the gateway instead of the docker server, effectively telling it to ask my router for an IP? Is there actually an easy to understand guide to making a permanent bridge between the macvlans and the host system? Does using ipvlan instead of Macvlan solve some of this?
This is good information thanks for share.
 
Does the actual IP address matter or could you get by with a proxy manager like NGINX and use host names instead?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!