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.
81 Answer
The systems all updated to the new IP scope because they were set to DHCP, and the printer didn't update since it was set statically. What you probably didn't do when you reset the printer IP, was to change the setting on the printer as well as in windows.
Routers connect networks. If the system knows that 192.168.254.x is reachable via it's LAN interface, and 192.168.1.x is reachable via its LAN interface, it will work sometimes. Just for grins, look at the routing table and see what it shows.
1