Routing – Ipv4 routing – 2 host of diferents nets ping each other in the same Hub

ipv4routerrouting

Look this scenario.

Host 1:
Ip:192.168.0.1
mask:255.255.255.0
gateway: not defined

Host 2:
Ip:192.168.1.1
mask:255.255.255.0
gateway: not defined

Is it possible to ping from host 1 to host 2? assume that both are connected on the same hub.

I tried in the packet tracer and didn't work, this is normal or a configuration fault?
if it was a switch?
to route between networks must use a router?

Best Answer

When it host is going to send IP traffic, it first checks to see if the destination IP address is on the local subnet. It uses both it's IP address and the subnet mask to make this determination.

If the destination IP is not on the local subnet (your case), the host then checks to see if it has a route to the destination IP in it's routing table. Generally most hosts only have one route, the default route or gateway that is provides somewhere to forward traffic for any other network (barring any more specific route to the destination IP).

In your case, with no configured gateway, the host will determine it doesn't know how to get to the destination IP. This means it has nowhere to send the traffic resulting in the traffic being dropped while generally returning an error like "No Route to Host."