How to control dnsmasq for which IP to return?

Two routers connected by macvlan interfaces:

Router1< macvlan - macvlan >Router2

Router1 (19.07.03)

  • WAN1 to Internet
  • macvlan1 ( wan zone)
  • LAN1 (can access WAN1 & LAN2)
  • Guest1 (can access only WAN1)
  • DNS forward /lan2/

Router2 (21.02.0-rc3)

  • WAN2 to Internet
  • macvlan2 (wan zone)
  • LAN2 (can access WAN2 and LAN1)
  • Guest2 (can access only WAN2)
  • DNS forward /lan1/

For a PC1 connecting to LAN1, ping Router1.lan1 will always got address.
For a PC2 connecting to LAN2, ping Router2.lan2 will always return address.

Now the question:
PC1, ping Router2.lan2, got IPs and in round-robin .
PC2, ping Router1.lan1, got IPs and in round-robin .

How can I configure dnsmasq, such that PC2 will always got for Router1.lan1 , and correspondingly for PC1?

Create the proper records manually and disable the auto-generated ones:

1 Like

For now, I added owrt1.lan1: at Router2 and owrt2.lan2: at Router1 respectively.

The round-robin issue is gone after this. Thank you very much.

Another question:
Where I can start to learn IPv6 addressing? I want to redo the above setup using IPv6 only.

1 Like