Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 wlan0
192.168.1.0     0.0.0.0         255.255.255.0   U     9      0        0 wlan0

Why 0.0.0.0 here is used as a gateway? What does 0.0.0.0 signify as a Gateway?

As per my understanding, 0.0.0.0 is used as the default route when the packet does not match with any other entry in the routing table, (first entry in the table). The other two entries use 0.0.0.0 as the Gateway. This is a bit confusing?

share|improve this question
    
can someone please tell me why this question is getting negative votes? –  Sumit Trehan Jul 28 '13 at 12:21
    
Possibly because this type of information is easily found elsewhere and because it is off-topic as per serverfault.com/help/on-topic –  dawud Jul 28 '13 at 13:15
    
My question is about network routing, so why it is off topic? –  Sumit Trehan Jul 28 '13 at 13:19
add comment

closed as off-topic by TheCleaner, Bryan, EEAA, MadHatter, MDMarra Jul 28 '13 at 17:29

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – Bryan, EEAA, MDMarra
  • "Questions must be relevant to professional system administration. Server Fault is a site dedicated to professionals; novice questions are off-topic. Please see the Help Center for more information on topicality. The best advice we can give you is to hire a professional to help you out." – TheCleaner, MadHatter
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 1 down vote accepted

0.0.0.0 has a different meaning depending on which column it is in.

The combination of Destination and Genmask creates an IP address range. In CIDR notation, yours are:

0.0.0.0/0
169.254.0.0/16
192.168.1.0/24

When an IP packet is sent, the destination is matched to these ranges and the gateway is chosen accordingly. The range 0.0.0.0/0 matches all IPv4 addresses. This row is your default gateway and will be used if no other range matches. Your default gateway is 192.168.1.1.

For packets where the destination is local, no gateway is necessary and the packet is sent to the switch to be sent directly to the correct machine. (The details of hubs vs. switches are not important here. The important part is that no gateway is necessary for local packets.)

In the Gateway column in this output, 0.0.0.0 indicates that there is no gateway and the packet should be sent locally.


There's a simple introduction to Linux routing here and a far more in-depth look at Linux routing here.

share|improve this answer
    
Thanks for the answer.. –  Sumit Trehan Jul 28 '13 at 13:50
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.