4 ms·
What are the use cases for it beyond the regular .1 address that you dont get from ::1?
by boredatoms 2y ago
What are the use cases for it beyond the regular .1 address that you dont get from ::1?
- o11c 2y agoIt's very useful for cooperatively pretending that a single machine is actually a network of machines, without all the madness of network namespaces. Basically every server program ever supports the notion of "which IP address am I supposed to bind to?" Normally the answer is either "localhost" or "whatever my LAN or WAN address is, for a particular interface". And specifying this (both for servers and for clients) is much less effort than replacing all the standard-ish ports with ad-hoc ones.
- Spivak 2y agoI love this feature so much when jumping back and forth between two projects that when devving expect exclusive control of postgres. All I have to do is set the bind address for one .1 and the other .2 and all is good.
- akdev1l 2y agoYou can literally do the same thing with IPv6. Just assign multiple IPv6 to your loopback interface and everything will work as expected. You can use either private IPv6 or even link-local IPv6 range. There’s no need to waste thousands of addresss on this use case.
- paulddraper 2y ago> waste thousands Yeah would hate to run out
- o11c 2y agoWhich is configuration that's requires arcane invocations and permissions I might not have. As opposed to IPv4, where everything Just Works™.
- eqvinox 2y ago…until it doesn't, when something looks at the configured addresses. The "other" addresses in 127.0/8 will easily have weird behavior in nontrivial setups.
- Siyo 2y agoI wish that were true. MacOS for example only assigns 127.0.0.1/32. You have to assign extra IPs manually, the same way you would on IPv6.
- procaryote 2y agothat is a mac problem, not an ipv4 problem. The mac does a lot of pretty stupid things
- deleted 2y ago[deleted]
- selfhoster 2y agoAs someone who used Windows and Linux my whole career and now am forced to use Mac for a new job; I completely agree, I was right, Mac is a very weird thing overall.
- Siyo 2y agoSame thing on FreeBSD. It's just not something you can rely on and the spec doesn't say it needs to be assigned.
- paulddraper 2y agoYeah, and I always do. Because parent is right, having multiple loopback addresses is just so nice for a lot of things.
- lostmsu 2y agoI was counting on that just a few days ago and failed spectacularly when Windows SMB client refused to connect to 127.0.0.2