Reducing the Size of the Received Routing Table


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


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, you first create a static default route pointing to some known remote network. If this remote network is up, then 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 1
Router1(config)#ip route 2
Router1(config)#ip prefix-list CREATE-DEFAULT seq 10 permit
Router1(config)#ip prefix-list CREATE-DEFAULT seq 20 permit
Router1(config)#router bgp 65500
Router1(config-router)#neighbor remote-as 65520
Router1(config-router)#neighbor prefix-list CREATE-DEFAULT in



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 operating 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, and, 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 with two destinations. 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.

Notice the two static routes in the example have different administrative distances:

Router1(config)#ip route 1
Router1(config)#ip route 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. But bear in mind that this will balance among routes, not among ISP connections.

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

If you then want to pass this default route information along to other routers by 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
Router1(config)#ip prefix-list CREATE-DEFAULT seq 20 permit
Router1(config)#route-map DEFAULT-ROUTE permit 10
Router1(config-route-map)#match ip address prefix-list CREATE-DEFAULT
Router1(config)#router bgp 65500
Router1(config-router)#neighbor default-origniate route-map DEFAULT-ROUTE

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. So it is a good idea to explicitly suppress the default route for any peers that should not receive it, and do this on all of your BGP routers:

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

Another popular way to reduce the size of the Internet routing table is to simply refuse to accept any routes /24 prefixes. Over 50 percent of the routes appearing on the Internet backbone are for /24 prefixes. So eliminating them will cut the memory requirements in half:

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

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

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

See Also

Recipe 9.4; Recipe 9.5; Recipe 9.6

Router Configuration and File Management

Router Management

User Access and Privilege Levels


IP Routing





Frame Relay

Handling Queuing and Congestion

Tunnels and VPNs

Dial Backup

NTP and Time


Router Interfaces and Media

Simple Network Management Protocol





First Hop Redundancy Protocols

IP Multicast

IP Mobility




Appendix 1. External Software Packages

Appendix 2. IP Precedence, TOS, and DSCP Classifications


show all menu

Cisco IOS Cookbook
Cisco IOS Cookbook (Cookbooks (OReilly))
ISBN: 0596527225
EAN: 2147483647
Year: 2004
Pages: 505
Similar book on Amazon © 2008-2017.
If you may any questions please contact us: