Score:0

Xinetd listen to IP Address not assigned to an interface

is flag

Is it somehow possible to use Xinetd (or any other solution) to listen to incoming Packets for an IP Adress which is not assigned to an interface, and start up a daemon (like Xinetd) does?

So my Linux Machine is the default GW, all Packets are sent to it. I would like to recognize specific packets with a destination IP, which is not bound to an interface and react to it (start up a daemon)

Thanks!

Score:0
za flag

Yes, enable a net.ipv4.ip_nonlocal_bind setting:

echo "net.ipv4.ip_nonlocal_bind = 1" > /etc/sysctl.d/enable-nolocal-bind.conf"
sysctl net.ipv4.ip_nonlocal_bind=1

(the latter is "enable it now", the first line is to make this persistent). Now you can bind daemons to any IP address.

However, this might not work as you expected. In the same LAN computers don't use the default gw to communicate. They send packets directly, e.g. making ARP queries to findd out MAC address of the system where to send a packet. If there is no reply, it won't revert to sending a packet to a default gw. It will fail with the error instead.

Score:0
cn flag

On Linux, routes of type local are loopback, and will be delivered to localhost. Also known as AnyIP.

Route as large of a prefix as desired. If using IPv6, perhaps reserve an entire /64 for the purpose, say 2001:db8:bdd2:c0e::/64. Route that to this host (the Linux box), and in the Linux box send it to local.

Configure xinetd to listen on the desired port.

End result, any IP in that net, say 2001:db8:bdd2:c0e::138, will terminate on this box, and start the server program.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.