Make 'internal' bridge networks accessible from host#47356
Make 'internal' bridge networks accessible from host#47356thaJeztah merged 1 commit intomoby:masterfrom
Conversation
Prior to release 25.0.0, the bridge in an internal network was assigned an IP address - making the internal network accessible from the host, giving containers on the network access to anything listening on the bridge's address (or INADDR_ANY on the host). This change restores that behaviour. It does not restore the default route that was configured in the container, because packets sent outside the internal network's subnet have always been dropped. So, a 'connect()' to an address outside the subnet will still fail fast. Signed-off-by: Rob Murray <rob.murray@docker.com>
corhere
left a comment
There was a problem hiding this comment.
While it may not be possible to test in CI that the IPv6 internet is unreachable (GH Actions runners don't have IPv6 connectivity?!) could you please test manually and add it to the verification steps?
Done ... I considered adding an IPv6 test to ping an external address, but decided against because its "network unreachable" wouldn't really mean much - and this change doesn't actually touch IPv6, it wasn't sealed-off in the same way anyway. |
Devil's advocate: it'd be meaningful if someone were to run the test in an environment with IPv6 connectivity and the test fails, and be future-proofing for a time when IPv6 connectivity does become available in CI. A test that passes in CI but fails when run locally is a debugging nightmare so if we were to write an automated test for IPv6 isolation I think it should be done in its own test separate from IPv4 which gets skipped if the IPv6 target can't be pinged from the host. Just something to think about for a nice to have follow-up, maybe, if you want.
I know; I just figure we should verify that the IPv6 behaviour matches up whenever we change IPv4 behaviour, given how notoriously inconsistent libnetwork's behaviour has been historically between the two address families. |
- What I did
Prior to release 25.0.0 (#46603), the bridge in an internal network was assigned an IP address - making the internal network accessible from the host, giving containers on the network access to anything listening on the bridge's address (or INADDR_ANY on the host).
This change restores that behaviour. It does not restore the default route that was configured in the container, because packets sent outside the internal network's subnet have always been dropped. So, a 'connect()' to an address outside the subnet will still fail fast.
Fixes #47329
Fixes
- How I did it
Partly reverted changes in #46603
- How to verify it
New integration test.
Also ...
For IPv6 - which isn't directly affected by this change ...
- Description for the changelog
Restore IP connectivity between the host and containers on an internal bridge network.