A route misbehaving, blocking only *DNS* to other networks

Posted on

A route misbehaving, blocking only *DNS* to other networks – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about linux, domain-name-system, routing, , .

I have a PC with two NICs, one is connected to a LAN (eth0, static IP 192.168.0.254), another to a DSL modem in DMZ mode (eth1, receives public IP from modem).

Yesterday, it suddenly stopped working for accessing the Internet.

I’ve narrowed down the problem to this (or maybe this is just a side-effect, I’m not sure):

$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.0.0     U     1      0        0 eth0
link-local      *               255.255.0.0     U     1000   0        0 eth0
default         <public_ip>     0.0.0.0         UG    0      0        0 eth1

Edit: By public_ip I don’t mean the actual public IP assigned to this machine, but another public IP, which I guess it’s the one assigned to the modem.

With the default routes as above, I can ping to IPs but I cannot resolve domains, so it seems DNS is blocked somehow or maybe it’s trying to use the DNS server from eth0.

If I delete route 192.168.0.0, then instead of the public_ip it shows the FQDN. And then I can resolve domains and access the Internet just fine.

If I assign another computer as the DMZ node in the modem, it works just fine, so it has to be something with this PC. I even tried another NIC for eth0, but no dice.

Any ideas?

Solution :

Based on your additional answer:

This was happening because the 192.168.1.254/24 address used by your modem is also within the 192.168.0.0/16 address ranged used on your internal network.

As you had no specific routing table entry for 192.168.1/24 your PC used the best route it had – the one to 192.168/16.

Whats in your /etc/resolv.conf? Could it be trying resolve using something in 192.168.0.0/16?

I’m not sure why this problem arised, one moment it was working fine, the next…

Anyway, the problem seems to be that the modem had an IP address like 192.168.1.254/255.255.255.0 (our internal network is 192.168.0.0/255.255.0.0), and it seems the machine was trying to find 192.168.1.254 inside our LAN (whyyyy!?!?).

I didn’t notice it before because of the public IP assigned to the machine (i.e., not 192.168.1.x).

So I changed the IP used by the modem, and it now works.

I’m still wondering what the hell happened here. The best explanation I can find is that our ISP updated the modem’s firmware without our knowledge, and this somehow interfered with how it was working before.

Leave a Reply

Your email address will not be published.