hnetd
hnetd copied to clipboard
Provide dummy interface (option?) and use only that address externally
Fate-share e.g. dummy interface with the lifetime of the hnetd process; use the IPv4/IPv6 addresses of that, so that addressing stays stable even in presence of network topology changes.
Question is, should this be an option / default to on?
Such a «primary» address could also be used to fix issue #54.
Not sure you need a separate dummy interface though, in my experience it's usually the router's loopback interface which is used for this purpose.
Linux loopback used to have some issues (hardcoded routing/firewalling logic associated with it). Not sure if that is the case still.
That's the main reason IIRC whole dummy network device came around looong time ago anyway ;) Dunno if it is still needed or just using 'lo' would be enough.
Local traffic is indeed treated specially and routed to the lo
interface:
$ ip -6 rule list
0: from all lookup local
32766: from all lookup main
$ ip -6 route show table local
local ::1 dev lo proto none metric 0
local 2001:db8:c420:3c4::255 dev lo proto none metric 0
[...]
You can't override that rule
because it has priority 0, and the local <addr> dev lo
routes are added automatically for all addresses on the system (they don't actually have to be configured on the lo
interface - in my example above, 2001:db8:c420:3c4::255 is actually configured on enp0s25
). So while local traffic is treated specially I don't think it matters if the address is configured on lo
or dummy0
or any other interface, as it will end up getting routed to lo
anyway.
That said, I have no objection to using dummy0
or whatever else, just wanted to point out that using lo
might make the implementation easier.