cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1819
Views
15
Helpful
4
Replies

Interface Null0

CiscoIPMAN
Level 1
Level 1

I understand that a null 0 command is like a trash bin to preventing looping in the network. I have a layer 3 distribution switch using OSPF with no summarization. There is a Null0 interface on the switch. There is not a specific route telling a network to use Null 0. There is a default route Gateway of last resort is 10.5.5.0 to network 0.0.0.0

 

My question is if there is a destination network that is unknown won’t that be passed to the Gateway of last resort? If so how does the Null 0 interface get used?

Thanks

4 Replies 4

Peter Paluch
Cisco Employee
Cisco Employee

Hello,

My question is if there is a destination network that is unknown won’t that be passed to the Gateway of last resort? If so how does the Null 0 interface get used?

You have a very good question! If you truly have a default route (the 0.0.0.0/0 network) in your routing table, then the Null0 interface will never be used, since for every possible destination, there is a matching network, either a specific route, or the default route.

Of course, should the default route disappear from the routing table for whatever reason, then packets without a matching destination would be "forwarded" through Null0 - meaning they would be dropped.

The configuration of the Null0 interface permits only two IP-related commands: [ no ] ip unreachables and [ no ] ipv6 unreachables. These commands either activate or deactivate the sending of ICMP Destination Unreachable messages for all packets that have been discarded by having them "forwarded" through Null0. This is also the only reason why you can actually configure the Null0 interface, and thus see it in the running-config, as there is otherwise nothing there to tweak.

Feel welcome to ask further!

Best regards,
Peter

Thank you for your reply.

I dont have a 0.0.0.0 0.0.0.0 when I look at the routing table but I believe this is being learned through OSPF through the default-information originate command on our border router. I think that's why I see just the default gateway network address.

 

So it seems as if I have a default route 0.0.0.0 0.0.0.0 (destination address), using a Null route or interface is not needed? Could you provide an example of when you would use the Null interface or null route? From what I have read it prevents routing loops when using summarization on routes.

Thank You

The discussion seems to be going back and forth between null interface and null route. Let us be clear that these are two very different things. So are we talking about null interface or about null route?

 

A null interface is a virtual interface, very much like a loopback is a virtual interface. A null interface is more limited than a loopback interface and I thought that Peter's comments about null interface were spot on and very helpful.

 

A null route is a route that specifies the null interface as the next hop. Note that configuring a null route does not necessarily mean that the null interface will show up in the running config. As mentioned in this discussion one reason to use null routes is in conjunction with doing route summarization. When we advertise a summary route we are claiming that all subnets in that range are reachable through this router. For example we might advertise a summary route of 172.16.0.0 255.255.248.0. This claims that subnets beginning at 172.16.0.0 and extending through 172.16.7.255 are reachable through our router. But what is subnet 172.16.6.0 does not exist? We have asked our routing peers to forward to us all packets with destination address of 172.16.6 but we have no where to send them. If we have associated a null route with the summary then this takes care of the problem. If the router receives a packet for 172.16.6.25 then the router knows that it should simply discard this packet.

 

There is another common reason to use null routes. I have seen many customer networks that run BGP that use null routes. One of the aspects of running BGP is that you use network statements to enable advertisement of the specified networks. But just because the network statement is in the config does not mean that BGP is going to advertise that network. BGP looks at the network statement and then looks into the IP routing table. Only if there is an entry in the routing table that matches the network statement will BGP advertise the network. And if the network is withdrawn from the routing table then BGP sends a routing update withdrawing that route for its BGP peers. For many networks running BGP the stability of the network is important. They do not want BGP advertising and withdrawing networks. They want a network to be advertised and to stay advertised (even if it is not currently reachable). The way to achieve this is to configure a null route for the network. With the null route there is always an entry in the IP routing table and BGP will advertise the network and not withdraw it.

 

HTH

 

Rick

HTH

Rick

Richard Burts
Hall of Fame
Hall of Fame

You have not told us which model of switch this is and not what version of code it is running. And you have not shared its config. So it is difficult for us to tell you much about its null0 interface. It is possible that this model of switch and version of code automatically puts a null0 interface in the config (much the same way that it puts in vty lines and many other default features).

 

If there is not any route in the routing table that specifies the null0 as a next hop then yes any packet to an unknown destination network should be forwarded to the gateway of last resort.

 

I have seen many devices that configure routes specifying null0 without having a null0 interface. So having the null0 interface is not required to do null0 routing.

 

HTH

 

Rick

HTH

Rick
Review Cisco Networking for a $25 gift card