If i dont have a default gateway configured and i try to send a pkt to a different subnet what will the host do? Will it reject the pkt ?
On Linux - I configured two hosts connected to a hub with 2 ip addr (10.1.1.1 and 18.104.22.168). If i dont specify a default gateway the 2 hosts can ping each other. What does the IP forwarding algorithm do here?
Re: No Default gateway configured
13 years 9 months ago #6729
It all depends as Sahir said the subnet mask, you have used. Anyway just to give you a brief idea of what actually happens when you ping.
When you ping any IP address the computer ANDs the destination IP address with the SUBNET MASK of the computer to find if the destination is within the same network or not.
--> Once the computer finds that the destination IP address is well within its NETWORK...it would try to find the MAC address of the machine, first by checking the ARP cache if not sucessful it would use the ARP protocol to find the MAC of the computer. Once it gets the MAC of the computer the packets would be forwarded to the particular computer.
--> Once the computer finds that the destination IP address is not within the NETWORK of the computer, it would check if there is any DEFAULT GATEWAY to who it can send the packet(who MIGHT know where the destination IP address is or atleast a route to it). In this case the computer would just forward the packet to the default gateway, once again doing the same AND process.
You still can forward packets to a different network without a default gateway...concept of PROXY ARP..where one machine(usually router connecting two different networks) does proxy for the other.