Skip to content

Document host_ipv4 + host_ipv6 #21959

Closed
Closed
@polarathene

Description

@polarathene

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

I can't find what I'm looking for

Description

Neither of these appear to have public documentation, but the feature can be useful to discover:

On a project I maintain, I've had several users reach out about deploying on hosts with multiple IP addresses and being stuck with which outbound IP is used via bridge networks. Recently one contributor shared this solution which I've verified external hosts receive connections from the configured host IP to route outbound traffic from the bridge through.

This was important for containers running mail servers where DNS checks are performed by the receiving party, notably important for rDNS.

NOTE: There is a section for a related setting host_binding_ipv4 which handles inbound traffic for the default IP that published ports will bind to. That is also shown as a driver options example for daemon.json config.

Location

https://docs.docker.com/engine/network/drivers/bridge

Suggestion

Add a section regarding outbound IP / SNAT for the bridge driver options host_ipv4 (Docker >= 20.10) and host_ipv6 (Docker >= v25).

I could be mistaken regarding being bridge specific, as the options don't appear to be scoped to bridge like host_binding_ipv4 is? (The driver option key is com.docker.network.host_ipv4)

According to this comment it is apparently bridge specific. Further discussion seems to suggest it is planned to support other network drivers too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions