Page 1 of 1

[Help] assign docker dedicated DHCP ip

Posted: 28 Nov 2025, 00:45
by samw5
I'm trying to figure out if it would be possible to assign a docker container a dedicated ip on my DHCP subnet.
I know I can bridge it but I have router rule base routing that I need to apply to the docker container so need it to have a lan ip. I would rather not waste a dedicated nas port to use a host ip for this.

I hope this makes sense.

Re: [Help] assign docker dedicated DHCP ip

Posted: 28 Nov 2025, 09:19
by CursaYang
You can create a macvlan network and then specify the network and IP when starting the container. Docker cannot automatically obtain an IP from the DHCP server (router) directly, so you need to manually specify an IP and exclude this IP from the router's address pool.

Re: [Help] assign docker dedicated DHCP ip

Posted: 29 Nov 2025, 02:24
by samw5
Perfect that will work!