I just tested the suggestion and it worked: --server=10.1.2.3@ethX
Thank you, -H On 9/24/20 4:00 AM, Petr Menšík wrote: > Do you have the same IP addresses on those interfaces? > > anyway, it seems to be implemented already. Check --server in man > dnsmasq(8). > > --server=10.1.2.3@ethX > > I am not sure it just uses source IP address from that interface or it > can differentiate the same IP addresses on different interfaces. Please > try and share results. > > On 9/23/20 11:16 PM, Hooman wrote: >> Hi Petr, >> >> Thank you for your response. I am actually looking for a way to forward >> packets to a specific interface. The DNS servers on all these interfaces >> are the same, so I can't use the method you mentioned in your response. >> >> I am looking for something similar to the `ping -I interface` option [1] >> that sets the source IP address (or interface) for the ping packets. >> >> Thank you, >> >> -H >> >> >> [1] https://linux.die.net/man/8/ping >> >> On 9/23/20 2:47 PM, Petr Menšík wrote: >>> Hi, >>> >>> I doubt there is simple way to forward to "interface". DNS queries needs >>> target IP to forward to. You would need >>> dnsmasq ... --no-resolv --server=<ethX forwarder IP> >>> >>> I just guess you want to use DNS server configured by DHCP on given >>> ethernet interface. I doubt it is possible to integrate directly into >>> dnsmasq. It is not DHCP client, but DHCP server. You would have to find >>> a way to obtain DNS settings for given interface and prepare >>> configuration snippet for dnsmasq. >>> >>> With fixed IP addresses, it would be much easier :), just use different >>> --server on each instance. >>> >>> Cheers, >>> Petr >>> >>> On 9/23/20 8:13 PM, Hooman wrote: >>>> Hi, >>>> >>>> I am using `hostapd` to setup WiFi hotspot networks on my Ubuntu 18.04. >>>> I am using [this guide][1] to setup multiple SSIDs on my WiFi interface. >>>> And to enable DHCP on the hotspot networks, I use `dnsmasq`. >>>> >>>> I run a separate instance of `dnsmasq` for each SSID. Now, I have >>>> multiple Ethernet interfaces available on this computer and I want each >>>> `dnsmasq` instance to forward the DNS requests it receives on a >>>> different Ethernet interface. >>>> >>>> Is there an easy way to do this? In other words, is there a way to tell >>>> `dnsmasq` which Ethernet interface to use for forwarding DNS queries? I >>>> know that in theory I can use network namespaces to do this, but I'm >>>> looking for an easier way. >>>> >>>> Thank you! >>>> >>>> -H >>>> >>>> >>>> [1]: http://wiki.stocksy.co.uk/wiki/Multiple_SSIDs_with_hostapd >>>> >>>> >>>> _______________________________________________ >>>> Dnsmasq-discuss mailing list >>>> Dnsmasq-discuss@lists.thekelleys.org.uk >>>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss >>>> _______________________________________________ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss