Previous section   Next section

Recipe 9.11 Reducing the Size of the Received Routing Table

9.11.1 Problem

You want to summarize the incoming routing information to reduce the size of your routing table.

9.11.2 Solution

One of the easiest ways to reduce your routing table size is to filter out most of the external routes and replace them with a default. To do this, first create a static default route pointing to some known remote network. If this remote network is up, you can safely assume that your ISP is working properly. Then you simply filter out all of the remaining uninteresting routes:

Router1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ip route 0.0.0.0 0.0.0.0 192.168.101.0 1
Router1(config)#ip route 0.0.0.0 0.0.0.0 192.168.102.0 2
Router1(config)#ip prefix-list CREATE-DEFAULT seq 10 permit 192.168.101.0/24
Router1(config)#ip prefix-list CREATE-DEFAULT seq 20 permit 192.168.102.0/24
Router1(config)#router bgp 65500
Router1(config-router)#neighbor 192.168.1.5 remote-as 65520
Router1(config-router)#neighbor 192.168.1.5 prefix-list CREATE-DEFAULT in
Router1(config-router)#end
Router1#

9.11.3 Discussion

For most typical Internet connections, you will need to drastically reduce the amount of routing information that you receive. A typical Internet backbone router needs to support BGP routes for well over 100,000 prefixes. So, unless you are the ISP and need to support a large fraction of the public address space, it is a good idea to cut out as much as possible. It is important to remember that removing routing information means that some of your routing decisions will not be as good as they might otherwise be, however. There is always a tradeoff involved in filtering routing information.

This recipe shows a good way to drastically reduce the size of your Internet routing table. It looks for two different remote networks on the Internet, 192.168.101.0/24 and 192.168.102.0/24, and points a default route to each of them. This way, if either route happens to fail because of some normal (but hopefully rare) network problem, you will still have a default route. Then we created a prefix list that allows only these two routes, and applied it to all routes that we received from the peer router at our ISP. Please refer to Recipe 9.6 for more information on prefix lists.

The result is a very small Internet routing table that consists of only these two routes and a default route. In practice, you will probably want to use more than two routes, however. Just to guard against the possibility that the remote networks you picked happen to be down at the same time for some reason. It is a good idea to pick a wide variety of different remote networks, some very far away and some relatively close. Avoid picking all of them in the same country, so you won't lose your default just because of a telecom disaster in that country. You could even pick a dozen or so remote routes like this, giving excellent fault tolerance, while still providing a tiny Internet routing table.

Note that the two static routes in the example have different administrative distances:

Router1(config)#ip route 0.0.0.0 0.0.0.0 192.168.101.0 1
Router1(config)#ip route 0.0.0.0 0.0.0.0 192.168.102.0 2

We did this to prevent load balancing between the default routes. If you have more than one ISP, it is quite likely that the best routes for these prefixes will be through different providers. You can allow load balancing, if you prefer, by simply giving all of these static routes the same administrative distance and including the maximum-paths command (as we discussed in Recipe 9.8). But bear in mind that this will balance among routes, not among ISP connections.

If you have only one ISP, load balancing between these default routes accomplishes nothing useful.

If you then want to pass this default route information along to other routers using BGP, the best way to do so is to use the default-originate option on the neighbor command, and include a route map to specify the prefixes that you want to associate with your default route:

Router1(config)#ip prefix-list CREATE-DEFAULT seq 10 permit 192.168.101.0/24
Router1(config)#ip prefix-list CREATE-DEFAULT seq 20 permit 192.168.102.0/24
Router1(config)#route-map DEFAULT-ROUTE permit 10
Router1(config-route-map)#match ip address prefix-list CREATE-DEFAULT
Router1(config-route-map)#exit
Router1(config)#router bgp 65500
Router1(config-router)#neighbor 172.18.5.3 default-originate route-map DEFAULT-ROUTE
Router1(config-router)#exit

This is a dangerous thing to do, though, because BGP will now start to distribute default routing information to this peer, which may then start to distribute the default route out to the Internet. It is a good idea to explicitly suppress the default route on all of your BGP routers for any peers that should not receive it:

Router1(config)#ip prefix-list BLOCK-DEFAULT permit 0.0.0.0/0 ge 1
Router1(config)#router bgp 65500
Router1(config-router)#neighbor 192.168.1.5 prefix-list BLOCK-DEFAULT out

Another popular way to reduce the size of the Internet routing table is to simply refuse to accept any route's /24 prefixes. Over 50% of the routes appearing on the Internet backbone are for /24 prefixes, so eliminating these will cut the memory requirements in half:

Router1(config)#ip prefix-list BLOCK-24 permit 0.0.0.0/0 le 23
Router1(config)#router bgp 65500
Router1(config-router)#neighbor 192.168.1.5 prefix-list BLOCK-24 in

However, if you do this, you should also use a default static route method discussed earlier. This is because many of the /24 prefixes in the Internet routing tables are not included in other prefixes or summary routes.

The fraction of routes appearing on the backbone with a /24 prefix is steadily dropping over time. In early 2001, almost 59% of all prefixes were /24 networks, while over two years later, the number had dropped to roughly 55%. We expect this trend to continue over time, as ISPs improve their route summarization.

9.11.4 See Also

Recipe 9.4; Recipe 9.5; Recipe 9.6; Recipe 9.8


  Previous section   Next section
Top