On 13.02.22 17:20, Chris Green wrote:
I want to configure a system to listen on an address that it doesn't actually have until I add the address to the network interface.
https://duckduckgo.com/?q=linux+bind+foreign+IP&t=seamonkey&ia=web on linux you should set net.ipv4.ip_nonlocal_bind=1
Feb 13 16:56:27 esprimo systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server... Feb 13 16:56:27 esprimo dnsmasq[3847]: dnsmasq: failed to create listening socket for 192.168.1.2: Cannot assign requested address Feb 13 16:56:27 esprimo dnsmasq[3847]: failed to create listening socket for 192.168.1.2: Cannot assign requested address Feb 13 16:56:27 esprimo dnsmasq[3847]: FAILED to start up Feb 13 16:56:27 esprimo systemd[1]: dnsmasq.service: Control process exited, code=exited, status=2/INVALIDARGUMENT Feb 13 16:56:27 esprimo systemd[1]: dnsmasq.service: Failed with result 'exit-code'. Feb 13 16:56:27 esprimo systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
In the dnsmasq man page it has:- -z, --bind-interfaces On systems which support it, dnsmasq binds the wildcard address, even when it is listening on only some interfaces. It then discards requests that it shouldn't reply to. This has the advantage of working even when interfaces come and go and change address. This option forces dnsmasq to really bind only the interfaces it is listening on. About the only time when this is useful is when running another nameserver (or another instance of dnsmasq) on the same ma‐ chine. Setting this option also enables multiple instances of dnsmasq which provide DHCP service to run in the same machine. I thought this would mean I could do what I want which is to have:- listen-address=192.168.1.2,127.0.0.1 ... and only actually create the IP 192.168.1.2 on the network interface when I want this system to be the DHCP/DNS server.
no, this affects how dnsmasq calls bind(), not how bind() will respond. -- Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/ Warning: I wish NOT to receive e-mail advertising to this address. Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu. "One World. One Web. One Program." - Microsoft promotional advertisement "Ein Volk, ein Reich, ein Fuhrer!" - Adolf Hitler _______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss