Totally different IP's on the same LAN?




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 73.52.66.5) 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 = 73.52.66.5 (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)

--
Tomás Ó hÉilidhe
.



Relevant Pages

  • Re: Remote desktop & Netgear router
    ... if you can connect to the PC from another PC using the "private LAN IP address" over your ... local LAN then Remote Desktop is obviously setup right and working. ... The issue then is the port forwarding on the router. ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: [Full-Disclosure] Microsoft urging users to buy Harware Firewalls
    ... I have a 5 machine LAN here at home and I have Astaro Security Linux ... >>I agree with Microsoft's recommendation for a hardware firewall on all ... Then the user finds about port forwarding, and as soon as the user has ... > at the router and cannot get to the computers in the local network. ...
    (Full-Disclosure)
  • Re: Howto connect a FreeBSD to the Internet
    ... > three computers are hardwired to the router ... need to open port 80 on the router for incoming, ... > has a similar setup and what they would recommend? ... script program that offers a number of features and easy config and setup. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Remote desktop & Netgear router
    ... you can get that quite easily by going to either of these sites from a PC on the LAN ... In your case it would be the IP address of the WAN port of the Netgear router. ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: how do I contact a pc behind a router
    ... my home LAN... ... I also use a non-default port for SSH connections into my ... > One way is you can open multiple ports on the router, ie. one to each PC, ... > through the tunnel. ...
    (microsoft.public.windowsxp.work_remotely)

Loading