How to control dnsmasq for which IP to return?

Two routers connected by macvlan interfaces:

Router1< macvlan 10.1.0.1/30 - macvlan 10.1.0.2/30 >Router2

Router1 (19.07.03)

  • WAN1 to Internet
  • macvlan1 10.1.0.1/30 ( wan zone)
  • LAN1 192.168.101.1/24 (can access WAN1 & LAN2)
  • Guest1 192.168.201.1/24 (can access only WAN1)
  • DNS forward /lan2/10.1.0.2

Router2 (21.02.0-rc3)

  • WAN2 to Internet
  • macvlan2 10.1.0.2/30 (wan zone)
  • LAN2 192.168.102.1/24 (can access WAN2 and LAN1)
  • Guest2 192.168.202.1/24 (can access only WAN2)
  • DNS forward /lan1/10.1.0.1

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

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

How can I configure dnsmasq, such that PC2 will always got 192.168.101.1 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:192.168.101.1 at Router2 and owrt2.lan2:192.168.102.1 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