0

I have problem about working of dnsmasq.

To forward dns queries from other devices to external network, I used dnsmasq v2.86.

When problem was happened, dnsmasq printed out forward log successfully but tx count of network interface is not increased and actual packet data are not sent also.

This is log example of dnsmasq. dnsmasq[4679]: forwarded google.com to 8.8.8.8

At that time, all network routing rule set correctly such as default gateway or routing rules.

As my checking of soucecode of dnsmasq, forwarded log should be printed out after success of sendto

  if (retry_send(sendto(fd, (char *)header, plen, 0,
            &srv->addr.sa,
            sa_len(&srv->addr))))
    continue;
  
  if (errno == 0)
    {      
      /* Keep info in case we want to re-send this packet */
      daemon->srv_save = srv;
      daemon->packet_len = plen;
      daemon->fd_save = fd;
      
      if (!(forward->flags & (FREC_DNSKEY_QUERY | FREC_DS_QUERY)))
    {
      if (!gotname)
        strcpy(daemon->namebuff, "query");
      log_query_mysockaddr(F_SERVER | F_FORWARD, daemon->namebuff,
                   &srv->addr, NULL, 0);
    }

      srv->queries++;
      forwarded = 1;
      forward->sentto = srv;
      if (!forward->forwardall) 
    break;
      forward->forwardall++;
    }

So I believe, at least, DNS packet goes to Linux side.

I guess:

  1. packet is dropped somewhere
  2. packet is blocked by firewall
  3. packet is forwarded to wrong interfaces.

However, firewall does not print out any pakcet drop log and there is no other interfaces.

To find reason of problem, what I can do?

When dnsmasq printed out "forwarded to" log, tx count of network interface should be increased.

I reset connection between APN and devices and then set routing rule several times at the same power cycle, issue still existed before system reset.

After system reset, it works correctly.

0