1

I have nic1 which is on a local subnet 192.168.48.x with connectivity to the outside world, and nic2 which is on a subnet 192.168.1.x without connectivity to external networks. Both networks are dhcp, with the dhcp box on each being address *1 (everything is 255.255.255.0 netmask)

When

  • just nic1 is up --> everything works fine (browse www in firefox, nslookup, etc). However
  • when i plugin (or ifup) nic2 --> both routing and dns** fails, despite nic1 still being up/valid.

This seems wrong to begin with, although perhaps the routing failure is explainable by the default gw route installed on nic2. I tried manually deleting the routes added by nic2 initialization, which allows me a route to the outside world (ping 8.8.8.8) but name lookup still fails.

  • Due to 192.168.1.1's configuration, I believe it's advertising as a default-gw, and I presume nameservers as well (see note at end of this page for why my setup is like this). I have a feeling that the root of the problem may be related to this, but it appears the in current ubuntu all the nameserver resolution is internal to dnsmasq ...

I've exhausted my understanding of route/dnsmasq/etc, as well as google search. Please help enlighten me! Below are the outputs of the diagnostic I'm familiar with.

**Note: as I'm sure someone more knowledgeable than I will immediately see, there is a discrepancy on which ip is servicing my dns queries.

  • When first trying to understand/fix this several hours ago, 127.0.1.1 (eg, dnsmask) appeared to handled all queries (nslookup always showed 127.0.1.1). After plugging in nic2, nslookup would go from succeeding to failing (after a 5-15ish second delay while the system initialized nic2), reporting the REFUSED from 127.0.1.1. Of course firefox and the rest of the system also fail to lookup names after initialing nic2
  • however after playing with this numerous times, now nslookup shows 192.168.48.1 (and thus, succeeds). However Firefox still can't can't lookup names with nic2 initialized, and if i force dnsmasq with nslookup google.com 127.0.1.1 I get REFUSED
    • from reading online, i'm assuming this is somehow related to the failover / "unreliable server" logic in dnsmasq; but i wasn't able to figure out how to triage that. I don't have an /etc/dnsmasq.conf and other similar answers went nowhere for me.
    • does this mean dnsmasq learned despite 192.168.48.1 advertising dns servers via dhcp, those servers never return any valid results? If that is true, why does this only affect nslookup (firefox www, etc can't lookup names)

After a fresh boot, with just nic1 plugged in:

#> ifconfig
enp0s25  ...  inet addr:192.168.48.140 ...
lo       ...

#>route -n
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.48.1    0.0.0.0         UG    101    0        0 enp0s25
192.168.48.0    0.0.0.0         255.255.255.0   U     100    0        0 enp0s25

#>nslookup www.google.com
Server:    192.168.48.1
   ... looks good

#>ping www.google.com
   ... received response

then, after plugging in nic2

#> ifconfig
enp0s25 --> 192.168.48.140
enx0... --> 192.168.1.135
lo ....

#> route -n
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 enx00e112002767 # so my "no outside world" claims there is a default-gw, which is probably bogus?
0.0.0.0         192.168.48.1    0.0.0.0         UG    101    0        0 enp0s25
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enx00e112002767  # unrelated (??) note: I don't know why this addr is here; is there something bogus in my openwrt?
192.168.1.0     0.0.0.0         255.255.255.0   U     100    0        0 enx00e112002767
192.168.48.0    0.0.0.0         255.255.255.0   U     100    0        0 enp0s25

#> nslookup  www.google.com
  # this is the **Note above; a number of ifup/ifdown iterations ago this just returned REFUSED from 127.0.1.1; now it returns:
Server:   192.168.48.1
  ... valid response

#> nslookup  www.google.com  127.0.1.1
   # for the first N times i had plugged/unpluged nic2, 127.0.1.1 serviced the request by default (no extra server-ip param needed)
Server:   127.0.1.1
REFUSED ...

#> ping www.google.com 
  ... _does_ get a valid IP;  I think this tracks the **Note behavior above
 ... but all packets time out

#> ping 8.8.8.8
  ... times out


#> sudo route delete default
#> sudo route delete default # there are two default routes
#> sudo route add default gw 192.168.48.1

#> ping 8.8.8.8
  ... SUCCESS ...

#> nslookup www.google.com 127.0.1.1
  ... still REFUSED ...

so it appears to me my problem is nameserver related. What am i doing wrong?

Note2: although 192.168.1.1 is returning some bogus information; I think this should be OK, and there is a reason/background to this:

  • I have several local lans/wifis; my main PC is on one (via nic1), and I'm plugging in a usb-nic (nic2) to be able to re-configure a wireless router box (192.168.1.1 on it's LAN side)
  • 192.168.1.1 normally sits in separate network, with that network being normally connected to the net via 192.168.1.1's WAN
    • so 192.168.1.1 is configured to serve dhcp, and at least when it's in it's "normal in-situ" should be providing valid nameservers and a default-gw in the dhcp (which it was doing successfully this AM before i pulled it out to re-configure it on my main pc, over nic2
  • if it's helpful, the 192.168.1.1 box is running openwrt, and it's entirely possible i have it mis-configured somehow leading to it still advertising default-gw and nameservers even though it has been power-cycled with nothing on it's WAN port.

Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.