Imagine a common home DSL internet setup:1) You have a router that has a public IP address on the WAN port (I'll pick an entirely random value of 184.108.40.206) and a private IP address on the LAN port (192.168.1.1). 2) Your two home PC's are 192.168.1.3 and 192.168.1.4. 3) The router uses Network Address Translation to allow the home PC's to surf the web.
(Ok, nothing exciting there)
Now, the router has a feature called "IP Passthrough" whereby the IP address of the WAN port can become the IP address of one of the machines on the LAN. Forgetting for the moment the effect this would have on the router's NAT facility, I'd like ask how the following setup could work:1: You have a LAN with two machines and a router. 2: Router's LAN port address = 192.168.1.1 3: Machine One's address = 192.168.1.3 4: Machine Two's address = 220.127.116.11 (because of IP passthrough)
I'm curious what would happen if you tried to ping Machine One from Machine Two. Firstly assume that both machines have the following setup:
Default gateway = 192.168.1.1 Netmask = 255.255.255.0
Here's what I *think* would happen:
(Assume that the ARP cache is empty)1) Machine Two performs a bitwise-AND with its own netmask and the address of Machine One. From this, it finds that Machine One is *not* on the same network. 2) Because the machine is not on the same network, it decides to send the packet to the default gateway (hard-coded as 192.168.1.1). But first, it needs the MAC address of the default gateway. 3) So it broadcasts an ARP request looking for the MAC of 192.168.1.1. 4) Once it gets the MAC, it uses the router's LAN port of 192.168.1.1 as a default gateway to reach machines that are 192.168.1.*
Is this right? Basically I'm asking if it's possible to have unrelated IP addresses on the same LAN?
(I haven't begun to think about how NAT would still work for the other machines on the LAN)