1
vote

Possible Duplicate:
How does Subnetting Work?

If you setup a default route in a IP routing table you provide a network mask. What difference does it make if the mask is 0.0.0.0 compared to say 255.255.255.0?

i.e what how does a net mask of 0.0.0.0 affect the default routing of IP packets?

0

1 Answer 1

1
vote

If you have more than one gateway a decision must be made for each outgoing packet which gateway it should be sent to. This obviously depends on the packet's target address, which must be matched against the available gateways. So maybe you can say: the netmask defines what address range a gateway is responsible for.

Real world effect: you might require different gateways to reach different networks, for example in companies running separate networks for branches or locations.

A netmask of 0.0.0.0 means all outgoing packets are routed through this gateway ("to all nets").

A netmask of 255.255.255.0 means only packets that belong to the same class c network are routed through that gateway. Other packets must be routed using other gateways or don't have to be routed at all (which would be odd...).