Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share

migration rejected from stackoverflow.com Feb 17 at 16:47

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

marked as duplicate by Iain Aug 3 '12 at 6:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 1 down vote accepted

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...).

share