Skip to content

docs: add network ip masquerade example#7075

Closed
lsh1215 wants to merge 1 commit into
docker:masterfrom
lsh1215:docs/13861-network-ip-masq
Closed

docs: add network ip masquerade example#7075
lsh1215 wants to merge 1 commit into
docker:masterfrom
lsh1215:docs/13861-network-ip-masq

Conversation

@lsh1215

@lsh1215 lsh1215 commented Jun 26, 2026

Copy link
Copy Markdown

What changed

Added a small docker network create example showing how to configure IP masquerading for a custom bridge network with --opt com.docker.network.bridge.enable_ip_masquerade=false.

Why

This follows up on docker/docs#13861. The existing table maps com.docker.network.bridge.enable_ip_masquerade to the --ip-masq daemon option for the default docker0 bridge, but it does not directly show the equivalent docker network create command for a custom bridge network.

Related issue status

#5599 already improved this section by clarifying that --ip-masq is a daemon option for the default docker0 bridge. This PR adds a direct example for configuring the equivalent bridge driver option when creating a custom bridge network.

If maintainers consider #5599 sufficient for docker/docs#13861, then the issue may only need a status decision rather than this follow-up change.

Validation

  • make -f docker.Makefile mddocs
  • make -f docker.Makefile yamldocs
  • git diff --check

Notes

This is a documentation-only change. It does not change Docker CLI or daemon behavior.

@lsh1215
lsh1215 marked this pull request as ready for review June 26, 2026 06:49
@lsh1215
lsh1215 requested review from a team and thaJeztah as code owners June 26, 2026 06:49
@vvoland
vvoland requested a review from docker-agent July 6, 2026 13:08
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

This is a clean, well-placed documentation addition. The new example correctly demonstrates the com.docker.network.bridge.enable_ip_masquerade option using the proper --opt flag syntax, consistent with the bridge driver options table immediately above it. Code fence style and indentation match the rest of the file.

The drafter raised a concern that omitting --subnet could mislead readers into creating a network with broken outbound connectivity. The verifier dismissed this: the file already uses minimal examples without --subnet elsewhere (e.g. line 44), the example demonstrates a specific option rather than providing a production-ready setup, and disabling masquerade is valid in multiple topologies (e.g. when the host is the router). No in-scope bugs were found.

@lsh1215

lsh1215 commented Jul 10, 2026

Copy link
Copy Markdown
Author

Friendly ping 🙂 Just checking in on this one — it's a small docs-only change (adding an IP-masquerade example to network create). All CI checks are green except validate-milestone, which needs a maintainer to set the milestone.

@thaJeztah whenever you have a spare moment, could you take a look? No rush at all, and happy to rebase or adjust if anything's needed. Thanks! 🙏

Comment on lines +165 to +175
To configure IP masquerading for a custom `bridge` network, use the
`com.docker.network.bridge.enable_ip_masquerade` option. For example, to create
a custom bridge network with IP masquerading disabled:

```console
$ docker network create \
--driver bridge \
--opt com.docker.network.bridge.enable_ip_masquerade=false \
no-masq-network
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right place/format for this. We already explain the option in the table above. I think what's missing if anything is to explain how these options are set. The introduction to the section currently reads:

When creating a custom bridge network, the following additional options can be passed.

But we don't say how, i.e.

When creating a custom bridge network, you can configure driver options using the --opt flag. The following table lists all configurable driver options for bridge networks: ...

And then below the table we could have a small example showing the exact syntax:

For example, to create a custom bridge network with IP masquerading disabled:

$ docker network create \
    --driver bridge \
    --opt com.docker.network.bridge.enable_ip_masquerade=false \
    no-masq-network

Reword the "Bridge driver options" section to note that driver options are configured with the --opt flag, and reframe the IP masquerade snippet as a generic example of setting a bridge driver option.

Signed-off-by: sanghun <vitash1215@gmail.com>
@lsh1215 lsh1215 closed this Jul 22, 2026
@lsh1215
lsh1215 force-pushed the docs/13861-network-ip-masq branch from 76e0b76 to f48c29c Compare July 22, 2026 16:27
@lsh1215

lsh1215 commented Jul 22, 2026

Copy link
Copy Markdown
Author

Thanks @dvdksn, that makes sense. I've reworked the section along the lines you suggested (force-pushed just now):

  • The intro now explains that driver options are set with the --opt flag (I kept the existing note about the equivalent docker0/daemon flags, since the table's second column relies on that context).
  • Dropped the redundant enable_ip_masquerade paragraph, so the example now sits directly below the table as a general illustration of setting a bridge driver option.

Regenerated the docs (make mddocs / make yamldocs) — no changes outside the reworked prose. Happy to tweak the wording further if you'd prefer.

@lsh1215

lsh1215 commented Jul 22, 2026

Copy link
Copy Markdown
Author

Reopened as #7117 — this PR couldn't be reopened after the branch was updated while closed. Continuing the review there (same change, addressing @dvdksn's feedback). Apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants