Routing if your own ip address the default gateway in windows xp?
Hi I have two laptops running windows XP A & B which can ping each other just fine if i assign them the following ip addresses. They are connected via crossover cable. A: 192.168.0.1 Subnet: 255.255.255.0 B: 192.168.0.2 Subnet 255.255.255.0 However If i change the ip & subnet of B to B: 192.168.1.2 Subnet: 255.255.0.0 Ping from A ----> B gives an expected and immediate Desination host unreachable Ping from B ----> A gives me a Request Timed out since B succesfully sends the ping to A but A cannot route the pong back to B Now here is the weird part ... If I add the ip of A as the default gateway for A now B can ping A successfully and A can now route the pong back to B. WHY WHY WHY ?? Since all packets sent by A to A's ip address are sent back via loopback , I dont understand why adding it as a default gateway should allow the pong to reach the wire ?? Im not asking how to fix this problem but putting them in the same subnet. I realise they are in different subnets where one is subnet is a subset of the other. My question is why does adding the default gateway as "itself" allow the smaller subnet to be able to route packets to the larger subnet. Since all packets sent to itself are sent to loopback and never should show up on the wire. I dont know if this behaviour is OS specific..im running windows XP on both machines thats a "by" not a "but" in the above details..sorry for the typo
Public Comments
- The problem is, is that there are two different subnets and subnet masks used. It needs to be set up like this: A: IP: 192.168.1.1 Subnet Mask: 255.255.255.0 A: IP: 192.168.1.2 Subnet Mask: 255.255.255.0 That way they can talk to each other. They don't need a default gateway because there is no internet connection... unless you have an internet connection coming in through a different interface, then you need to set up some static routes on the B machine to route through the A machine or whatever... but don't forget "K.I.S.S." :)
- Don't quote me on this. The IP address is broken down into three sections: the Network Address, Subnet, and Host ID. Computer A 's Net Address is 192.168, the Subnet is 0 and 1 is the Host ID. The subnet mask is telling the computer what to look for when it is sending packets from one computer to another. 255.255.255.0 is telling the computer to look at the IP address but only look at the Net Address and the Subnet. So by changing Computer B to 192.168.1.2 with a subnet of 255.255.0.0, this is telling the computer to look for only the Net Address. Since the Subnet of 1 for B does not match the subnet of 0 for A, the computer cannot find the subnet on the network. Therefore, you can a response saying that the network does not exist.
- I think this has to do with variable-link subnet masking, but I'm not sure. Basically VLSM is a concept that subnets a subnet, but you would have to use a router to connect the two networks together. Could the computers be building a routing table somehow? Another thing I thought about was maybe since A's address was set as the default gateway, that you have set up a default route for A to use. So, when B sends an echo packet to A, A tries to respond. When it can't the gateway address is used to send out a broadcast of the echo return and when that happens B gets a return packet. This has me scratching my head.....
Powered by Yahoo! Answers