The default route is the path toward all those networks which have no other matching routes defined. What a boring definition :-(. Let me try again: “The default route will take you to the unexplored areas of the divine Internet!”, or: “Follow the default route to eternity!”. Back to earth, ::/0 represents everything out there (except for the historic IPv4 stuff). Where does the route for ::/0 come from?

I was discussing a few options for generation of the default route in BGP, but did not pay much attention to the origin of the default route. How is this route created and put into the routing table?
Well, only routing protocols can import routes to the routing table and this is true for a default route as well. As shown at this picture:

juniper_policy2
…a routing protocol on the left side talks with its neighbours and puts the valid routes into the routing table. This process is controlled by some rules often called policy. Moving to the right side of the picture, routes from the routing table are used to feed another routing protocol (or the same one). This process is straightforward on Juniper routers and sometimes less clear on a Cisco IOS gear, which, at least from the configuration perspective, support some sort of “direct” redistribution between the protocols. But this is not relevant to this discussion – here we just want to stress that the routing protocols are the creators of the routes.

However, the routing protocol might be a very simple one (connected routes and static routing represent a few of the primitives) or something more complex like OSPF or BGP. If we follow the chains from a “birth” of the routes toward its redistribution around the network, we see that most routes originate from the primitives, like interface routes and statics. Complex protocols do create some routes, like summary routes and aggregates, but their primary job (beside the route exchange and propagation, calculating best paths, etc) is to modify the route attributes, like next-hop. The most basic route of all, the default route, often comes from the primitive static. This is how it is born in many networks:

ipv6 route ::/0 Null0 10

[edit routing-options rib inet6.0]
static {
    route ::/0 {
        discard;
        preference 10;
    }
}

(first example is for Cisco IOS, the second one – with a C-style code – is for Juniper JUNOS)
It might be created conditionally, for example if some other routes are present in the routing table:

ipv6 route ::/0 2001:DB8:69:: 9
ipv6 route ::/0 2001:DB8:69:: 9

[edit routing-options rib inet6.0]
generate {
    route ::/0 {
        policy IfDefaultNetworksPresent;
        preference 9;
        community 1:0;
    }
}

The default was born 🙂 and put into the routing table. Let’s push it into the real “life” now and see, how OSPF can grab it and spread it across the network.
In OSPF a redistribution of the default route from a static protocol is not allowed. Well, at least not directly – redistribute static won’t work for the default route. OSPF can take a default from a routing table and originates it further. On Cisco IOS this is accomplished by a special command:

ipv6 router ospf 1
 default-information originate
!

Cisco IOS has another trick – OSPF on the “originator” router can create a default route for its neighbouring routers even if the originator does not have the default route. A keyword “always” does all the magic:

ipv6 router ospf 1
 default-information originate always
!

The default route is always originated into a stub OSPF area without any additional configuration. This behaviour is built-in for OSPF on a area-border-router (ABR). ABR does that even if it does not have the default route itself.

As expected, default-information originate is also used in IS-IS but with no option for the “always” add-on:

router isis
 address-family ipv6
  default-information originate
!

With IS-IS, redistributing a static default route works as for any other static route:

router isis
 address-family ipv6
  redistribute static
!
ipv6 route ::/0 Null0

This way or another we have put the default route in our IGP like OSPF. We can also inject the default into BGP. With Cisco IOS this can be achieved two ways:

  • generation per neighbour with the default-originate command
  • with the network directive (this works for all neighbours)

In both cases the default route must be present in the routing table. Similar to OSPF, BGP cannot redistribute the default route from a routing table – again, redistribute static won’t work for the default route. Here are some examples:

router bgp 1
 address-family ipv6
  neighbor 2001:DB8:12::1 default-originate

router bgp 1
 address-family ipv6
  network ::/0 route-map MarkDefault
  neighbor 2001:DB8:12::1 route-map DefaultOnly out
!
ip bgp-community new-format
ip community-list standard Default permit 1:0
!
route-map MarkDefault permit 10
 set community 1:0
!
route-map DefaultOnly permit 10
 match community Default
!

Juniper JUNOS has somehow more straightforward approach. The default route is taken from the routing table with the export policy (remember the import to/export from RT rule). A policy-statement like this one can be used:

[edit policy-options policy-statement OriginateDefault]
term DefaultRoute {
    from {
        route-filter ::/0 exact;
    }
    then {
        next-hop self;
        accept;
    }
}
term DenyOther {
    then reject;
}


The default route is sometimes treated in a different way than other routes. I see no important reason why. Please, tell me, what is the difference between the two routes, for ::/1 and 8000::/1 respectively, that point to the same directions and one single route for ::/0. Commands like “default-information originate” just confuse people. I find the JUNOS approach much more logical and easy to understand. The default route is just another route! Take it from the routing table and process it within the routing protocol. Then put it back if some conditions are met. As simple as that.

Advertisements