Why can I reach an Ethernet connected device with a static ip outside my network?

2

In my local network, I have the following setup.

LAN setup

My laptop's ipconfig output is

enter image description here

I've also connected a physical printer with via Ethernet to my router. This printer has an http interface which allows you to change its ip, subnet, and gateway. This is the current setup.

enter image description here

As you can see, even though the printer is on a different network, 10.0.0.100, my laptop (10.1.1.15) is still able to reach it. Is it because both laptop and printer share the same default gateway? Are these the steps that are currently taking place "under the hood?"

  1. laptop tires to see 10.0.0.100
  2. laptop can't see it since 10.0.0.100 is on a different network
  3. laptop asks router for 10.0.0.100
  4. router typically would go out into the outside internet world to find 10.0.0.100, but since the printer "registered" itself, the router was able to find the ethernet connected printer at 10.0.0.100.

If these steps are accurate, why can't I see the printer in my router's "attached devices" section?

I also experimented with a few different printer settings with the following results.

printer setup 1 -- laptop successfully reaches http interface at 10.1.10.100
ip - 10.1.10.100
subnet- 255.255.255.0
default gateway - 192.168.1.1

printer setup 2 -- laptop fails to reach http interface at 10.0.0.100
ip - 10.0.0.100
subnet- 255.255.255.0
default gateway - 192.168.1.1

printer setup 3 (setup described above) -- laptop successfully reaches http interface at 10.0.0.100
ip - 10.0.0.100
subnet- 255.255.255.0
default gateway - 10.1.10.1

Is setup 1, is my laptop able to reach 10.1.10.100 without going through the router due to the printer being in the same network?

Simon

Posted 2019-09-17T16:00:54.133

Reputation: 233

Answers

0

This seems to be an artifact of the router.

This is what happens from the laptop’s perspective, and it involves the ARP protocol which converts IP addresses to MAC addresses. Layer 3 works on IP addresses. IP addresses are converted to MAC addresses at Layer 2 and then sent out on the wire at Layer 1.

  1. Laptop determines that 10.0.0.100 is not on the same network.
  2. Laptop sends out an ARP request to send the request to the default gateway: Who has 10.1.10.1?
  3. Router responds: 10.1.10.1 is at <Router’s MAC Address>
  4. Laptop sends request to router.

Here is where it gets weird:

  1. Router must send an ARP request out the WAN interface and the LAN interface: Who has 10.0.0.100?
  2. Printer responds: 10.0.0.100 is at <Printer’s MAC address>
  3. Router sends request to printer out the LAN interface.
  4. Printer receives request.
  5. Printer determines that 10.1.10.15 is not on the same network.
  6. Printer sends out an ARP request to send the response to the default gateway: Who has 10.1.10.1?
  7. Router responds: 10.1.10.1 is at <Router’s MAC Address>
  8. Printer sends response to router.
  9. Router sends ARP request: Who has 10.1.10.15?
  10. Laptop responds: 10.1.10.15 is at <Laptop’s MAC address>
  11. Router sends response to laptop.

That is the only thing I can think of and would mean the router is acting a little strangely at step 5 by looking for the destination address on both the WAN and LAN interface. Other than that this is the way basic IP communications occurs across a network.

Rather than step 5. It is possible the router prepares to send the request out the WAN interface towards the internet, but some mechanism in the router forwards the request back out the LAN interface. Being this is a SoHo router, I would think there wouldn’t be any settings that would do that. But who knows.

To prove this, install Wireshark and see if you see the above packet flow. Specifically look for step 5 and 6 in your network trace.

Appleoddity

Posted 2019-09-17T16:00:54.133

Reputation: 9 360

Update: I was not able to learn anything with wireshark, perhaps because I don't know how to find what I was looking for. But I was able to get a new cheap router and WAS NOT able to reproduce the behavior of the netgear router. So this is definitely a strange router behavior. – Simon – 2019-10-10T02:53:46.330