3 ms·
I wish there was a netblock reserved for packets that never leave a physical (or virtual) host, that could be used for the default internal network for things l
by derekp7 8y ago
I wish there was a netblock reserved for packets that never leave a physical (or virtual) host, that could be used for the default internal network for things like Docker. In my case, Docker defaulted to 172.17.0.0/16, which happened to conflict with one of the IP ranges for my wing of the building at work.
I've resorted to using RFC 5737 (test-net-1 through 3) IP ranges for this purpose, even though that isn't what they are designed for.
- y4mi 8y agoUuh, 127.0.0.1 never leaves the physical machine. It's also a full subnet, so 127.0.0.254 would work as well. Dockers main usecase just isn't purely internal, do using that ip range wouldn't make any sense
- y4mi 8y agoToo late to edit my message, so I'll use a response instead. Docker rebinds the 127 network to each container, so you cant - by default - communicate through these IP Addresses. An easy fix could be to just let the container use the hosts network stack (so, not network type: bridge). After that, you can bind the daemons to specific IP Addresses in the subnet - i.e. 127.0.0.2:3306 DB1 127.0.0.3:3306 DB2 and they'll be able to communicate directly. But as mentioned before: this is not the primary usecase for docker, so its cumbersome to use.
- srj 8y ago127/8 exists for this purpose. IPv6 funny enough went conservative here and only has a single address, ::1/128.