I have been seeing periodic drops in internet access from LAN connected devices lately (last 2 months), and I haven’t been able to figure about exactly what is going on. There doesn’t seem to be a pattern, and it resolves itself after a few hours.

  • I can access the internet from my router
  • All devices on LAN can reach each other, both wired and WiFi
  • All devices on LAN can reach router, both wired and WiFi
  • I haven’t changed anything in router settings
  • I haven’t added new devices to my local network
  • I can’t find any IP conflicts
  • It’s a simple flat network with two APs, a single switch, no VLAN separation
  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    8 hours ago

    Okay. It’s going to be a little harder to diagnose it since the problem isn’t immediately visible, but you’ve got all the Linux toolset there, so that’s helpful.

    Is the DNS server you’re trying to use from the LAN machines running on the OpenWrt machine, or off somewhere on the Internet?

    EDIT: Or on the LAN, I guess.

    EDIT2: Oh, you answered that elsewhere.

    I am using my routers DNS, and it’s reachable from my laptop.

    Have you tried doing a DNS lookup from the router (pinging a host by name, say) when you were having the problems?

    If so and it didn’t work, that’d suggest that the problem is the upstream DNS server. If that’s the problem, as IsoKiero suggests, you might set the OpenWrt box to use a different DNS server.

    If so, and it worked, that’d suggest that the issue is the OpenWrt host’s DNS server serving names. It sounds like OpenWrt uses dnsmasq by default.

    If not…that’d probably be what I’d try next time the issue comes up.

    • ExcessShiv@lemmy.dbzer0.comOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 hours ago

      Have you tried doing a DNS lookup from the router (pinging a host by name, say) when you were having the problems?

      Yes this works when I’m having issues. I guess I’ll try looking in to my routers DNS next time i have issues. For now it’s working again (I still haven’t changed anything)

      • tal@lemmy.today
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        2 hours ago

        Yes this works when I’m having issues.

        Okay, gotcha. In that case, my guess is that the most-likely issue is with the DNS daemon that OpenWRT is using, which is most-likely dnsmasq.

        You could confirm that your DNS configuration on the LAN hosts is actually using OpenWRT as the DNS server if you wanted — I could walk through that, if you’re not sure. But from a test-when-it’s-happening situation, I’d probably:

        • Install dig on the Mint box, if it’s not already installed. That’s a DNS diagnostic program that doesn’t use your system resolving mechanism, talks directly to DNS, so it cuts out any other factors. It’ll be in the bind9-dnsutils package.

            $ sudo apt install bind9-dnsutils
          
        • Install dig on the OpenWRT box.

            $ opkg update
            $ opkg install bind-dig
          
        • Confirm that you can successfully run it on both the OpenWrt box and your laptop when there are no problems (your router’s LAN address probably being something like 192.168.1.1):

            $ dig @your-router-LAN-address www.google.com
          
        • Confirm that you can successfully run it on both the OpenWrt box and your laptop when there are no problems using whatever outside DNS server you have the OpenWrt box set to use (assuming 1.1.1.1 here):

            $ dig @1.1.1.1 www.google.com
          
        • Next time you have problems, repeat the above. If both the dig on your OpenWrt box and on your laptop using the OpenWrt DNS server now fail, then it’s probably pretty safe to say that it’s the DNS server on the OpenWrt box at fault. If just the one on your laptop fails, then it’s going to be a communication issue between your LAN box and the OpenWrt DNS server.

        Assuming that the problem is the OpenWrt DNS server, and assuming that it’s dnsmasq, to troubleshoot further, I might try looking at its logs, or installing tcpdump on the OpenWrt box and running that, something like $ tcpdump -nvvv -i any udp port domain. That should let you see both the incoming DNS queries going to the OpenWrt DNS server as well as the queries that it is sending upstream (the -n will prevent tcpdump from itself sending DNS queries to look up IP addresses, which would generate more noise, the -vvv to show all possible information about the packets, and the -i any to show all packets on all interfaces). That’ll let you see whether it’s getting flooded with DNS queries and to see what queries it’s sending to the upstream DNS server out on the Internet.

        That won’t alone solve your problem, but it’d be the next step I’d try to narrow down what’s going on.