Community Solution

Give a ZimaOS Container Its Own LAN IP: Macvlan Requirements and Limits

A September 2025 discussion identified Docker macvlan as the path to a LAN-visible container IP, but the community command example contained copied punctuation errors and did not produce a confirmed working ZimaOS app setup.

A ZimaOS user wanted a Docker container to have its own address on the same LAN as the server. IceWhale explained that the default bridge already gives the container an internal address, while a LAN-visible address generally requires macvlan.

The long community command example was never confirmed working by the original poster. Later replies found copied smart quotes and single-dash options, and another user still could not attach the installed app. This page therefore explains the architecture and safe plan without presenting that unverified command block as a ZimaOS recipe.

Bridge IP and LAN IP Are Different Goals

Mode Container identity Typical access
Default bridge Private Docker address Use the ZimaOS host address plus a published port
Host Shares the host network namespace No separate container address
Macvlan Own Layer-2 identity and LAN address Other LAN devices can contact it directly

Most applications do not need a separate LAN IP. Published ports on the ZimaOS host are simpler and avoid extra Layer-2 requirements.

Plan Macvlan Before Creating It

  • Identify the real parent interface used for LAN traffic.
  • Record the subnet and gateway.
  • Reserve an address outside the router's DHCP pool or create a non-overlapping managed range.
  • Check whether the switch, Wi-Fi bridge, hypervisor, or USB NIC permits multiple MAC addresses.
  • Back up the app Compose definition and confirm local console access.

Docker's official macvlan documentation warns that macvlan containers cannot communicate directly with the host by default because of a Linux kernel restriction.

Expect Host-to-Container Isolation

Other devices on the LAN may reach the container while ZimaOS itself cannot. This can break reverse proxies, health checks, storage services, or apps that expect to call the container from the host. Docker documents two advanced options: attach the container to an additional bridge network, or create a matching macvlan interface on the host.

Why the Copied Commands Were Unreliable

The community post used typographic quotation marks and en dashes instead of ASCII quotes and double-hyphen options. Copying from Windows preserved those characters, causing shell and Docker parsing problems. A later participant corrected this but still could not make an already installed ZimaOS app start on the new network.

Commands also hardcoded network data and assumed a parent interface. Running them on the wrong subnet can create address conflicts or cut off access. For that reason, use Docker's current examples and adapt them only after validating each value.

Does Macvlan Automatically Pull a DHCP Address?

Docker's built-in macvlan workflow normally uses Docker IP address management, not a router lease requested by every container. Define a safe subnet and IP range, then assign or let Docker allocate addresses within that range. Do not overlap the router's DHCP pool unless the router reserves those addresses.

ZimaOS UI Boundary in the Source Thread

The original poster did not find a working GUI switch for attaching an installed app to macvlan, and another user proposed it as a feature request. Exporting, editing, and reimporting Compose may create a separately managed stack; upgrades and App Store controls may no longer behave like the original template.

ZimaOS Container IP FAQ

Does a bridge container already have its own IP?

Yes, but it is normally an internal Docker address rather than a first-class LAN address.

Can ZimaOS reach a macvlan container directly?

Not by default. Docker documents host isolation as a kernel restriction.

Should I copy the commands from the source thread?

No. They contained typographic character errors and were not confirmed as a successful ZimaOS app workflow.