Quantcast
Channel: CCNP Recertification » Routing
Viewing all articles
Browse latest Browse all 10

Default routes

$
0
0

The other day I ran into some problems with a default route, which prompted a discussion with co-workers, which led me to look up the behavior of redistributing a static default route into a dynamic routing protocol.

Take, for example, the following


 ! default route
 ip route 0.0.0.0 0.0.0.0 1.1.1.1
 ! pick your routing protocol
 router XXXXX
    redistribute static

Under what conditions will the default route make it into the routing protocol? The docs seem to indicate that the process is automatic in EIGRP, but requires intervention in IS-IS, OSPF, and BGP. Let's validate.

Take a simple network:


1.1.1.0/24 [R1] 2.2.2.0/24 [R2] 3.3.3.0/24 [R3]

(dynagen .net)

On R1, I have


router eigrp 1
 redistribute static
 network 1.0.0.0
 network 2.0.0.0
 no auto-summary
!
ip route 0.0.0.0 0.0.0.0 1.1.1.99

and over on R3


D*EX 0.0.0.0/0 [170/33280] via 3.3.3.1, 00:01:00, FastEthernet0/0

One thing to note is that the network statement specified 1.1.1.0 and 2.2.2.0, and not 0.0.0.0. This is because the network statement in the EIGRP config is used to match the interfaces that EIGRP will run on, which is where the network information comes from. network 0.0.0.0 would match both interfaces, but still would not add the default route. The redistribute static is what causes the route to get into EIGRP (which is why it shows up in R3's routing table as D*EX)

In OSPF, we have on R1


router ospf 1
 log-adjacency-changes
 redistribute static subnets
 network 0.0.0.0 255.255.255.255 area 0

This time I used network 0.0.0.0 to save some typing. However R3 does not see the default route. It does see another static route I put in to 9.9.9.0/24, so we know redistribution works properly.

The solution here is the default-information originate command. Adding "default-information originate" to the OSPF config solves this:


O*E2 0.0.0.0/0 [110/1] via 3.3.3.1, 00:00:02, FastEthernet0/0

For BGP, R1 is set up as follows:


R1#show run | section router bgp
router bgp 1
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.0
 network 2.2.2.0
 neighbor 2.2.2.2 remote-as 2
 no auto-summary

If I redistribute static, the default route does not show up on R2:


R2#show ip route bgp
     9.0.0.0/24 is subnetted, 1 subnets
B       9.9.9.0 [20/0] via 2.2.2.1, 00:00:31

At least two options exist. 1 is to do the "default-information originate" which allows the static route to be redistributed into BGP. The other is to not redistribute, but use the network 0.0.0.0 command to advertise the default route. In BGP, the network statement specifies the routes to be advertised, and not the interfaces like OSPF and EIGRP.

The difference between the two options, though, is in the BGP attributes.


! redistribute static and default-information originate
R2#show ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 8
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Not advertised to any peer
  1
    2.2.2.1 from 2.2.2.1 (2.2.2.1)
      Origin incomplete, metric 0, localpref 100, valid, external, best
! network 0.0.0.0
R2# show ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 12
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
  Not advertised to any peer
  1
    2.2.2.1 from 2.2.2.1 (2.2.2.1)
     Origin IGP, metric 0, localpref 100, valid, external, best

The difference here is that advertising a local network marks the origin as IGP, but a redistribution marks it as incomplete. Look at step 5 of the BGP best path selection algorithm to see that IGP is preferred over incomplete (even though by the time origin is compared, weight, local preference, and AS_PATH length have already been compared)

So, the moral of the story is to watch how your default routes go into your routing protocol, because depending on the protocol, it's handled differently.

Content Copyright Sean Walberg

Default routes


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images