Use a private subnet for the tutorial network - #12
Merged
Merged
Conversation
SUBNET was 182.18.1.0/24, which is public address space allocated to APNIC - not a private range. Every other NGSI-LD tutorial hardcodes 172.18.1.0/24 in docker-compose/common.yml; this is the only one that parameterises the subnet. The effect is that the stack appears to start correctly and is then unreachable from the host: docker publishes the port, the container reports healthy, and a request to localhost:1026 TIMES OUT rather than being refused, because the container's address (182.18.1.8) is a real internet host as far as the kernel's routing is concerned. It also occupies 256 public addresses on the machine running it. With 172.18.1.0/24 the tutorial runs.
jason-fox
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUBNETin.envis182.18.1.0/24, which is public address space allocated to APNIC — not a private range. Every other NGSI-LD tutorial hardcodes172.18.1.0/24indocker-compose/common.yml; this is the only one that parameterises the subnet.Why it's hard to spot
The stack appears to start perfectly:
./services coraineexits 0docker psshows0.0.0.0:1026->1026/tcpand then nothing answers:
A bound port that accepts and never replies, because as far as the host's routing is concerned
182.18.1.8is a machine on the internet.It also occupies 256 public addresses on whatever machine runs the tutorial.
The change
One line:
SUBNET=172.18.1.0/24, matching every other tutorial. With it, the tutorial runs.Found while running all sixteen NGSI-LD tutorials against a different NGSI-LD broker; this was the only one that could not be started at all.