I have two questions, but let me explain the situation first. They are about the (static) IP address of a printer attached to the network.
We had this networking setup, using a normal consumer router (Cisco):
Printer IP address: 192.168.254.5 (static IP address)
Default gateway: 192.168.254.1 (for all devices)
Subnet mask: 255.255.255.0 (for all devices)
Then the router got reset because there were some internet troubles. The settings ended up looking like this:
Printer IP address: 192.168.254.5 (static IP address)
Default gateway for the printer: 192.168.254.1 (only the printer)
Default gateway for the rest: 192.168.1.1 (all other devices)
Subnet mask: 255.255.255.0 (for all devices)
Well, obviously this didn't work so well. I managed to change the printer IP address to 192.168.1.5
(outside of the DHCP range) and set it's default gateway to 192.168.1.1
. While this worked for Linux (Debian) which had found the printer via DNS-SD, apparently Windows can't deal with IP address changes.
The tech guy came along and changed the printer IP address back to 192.168.254.5
, keeping the default gateway intact. To my big surprise, this worked... somewhat. Sometimes there is 0% packet loss when pinging to the printer, sometimes there is a LOT of packet loss (10s of percents), and often after a while there is no connectivity at all (though, strangely, the printer can still be detected via DNS-SD).
So here are the questions:
- Why can the printer be reached at all when it's outside the router subnet? I had expected this wouldn't work at all.
- Is this crazy setup the cause of the flaky LAN connection to the printer?
Note: we have a few switches and (NAT) routers in the home, so those might complicate the network. I think there are usually about two or three switches between the computer and the printer.
Edit: to clarify, my question isn't about how to get this to work, but about how routing works normally and what exactly goes wrong here -- why the packets don't end up where they are meant to go.