cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1444
Views
30
Helpful
18
Replies

RIP on Cisco Routers

lamav
Level 8
Level 8

I havent configured RIP on a Cisco router in years. Is it still the same paradigm, in which routers running RIP advertise their entire routing tables to their peers?

I was pretty impressed by Juniper's feature for RIP in which they allow you to create route filters, just as we do in BGP, so that you can control the routes you advertise ("export", using Juniper parlance) to a peer RIP router.

Thanks

Victor

1 Accepted Solution

Accepted Solutions

Victor

If you use an offset-list as suggested by Lucien you are not actually stopping the route being advertised hence your'e not actually saving any bandwidth. The route is still advertised to a neighbor it's just that neighbor doesn't use it because it is has a metric of 16.

A more direct approach is to simply use a distribute list which will actually control which routes are advertised out.

"Show me the configuration on R1 to have R1 advertise only subnets 1.1.1.0/24 and 2.2.2.0/24 to R2."

access-list 1 permit 1.0.0.0

access-list 1 permit 2.0.0.0

router rip

distribute-list 1 out fa0/1 <-- where fa0/1 connects to R2

Jon

View solution in original post

18 Replies 18

Lucien Avramov
Level 10
Level 10

You can also control on cisco with RIP what routes are advertised

How?

For example you can use an offset list and for specific subnets, change the metric. That will those subnets will either be advertized with a maximum metric or received with a maximum metric and hence will not be in the routing table.

http://www.cisco.com/en/US/docs/ios/12_1/iproute/command/reference/1rdrip.html#wp1017883

Im not sure thats the same thing. Im not talking about manipulating hop counts to have some sort of effect on advertisements or some other clunky mechanism. Im talking about a basic filter that operates just like BGP.

i disagree. rip and bgp are different protocols.

in about a similar number of commands you can configure rip with an offset list inbound or outbound than bgp with a filter list.

it is possible to filter routes with rip.

OK, imagine I have two routers, R1 and R2, exchanging RIP routes with each other. Each router has 30 RIP routes in their routing tables.

Show me the configuration on R1 to have R1 advertise only subnets 1.1.1.0/24 and 2.2.2.0/24 to R2.

Thanks

Okay so the configuration would be then only on R1.

router rip

offset-list 1 out 16 f0/0

network 1.0.0.0

network 2.0.0.0

network 3.0.0.0

network 4.0.0.0

network x.x.x.x -> list of all the other 30 networks that are advertized by R1

Routes you do not want to advertise, you create an acl:

access-list 1 permit 3.0.0.0

access-list 1 permit 4.0.0.0

..

For a long list, you actually do the binary calculation in order to simplify the ACL to one line.

Then you apply this offset list on router rip.

R2, will only install the routes that are not in the ACL, as per debug ip rip:

1.0.0.0 in 1 hops

2.0.0.0 in 1 hops

3.0.0.0 in 16 hops (inaccessible)

4.0.0.0 in 16 hops (inaccessible)

X.0.0.0 in 16 hops (inaccessible)

There is no feature such as BGP where you can use REGEXP and advertise depending on the next hop. Nevertheless with RIP this scenario would be possible, but I would be applying the offset-list on the receiving routers and not the outbound, that way you can control who receives what.

Yes it's not like BGP, RIP is different, but you can control the routes with offset-list. Else just redistribute RIP in BGP and filter with BGP.

Interesting.

So, what you are saying is that you creae an ACL for routes you do NOT want to advertise so that you can attach it to an offset list with a hop count of 16, effectively invalidating the route.

What if you wanted to do the opposite? Only ALLOW those routes and deny everything else?

And what happens wen you have 300 routes in your IP table?

Thanks

Well your question was how to only advertize certain routes from R1 to R2. Since you had 30 routes and wanted to advertise only one, I blocked all the others you did not want and applied it outbound of R1. :)

Now let's say you want only to allow certain routes and nothing else, you could then have an ACL where you DENY those you want to advertise and allow everything else with a permit any.

Then you apply the same offset with 16 and the denied entries will not have an increased offset and hence will be advertized.

Example, you want only to allow 1.0.0.0 subnet and do not send anything else from R1 to R2:

access-list 1 deny 1.0.0.0

access-list 1 permit any

Then under router rip

offset-list 1 out 16 f0/0

Make sense?

If you have 300 routes, well you're permit any statement will not advertise any of them, so it's not a problem, you won't have a scalability issue.

Also, you could filter the routes on R2, to allow only certain routes on R2 routing table.

It will all depend on the exact requirements you have. Then you will either apply outbound of R1 or inbound of R2.

"Well your question was how to only advertize certain routes from R1 to R2. Since you had 30 routes and wanted to advertise only one, I blocked all the others you did not want and applied it outbound of R1. :)"

Actually I asked to block everything but 2 routes. Your config showed ow to allow everything and block those two routes.

Anyway, I understand the approach now. It seems a bit clumsy, but I can see that it will work.

By he way, I dont compare RIP with BGP. The point I was making is that the Juniper routers make it as easy and straighforward to filter routes in RIP as it is in BGP.

Thanks

I know what you asked. On purpose I showed you how to block 28 routes. You can achieve so with 1 acl line instead of 3 lines where you would only permit 1.1.1.0 and 2.2.2.0 subnet and block everything else. That was more elegant and shorter solution to me.

The approach would work with 300 routes, and would be just a few lines of commands as with BGP.

I dont know about Juniper implementation. If you have a document I would be interested to find out and compare.

Victor

If you use an offset-list as suggested by Lucien you are not actually stopping the route being advertised hence your'e not actually saving any bandwidth. The route is still advertised to a neighbor it's just that neighbor doesn't use it because it is has a metric of 16.

A more direct approach is to simply use a distribute list which will actually control which routes are advertised out.

"Show me the configuration on R1 to have R1 advertise only subnets 1.1.1.0/24 and 2.2.2.0/24 to R2."

access-list 1 permit 1.0.0.0

access-list 1 permit 2.0.0.0

router rip

distribute-list 1 out fa0/1 <-- where fa0/1 connects to R2

Jon

Distribute-list is another alternative.

Lucien

"With a distribute list, the routes will be deleted on r1 and that wont be possible"

You could simply apply the distribute list inbound on the receiving routers rather than outbound on r1. This would not stop the routes being advertised from r1 though.

If you only want to control which routes are advertised or which routes are accepted then distribute-lists are really the way to go. Using offset-lists for this function does, as Victor noted, seem rather cumbersome.

Offset lists would be more use when you still want the routes to be advertised but you want to influence which is used.

Jon

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco