cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
16833
Views
26
Helpful
12
Replies

0.0.0.0/0 vs 0.0.0.0/8

eric.guo
Level 1
Level 1

hi Guys,

could someone help me to understand if we input these 2 default into one router at same time ?

ip route 0.0.0.0 0.0.0.0 172.10.10.10
ip route 0.0.0.0 255.0.0.0 Null0

sh ip route

S*    0.0.0.0/0 [1/0] via 172.22.10.10
S     0.0.0.0/8 is directly connected, Null0

thanks,

Eric

12 Replies 12

johnd2310
Level 8
Level 8

Hi,

I think this means everything for 0.0.0.0/8 ( 0.0.0.1 - 0.255.255.254) will be sent to null0 and everything else(NOT 0.0.0.0/8) will be sent to 172.22.10.10

 thanks

John

**Please rate posts you find helpful**

thanks Guys!

I got a clearly mind now.

Eric 

You are welcome

:-)




>> Marcar como útil o contestado, si la respuesta resolvió la duda, esto ayuda a futuras consultas de otros miembros de la comunidad. <<

For anyone still confused:

We're looking at two static routes:

ip route 0.0.0.0 0.0.0.0 172.10.10.10
ip route 0.0.0.0 255.0.0.0 Null0

The first, "ip route 0.0.0.0 0.0.0.0 172.10.10.10" says "anything that matches 0.0.0.0 with a mask of 0.0.0.0--that means, anything and everything--route it to 172.10.10.10."

The second, "ip route 0.0.0.0 255.0.0.0 Null0" says "anthing that matches 0.0.0.0 with a mask of 255.0.0.0--that means, anything that starts with 0 in the first octet and we really don't care about the other octets--route it to Null0."

You may ask yourself, "How would the second ip route ever kick in? The first one covers it!" But recall: This is an IP Route statement, not an ACL. ACLs apply the first match, but IP Route statements apply the most specific statement that matches!

So if traffic was sent to 8.8.8.8, it would be routed to 172.10.10.10. If traffic was sent to 1.0.0.0, it would be routed to 172.10.10.10... but any traffic being sent to 0.1.2.3 or 0.100.254.3 or 0.0.0.0 will be routed to Null0, because while both routes apply, "ip route 0.0.0.0 255.0.0.0 Null0" is more specific.

Very good explanation. Thanks for explicitely mentioning, that "more specific routes" always take precendence over less specific routes.

Hi Eric,

The network 0.0.0.0/0 represents a default route, used to reach unknow destinations

The network 0.0.0.0/8 - Addresses in this block refer to source hosts on "this" network. Address 0.0.0.0/32 may be used as a source address for this host on this network; other addresses within 0.0.0.0/8 may be used to refer to specified hosts on this network ([RFC1122].

Reference: https://tools.ietf.org/html/rfc5735

As John mentioned, I think every host or network into this range: 0.0.0.1 to 0.255.255.254 will be discarded. 

Hope it is useful

:-)




>> Marcar como útil o contestado, si la respuesta resolvió la duda, esto ayuda a futuras consultas de otros miembros de la comunidad. <<

jilse-iph
Level 1
Level 1

As others already have mentioned: A route for 0.0.0.0/0 is an (IPv4) default-route, because the network 0.0.0.0/0 represents the whole IPv4 address space (it means "network part of the ip addresses in this network is 0 bits long, so all are host addresses, it is the network containing every possible IPv4 address). 0.0.0.0/8 (which is used in the second route statement) is the first /8 subnet of the complete IPv4 address space. It may be useful to configure a route to Null0 for this network, because this network (and subnets of this network) are reserved and will never be assigned as official IPv4 addresses to companies (don't ask me, why the complete /8 network is reserved, i don't know that, but i know, that this network is not used for assignments of public IPv4 addresses). A route to this network is not a default-route, because that network doesn't represent the complete IPv4 address space (in contrast to 0.0.0.0/0, which represents the complete IPv4 address space). You may think of a default route as a route to "the biggest possible IPv4 network, which contains the complete IPv4 address space", and this network is 0.0.0.0/0 but not 0.0.0.0/8 ... In my opinion it is easier (and more logical) to look at the "default-route" this way, because you may think of it simply as a route to a network containing all IPv4 addresses than to thnik of "0.0.0.0/0 is a special string matching the default-route" (all other routes take precedence over this route to 0.0.0.0/0, because all other routes are "more specific").

FaadiKhan
Level 1
Level 1

The 0.0.0.0 /8 range is used to identify hosts on the local network.
Addresses in this range can only be used as a source address. The
most commonly used address in this range is 0.0.0.0 /32, which a host
will use when dynamically attempting to learn its IP address via
Dynamic Host Configuration Protocol (DHCP).

The 0.0.0.0 /0 network is used to identify all networks, and is referred
to as the default route. If a default route exists in a routing table, it
will be used only if there is not a more specific route to a particular
destination.


@FaadiKhan wrote:

The 0.0.0.0 /8 range is used to identify hosts on the local network.
Addresses in this range can only be used as a source address. 


So if a host does not have an IP it uses a random IP out of 0.0.0.0 /8 which is not listed in the ARP table to make him identifiable on Layer 3 to e.g. obtain an IP lease from an DHCP server? 

Hello,

To answer your question, not exactly. The host is identified by its MAC address on the local LAN. It sends the DHCP request to the Router which in turn forwards that request to the DHCP server on its behalf (if its remote). The DHCP server replies with an address which the router forwards back down to the host to give it its IP address.

Also for future questions it might be more beneficial to ask your question as a separate forum post. Asking it on an old thread might make it harder for people that have the same question to find and get a solution for. Not to mention some community members in this thread may longer be active or reply.

Hope that helps

-David

Thx for reply, so when does a host use an ip from 0.0.0.0/8?

Yep I know that it is quite a old topic but Google got me here and I wanted to keep information on the same place, so it was worth an attempt

Review Cisco Networking products for a $25 gift card