On 04/27/2018 02:52 AM, Wilhelm Schuster wrote:
Hi,
Hi,
I could gather that this is done, because Ethernet interfaces for example (in contrast to loopbacks) can go down making the addresses configured on them unavailable.
That's one of the reasons that loopbacks (or dummies) are used. Another is the fact that you can have an arbitrary interface that does not require associated hardware.
In addition, the kernel accepts packets destined to loopbacks addresses on other interfaces making these addresses available on multiple interfaces and not just the loopback.
My experience (primarily in Linux) suggests that this is the case with all interfaces by default, not just loopback (or dummy) interfaces. There are some /proc (and likely /sys) tuneables that can alter this default behavior.
What I’m struggling with is understanding the differences between both interface types (besides the obvious difference in packet processing) and when to use which.
My understanding is that it's not possible to add additional loopback interfaces on Linux. Instead dummy interfaces are added and removed on Linux like loopbacks are added and removed on other NOSs. (I know that you can create and remove loopback interfaces at whim on classic Cisco IOS.) I personally use lo exclusively for localhost and dummy interfaces for anything else that needs a loopback like interface. The only real nuanced difference that I've been able to find is that the lo interface automatically adds the 127.0.0.1/8 IP address when you bring the interface up. Where as dummy interfaces do not add any IP addresses automatically. The only other thing that I've found is that lo doesn't add the 127.0.0.0/8 prefix to the routing table. Conversely if you down lo and add 127.0.0.1/8 to dummy0, you do get the 127.0.0.0/8 prefix in the main routing table. I feel like the lo interface does some tricks and / or takes some shortcuts to try to be helpful. -- Grant. . . . unix || die