Showing posts with label route summarization. Show all posts
Showing posts with label route summarization. Show all posts

Saturday, February 14, 2009

Watch the RIP metric when summarizing redistributed routes

I was reading through the GS archives and saw this interesting issue about the metrics of summarized routes after being redistributed into RIP.

Scenario:

R1---RIP---R2---OSPF---R5---5.5.5.5/32

R2 is redistributing OSPF to RIP as follows:
R2#sho run | sec router rip
router rip
version 2
redistribute ospf 1 metric 2
network 192.168.0.0
no auto-summary
R1 has the following route:
R1#sho ip route | sec 5.0.0.0
5.0.0.0/32 is subnetted, 1 subnets
R 5.5.5.5 [120/2] via 192.168.0.2, 00:00:11, FastEthernet0/0
1) Manual Summary
R2(config)#int f0/0
R2(config-if)#ip summary-address rip 5.0.0.0 255.0.0.0

R1#sho ip route | sec 5.0.0.0
R 5.0.0.0/8 [120/3] via 192.168.0.2, 00:00:01, FastEthernet0/0
The metric increased by 1.

2) Auto-summary
R2(config-if)#router rip
R2(config-router)#auto-summary

R1#sho ip route | sec 5.0.0.0
R 5.0.0.0/8 [120/2] via 192.168.0.2, 00:00:05, FastEthernet0/0
The metric is the same as when redistributed.

Tuesday, September 23, 2008

IPv6: Summarizing OSPFv3 addresses

This is from IPexpert volume 1 section 22. We have to summarize the following routes:

2020:100:100:2222::/64
2020:100:100:2666::/64

This is how I do it:

1) Identify the hextet ( I don't know if this is a word, I derived it from octet) where we will summarize. This is the 4th hextet. So we know our subnet will be somewhere between /48 and /64.

2) Break it down in binary:

2222 = 0010 0010 0010 0010
2666 = 0010 0110 0110 0110

Converting hex to binary is easy because we just treat each digit in the IPv6 address as a 4 bit binary number by itself. Notice how all the 2's broke down to 0010.

3) Find the common bits. I highlighted them in red below. We have 5 of them. We will use to get our mask.

2222 = 0010 0010 0010 0010
2666 = 0010 0110 0110 0110

4) Set the rest if the bits to 0 and calculate the summary, convert to hex.

summary = 0010 0000 0000 0000 = 2000

5) Calculate subnet mask by adding the common bits to the lower of our subnet range. This means we add 5 to /48 which makes /53.

So our summary address is 2020:100:100:2000::/53

In OSPFv3 we would enter:

R2(config)#ipv6 router ospf 1
R2(config-rtr)#area 1 range 2020:100:100:2000::/53

Check our other routers for the summary:

R4#show ipv6 route | inc 53
OI 2020:100:100:2000::/53 [110/129]

Sunday, August 10, 2008

EIGRP - summarization with leak-map

R7 has three loopbacks:

172.29.17.7/24
172.29.18.7/24
172.29.19.7/24

And it is connected to a few routers including R8. You want R7 to summarize the networks but also advertise a specific route of 172.29.18.0/24 to R8. Here's how:

R7:

access-list 18 permit 172.29.18.0 0.0.0.255
!
route-map LEAK18
match ip address 18
!
int s0/0/0
ip summary-address eigrp 1001 172.29.16.0 255.255.252.0 leak-map LEAK18


Now on R8:

R8#show ip route | in 172
172.29.0.0/16 is variably subnetted, 2 subnets, 2 masks
D 172.29.16.0/22 [90/20640000] via 150.100.78.7, 00:03:31, Serial0/0/0
D 172.29.18.0/24 [90/20640000] via 150.100.78.7, 00:01:04, Serial0/0/0


Easy, eh?

Tuesday, July 8, 2008

BGP - Aggregation with advertise-map

R1,R2 and R3 connect to R5 via Frame-relay:


These 3 spokes are EBGP peers with R5.
These routes are advertised into bgp:

R1, loopback 150.1.1.1 AS1
R2, loopback 150.1.2.2 AS2
R3, loopback 150.1.3.3 AS3
R5, loopback 150.1.5.5 AS5

Here are R3's and R5's BGP table before any aggregation:

R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 150.1.1.0/24 155.1.0.1 0 0 1 i
*> 150.1.2.0/24 155.1.0.2 0 0 2 i
*> 150.1.3.0/24 155.1.0.3 0 0 3 i
*> 150.1.5.0/24 0.0.0.0 0 32768 i

R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 150.1.1.0/24 155.1.0.1 0 5 1 i
*> 150.1.2.0/24 155.1.0.2 0 5 2 i
*> 150.1.3.0/24 0.0.0.0 0 32768 i
*> 150.1.5.0/24 155.1.0.5 0 0 5 i


Suppose R5 wants to advertise a summary-only aggregate to R3:

R5(config)#router bgp 5
R5(config-router)#aggregate-address 150.1.0.0 255.255.248.0 as-set summary-only


R3 will deny the route because of the as-set option which forces R5 to include the AS numbers as an unordered set in the AS PATH:

R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 150.1.3.0/24 0.0.0.0 0 32768 i

R3#debug ip bgp updates
00:37:37: BGP(0): 155.1.0.5 rcv UPDATE w/ attr: nexthop 155.1.0.5, origin i, aggregated by 5 150.1.5.5, originator 0.0.0.0, path 5 {1,2,3}, community , extended community
00:37:37: BGP(0): 155.1.0.5 rcv UPDATE about 150.1.0.0/21 -- DENIED due to: AS-PATH contains our own AS;
R3#


We can have R5 remove R3's attributes (AS PATH) in the aggregate by using an advertise-map. This will allow R3 to recieve the aggregate.

First we create a prefix-list to match the route:

R5(config)#ip prefix-list R3 permit 150.1.3.0/24

The we create a route-map, note that we are denying the prefix. This means any matches will NOT have their attributes populated to the aggregate's attributes:

R5(config)#route-map DENY3 deny 10
R5(config-route-map)#match ip address prefix-list R3
R5(config-route-map)#exit
R5(config)#route-map DENY3 permit 20
R5(config-route-map)#exit


Finally, we apply the advertise-map to the aggregate-address command under the bgp process:

R5(config)#router bgp 5
R5(config-router)#aggregate-address 150.1.0.0 255.255.248.0 as-set summary-only advertise-map DENY3


Here are the final results:

R5#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 150.1.0.0/21 0.0.0.0 32768 {1,2} i
s> 150.1.1.0/24 155.1.0.1 0 0 1 i
s> 150.1.2.0/24 155.1.0.2 0 0 2 i
s> 150.1.3.0/24 155.1.0.3 0 0 3 i
s> 150.1.5.0/24 0.0.0.0 0 32768 i
R5#

R3#
00:46:26: BGP(0): 155.1.0.5 update run completed, afi 0, ran for 4ms, neighbor v
ersion 35, start version 38, throttled to 38
00:46:26: BGP(0): 155.1.0.5 rcvd UPDATE w/ attr: nexthop 155.1.0.5, origin i, at
omic-aggregate, aggregated by 5 150.1.5.5, path 5 {1,2}
00:46:26: BGP(0): 155.1.0.5 rcvd 150.1.0.0/21
00:46:26: BGP(0): Revise route installing 150.1.0.0/21 -> 155.1.0.5 to main IP t
able
R3#

R3#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
*> 150.1.0.0/21 155.1.0.5 0 5 {1,2} i
*> 150.1.3.0/24 0.0.0.0 0 32768 i
R3#


Notice that the aggregate only has AS1 and AS2 in the AS PATH. This allows R3 to install the aggregate in it's BGP table.

Monday, July 7, 2008

EIGRP - ip default-network command

I hate this command, I think it's unbelievably ....... But here we go. I am going to show some outputs of each router's route table along the way.

[R4]====[R5]

R4 and R5 have two links between each other.
R5 has a loopback 155.1.5.5 being advertised to R4

Before:

R5# show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
D 155.1.4.0 [90/2297856] via 155.1.45.4, 00:00:04, Serial1/1
[90/2297856] via 10.0.0.4, 00:00:04, Serial1/0
C 155.1.5.0 is directly connected, Loopback0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0

R4#show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
C 155.1.4.0 is directly connected, Loopback0
D 155.1.5.0 [90/2297856] via 155.1.45.5, 00:07:36, Serial1/1
[90/2297856] via 10.0.0.5, 00:07:36, Serial1/0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


------------------------------------------------------------------

Now on R5 we enter:

R5(config)#ip default-network 155.1.5.0

Notice what this does to R5's route-table. It modifies the first line to read 155.1.0.0/16 and puts a static route with admin distance of 1 pointing to network 155.1.5.0. However this is not enough to pass the default route to R4.

R5# show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
S 155.1.0.0/16 [1/0] via 155.1.5.0
D 155.1.4.0/24 [90/2297856] via 155.1.45.4, 00:01:17, Serial1/1
[90/2297856] via 10.0.0.4, 00:01:17, Serial1/0
C 155.1.5.0/24 is directly connected, Loopback0
C 155.1.45.0/24 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0

R5#show run | inc ip route
ip route 155.1.0.0 255.255.0.0 155.1.5.0
R5#


R4 is the same:

R4#show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
C 155.1.4.0 is directly connected, Loopback0
D 155.1.5.0 [90/2297856] via 155.1.45.5, 00:10:44, Serial1/1
[90/2297856] via 10.0.0.5, 00:10:44, Serial1/0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


------------------------------------------------------------------

Now we enter another default-network command on R5, this time pointing to a classful network. Notice that the static route now has * next to it which means it is a candidate default route. In fact, the gateway of last resort is now set.

R5# show ip route | begin Gateway
Gateway of last resort is 155.1.5.0 to network 155.1.0.0

* 155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
S* 155.1.0.0/16 [1/0] via 155.1.5.0
D 155.1.4.0/24 [90/2297856] via 155.1.45.4, 00:03:40, Serial1/1
[90/2297856] via 10.0.0.4, 00:03:40, Serial1/0
C 155.1.5.0/24 is directly connected, Loopback0
C 155.1.45.0/24 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


This command shows up as default network

R5#show run
(output omitted)
ip default-network 155.1.0.0
ip route 155.1.0.0 255.255.0.0 155.1.5.0


R4 is still the same:

R4#show ip route | begin Gateway
Gateway of last resort is not set

155.1.0.0/24 is subnetted, 3 subnets
C 155.1.4.0 is directly connected, Loopback0
D 155.1.5.0 [90/2297856] via 155.1.45.5, 00:13:07, Serial1/1
[90/2297856] via 10.0.0.5, 00:13:07, Serial1/0
C 155.1.45.0 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0


------------------------------------------------------------------

Let's get that puppy over to R4:

R5(config-router)#redistribute static

R4#show ip route | begin Gateway
Gateway of last resort is 155.1.45.5 to network 155.1.0.0

155.1.0.0/16 is variably subnetted, 4 subnets, 2 masks
D*EX 155.1.0.0/16 [170/2297856] via 155.1.45.5, 00:05:01, Serial1/1
[170/2297856] via 10.0.0.5, 00:05:01, Serial1/0
C 155.1.4.0/24 is directly connected, Loopback0
D 155.1.5.0/24 [90/2297856] via 155.1.45.5, 00:22:36, Serial1/1
[90/2297856] via 10.0.0.5, 00:22:36, Serial1/0
C 155.1.45.0/24 is directly connected, Serial1/1
C 10.0.0.0/8 is directly connected, Serial1/0
R4#


Basically you need to remember that the default-network needs a classful address in order to mark the route as a candidate default. Then you must redistribute it in order to advertise it.

I don't understand why you would want to use this command. Maybe someone else can chime in?

Saturday, July 5, 2008

EIGRP - Automatic Summarization

I dont like auto-summarization, especially since you can always manual summarize networks as you please in EIGRP. But it seems to be enabled by default in all the IOS versions I use and it's probably a good idea to know how it works for the lab.

EIGRP auto-summarizes at classful network boundaries. This means that if one interface is in 1.1.0.0/16 and another interface is in 2.2.2.0/24 then EIGRP will summarize the networks before advertising them out of the opposite interface. This is because each subnet belongs to a separate major classful network: 1.0.0.0/8 and 2.0.0.0/8 in this case.

However if you have one interface in 2.2.2.0/24 and another interface in 2.3.0.0 then auto-summarization will not take affect because both interfaces belong to the major network 2.0.0.0/8. EIGRP may auto-summarize for some networks and not others in the same EIGRP process. Here we take a look:

[R1]----[R2]

R1 and R2 are connected to the same LAN 12.0.0.0/16

R1 has two loopbacks:

R1#show run | section interface Loopback
interface Loopback0
ip address 1.1.1.1 255.255.255.255
interface Loopback1
ip address 12.1.1.1 255.255.255.0

R2 also has two loopbacks:

R2#show run | section interface Loopback
interface Loopback0
ip address 2.2.2.2 255.255.255.255
interface Loopback1
ip address 12.2.2.2 255.255.255.0

All interface have EIGRP enabled with auto-summary on (default).

R1's route table:

R1#show ip route | begin Gate
Gateway of last resort is not set

1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.1.1/32 is directly connected, Loopback0
D 1.0.0.0/8 is a summary, 00:09:40, Null0
D 2.0.0.0/8 [90/156160] via 12.0.0.2, 00:09:34, FastEthernet0/0
12.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
D 12.2.2.0/24 [90/156160] via 12.0.0.2, 00:09:43, FastEthernet0/0
C 12.1.1.0/24 is directly connected, Loopback1
C 12.0.0.0/16 is directly connected, FastEthernet0/0
D 12.0.0.0/8 is a summary, 00:09:40, Null0

R2's route table:

R2#show ip route | begin Gate
Gateway of last resort is not set

D 1.0.0.0/8 [90/156160] via 12.0.0.1, 00:19:01, FastEthernet0/0
2.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 2.2.2.2/32 is directly connected, Loopback0
D 2.0.0.0/8 is a summary, 00:18:55, Null0
12.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
C 12.2.2.0/24 is directly connected, Loopback1
D 12.1.1.0/24 [90/156160] via 12.0.0.1, 00:00:02, FastEthernet0/0
C 12.0.0.0/16 is directly connected, FastEthernet0/0
D 12.0.0.0/8 is a summary, 00:18:55, Null0
R2#


Analysis:

Looking at R1's route table you can see that R2 has summarized the route 2.2.2.2/32 into 2.0.0.0/8. This is because R2 sits in the boundary between two classful networks 12.0.0.0 and 2.0.0.0. It does not summarize loopback 1 which is 12.2.2.0/24. This shows up on R1 with the 24 bit mask.

On R2 the same can be said for routes from R1. R1 summarizes it's loopback0 interface into 1.0.0.0/8 because it sits on the boundary between 1.0.0.0 and 12.0.0.0. It does not summarize 12.1.1.1/24.

RIP version 2 auto-summarization works pretty much the same way as far as I can tell. If you know any differences please let me know.

No Supernetting in RIP

It isn't very often you learn something new about RIP, but here is something I found out today: NO SUPERNETTING WITH RIP!

R1(config)#int lo 100
R1(config-if)#ip address 100.0.0.1 255.0.0.0
R1(config-if)#int lo 101
R1(config-if)#ip address 101.0.0.1 255.0.0.0
R1(config-if)#int f2/0
R1(config-if)#ip summary-address rip 100.0.0.0 254.0.0.0
Summary mask must be greater or equal to major net
R1(config-if)#

Friday, July 4, 2008

RIPv1 vs RIPv2 Part II

rip weirdness

R1---FR---R2----2.0.0.0/8
| ----R3----|

R1-R2 is 12.0.0.0/8
R1-R3 is 13.0.0.0/8
R2-R3 is 23.0.0.0/8

RIP (default send v1, receive v1,v2) everywhere

R1's route table:

R1#show ip route | begin Gateway
Gateway of last resort is not set

1.0.0.0/16 is subnetted, 1 subnets
C 1.0.0.0 is directly connected, FastEthernet0/0
R 2.0.0.0/8 [120/1] via 13.0.0.3, 00:00:00, Serial1/1
[120/1] via 12.0.0.2, 00:00:00, Serial1/0
R 23.0.0.0/8 [120/1] via 13.0.0.3, 00:00:00, Serial1/1
[120/1] via 12.0.0.2, 00:00:00, Serial1/0
R 10.0.0.0/8 [120/1] via 13.0.0.3, 00:00:00, Serial1/1
[120/1] via 12.0.0.2, 00:00:00, Serial1/0
C 12.0.0.0/8 is directly connected, Serial1/0
C 13.0.0.0/8 is directly connected, Serial1/1
R1#

How could R1 have two equal routes to 2.0.0.0/8?

It should be 1 hop through R2
It should be 2 hops through R3

right?

What do you think?

Well let's do version 2 with no auto-summary:

R1#show ip route | begin Gateway
Gateway of last resort is not set

1.0.0.0/16 is subnetted, 1 subnets
C 1.0.0.0 is directly connected, FastEthernet0/0
R 2.0.0.0/8 [120/1] via 12.0.0.2, 00:00:00, Serial1/0
R 23.0.0.0/8 [120/1] via 13.0.0.3, 00:00:00, Serial1/1
[120/1] via 12.0.0.2, 00:00:00, Serial1/0
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R 10.3.0.0/16 [120/1] via 13.0.0.3, 00:00:00, Serial1/1
R 10.0.0.0/8 is possibly down,
routing via 12.0.0.2, Serial1/0
C 12.0.0.0/8 is directly connected, Serial1/0
C 13.0.0.0/8 is directly connected, Serial1/1

What is really going on with RIP version 1? I have no idea...if you do, please let me know.

RIPv1 vs RIPv2

LAN1---R1---FR---R2---LAN2

LAN1 = 10.1.0.0/16
FRAME = 12.0.0.0/8
LAN2 = 10.2.0.0/16

RIP on all interfaces.

When version 1 is in use, here are the route tables:

R1:

R1#show ip route | begin Gateway
Gateway of last resort is not set

10.0.0.0/16 is subnetted, 1 subnets
C 10.1.0.0 is directly connected, FastEthernet0/0
C 12.0.0.0/8 is directly connected, Serial1/0
R1#

R2:

R2#show ip route | begin Gateway
Gateway of last resort is not set

10.0.0.0/16 is subnetted, 1 subnets
C 10.2.0.0 is directly connected, FastEthernet0/0
C 12.0.0.0/8 is directly connected, Serial1/0
R2#

Now Let's enable RIP version 2, but with auto-summary:

R1(config)#router rip
R1(config-router)#ve 2

R2(config)#router rip
R2(config-router)#v 2

Another look at the route tables.

R1#show ip route | begin Gateway
Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R 10.0.0.0/8 [120/1] via 12.0.0.2, 00:00:07, Serial1/0
C 10.1.0.0/16 is directly connected, FastEthernet0/0
C 12.0.0.0/8 is directly connected, Serial1/0
R1#

R2#show ip route | begin Gateway
Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.2.0.0/16 is directly connected, FastEthernet0/0
R 10.0.0.0/8 [120/1] via 12.0.0.1, 00:00:17, Serial1/0
C 12.0.0.0/8 is directly connected, Serial1/0
R2#

Notice that the 10.0.0.0/8 network shows up on both routers! Watch out for the loop:

R1#trace 10.3.3.3

Type escape sequence to abort.
Tracing the route to 10.3.3.3

1 12.0.0.2 72 msec 16 msec 8 msec
2 * * *
3 * * *
4 * * *
5 * * *
6 *

I think this packet is looping, R1 can't really send a time-exceeded message to itself so we see the "*". If I am wrong, please correct me.

Let's disable auto-summary now and then check the tables again:

R1(config)#router rip
R1(config-router)#no auto-summary
R1#clear ip route *

R2(config)#router rip
R2(config-router)#no auto-summary
R2#clear ip route *

R1#show ip route | begin Gateway
Gateway of last resort is not set

10.0.0.0/16 is subnetted, 2 subnets
R 10.2.0.0 [120/1] via 12.0.0.2, 00:00:01, Serial1/0
C 10.1.0.0 is directly connected, FastEthernet0/0
C 12.0.0.0/8 is directly connected, Serial1/0
R1#

R2#show ip route | begin Gateway
Gateway of last resort is not set

10.0.0.0/16 is subnetted, 2 subnets
C 10.2.0.0 is directly connected, FastEthernet0/0
R 10.1.0.0 [120/1] via 12.0.0.1, 00:00:14, Serial1/0
C 12.0.0.0/8 is directly connected, Serial1/0
R2#

That's looks right now but rraceroute doesn't get much better:

R1#trace 10.3.3.3

Type escape sequence to abort.
Tracing the route to 10.3.3.3

1 * * *
2 * * *
3 * * *
4 * * *
5 * * *
6 * *

Not really sure why traceroute doesn't die...got any ideas?

Monday, June 9, 2008

BGP aggregation with unsuppress-map option

In a previous post we learned how to aggregate BGP routes and use the suppress-map to suppress certain component routes from being advertised. With the summary-only option on the aggregate-address command you can suppress ALL component subnets. Suppose you had a bunch of component routes but only wanted to advertise a few, it would be a lot of work to make that big of a suppress-map. I don't know the exact reason behind this, but you can instead use the summary-only option of the aggregate-address command and then use an unsuppress-map to advertise the few component subnets you want. Here's how:

Topology:
R1 [AS 100] connects to R2 [AS 200]

R1 is currently summarizing a bunch of subnets in the 1.0.0.0/8 range.

R1# show ip route | in C
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
C 1.1.1.1/32 is directly connected, Loopback0
C 1.3.3.3/32 is directly connected, Loopback3
C 1.2.2.2/32 is directly connected, Loopback2
C 1.5.5.5/32 is directly connected, Loopback5
C 1.4.4.4/32 is directly connected, Loopback4
C 1.7.7.7/32 is directly connected, Loopback7
C 1.6.6.6/32 is directly connected, Loopback6

R1 is configured as such:

router bgp 100
no synchronization
bgp log-neighbor-changes
network 1.1.1.1 mask 255.255.255.255
network 1.2.2.2 mask 255.255.255.255
network 1.3.3.3 mask 255.255.255.255
network 1.4.4.4 mask 255.255.255.255
network 1.5.5.5 mask 255.255.255.255
aggregate-address 1.0.0.0 255.0.0.0 summary-only
neighbor 172.12.12.2 remote-as 200
neighbor 172.12.14.4 remote-as 100

The following route shows up on R2:

R2#show ip bgp | begin Network
Network Next Hop Metric LocPrf Weight Path
* 1.0.0.0 172.12.23.3 0 300 100 i
*> 172.12.12.1 0 100 i

As you can see we are supressing all of the 1.0.0.0 subnets. Suppose we wanted to advertise one of the subnets as well, to do so we can use the unsuppress-map option on the neighbor command.

On R1:

R1(config)#access-list 12 permit 1.1.1.1
R1(config)#access-list 12 permit 1.2.2.2
R1(config)#access-list 12 permit 1.3.3.3
R1(config)#route-map ALLOW
R1(config-route-map)#match ip address 12
R1(config-route-map)#exit
R1(config)#router bgp 100
R1(config-router)#neighbor 172.12.12.2 unsuppress-map ALLOW

Clear BGP:

R1#clear ip bgp *
R1#
00:41:47: %BGP-5-ADJCHANGE: neighbor 172.12.12.2 Down User reset
00:42:28: %BGP-5-ADJCHANGE: neighbor 172.12.12.2 Up

Now on R2 we have "unsuppressed" 3 routes:

R2#show ip bgp | inc 1\.
* 1.0.0.0 172.12.23.3 0 300 100 i
*> 1.1.1.1/32 172.12.12.1 0 0 100 i
*> 1.2.2.2/32 172.12.12.1 0 0 100 i
*> 1.3.3.3/32 172.12.12.1 0 0 100 i

BGP aggregation with suppress-map

This scenario involves use of the suppress-map with BGP aggregate-address command. It is fairly simple to understand but I could use the practice.

R1 is getting the following routes from R2 in AS 200:

R1#show ip bgp | Begin Network
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 172.12.12.22 0 0 200 i
r> 2.2.2.3/32 172.12.12.22 0 0 200 i
*> 200.1.1.2/32 172.12.12.22 0 0 200 i
*> 200.2.2.2/32 172.12.12.22 0 0 200 i
*> 200.3.3.2/32 172.12.12.22 0 0 200 i

On R2 we can configure aggregation with the following command:

R2(config-router)#aggregate-address 200.0.0.0 255.0.0.0

Without clearing BGP, here is R1's BGP table with the aggregate 200.0.0.0/8:

R1#show ip bgp | Begin Network
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 172.12.12.22 0 0 200 i
r> 2.2.2.3/32 172.12.12.22 0 0 200 i
*> 200.0.0.0/8 172.12.12.22 0 0 200 i
*> 200.1.1.2/32 172.12.12.22 0 0 200 i
*> 200.2.2.2/32 172.12.12.22 0 0 200 i
*> 200.3.3.2/32 172.12.12.22 0 0 200 i

Suppose we wanted to suppress only some of the "component routes", but not all. With the summary-only keyword we would suppress all, but with a suppress-map we can supress a few.

on R2 we add the following:

access-list 50 permit 200.1.1.2
access-list 50 permit 200.3.3.2
!
route-map BLOCK permit 10
match ip address 50
!
router bgp 200
aggregate-address 200.0.0.0 255.0.0.0 suppress-map BLOCK
!

Note that the access-list "permits" the networks and the supress-map matches whatever networks are permitted by the ACL and suppresses them.

Now on R1 we have:

R1#show ip bgp | Begin Network
Network Next Hop Metric LocPrf Weight Path
*> 2.2.2.2/32 172.12.12.22 0 0 200 i
r> 2.2.2.3/32 172.12.12.22 0 0 200 i
*> 200.0.0.0/8 172.12.12.22 0 0 200 i
*> 200.2.2.2/32 172.12.12.22 0 0 200 i

Monday, June 2, 2008

OSPF - summarizing routes

This post will go over two ways of summarizing routes in OSPF.

1. Summarizing inter-area OSPF routes on the ABR
2. Summarizing external routes on the ASBR

Here is the topology we will use

R1 <---area0---> R2 <---area3---> R3

R2 is the ABR, R3 is the ASBR
R3 has two loopbacks 3.3.3.3 and 4.4.4.4.
3.3.3.3 is being redistributed so it enters ospf as an external route
4.4.4.4 is being advertised via the network statement so it shows up as an inter- area route on R1.

Here is R1's route table:

R1#show ip route | begin Gateway
Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 172.12.12.2, 00:15:57, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
O E1 3.3.3.3 [110/158] via 172.12.12.2, 00:02:42, Serial1/0
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/129] via 172.12.12.2, 00:15:57, Serial1/0
172.12.0.0/24 is subnetted, 2 subnets
C 172.12.12.0 is directly connected, Serial1/0
O IA 172.12.23.0 [110/128] via 172.12.12.2, 00:15:57, Serial1/0

For the first case we perform summarization with the 'area x range' command on R2:

R2(config)#router ospf 1
R2(config-router)#area 3 range 4.0.0.0 255.0.0.0

now check R1;

R1#show ip route | begin Gateway
Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 172.12.12.2, 00:19:27, Serial1/0
3.0.0.0/32 is subnetted, 1 subnets
O E1 3.3.3.3 [110/158] via 172.12.12.2, 00:02:29, Serial1/0
O IA 4.0.0.0/8 [110/129] via 172.12.12.2, 00:02:34, Serial1/0
172.12.0.0/24 is subnetted, 2 subnets
C 172.12.12.0 is directly connected, Serial1/0
O IA 172.12.23.0 [110/128] via 172.12.12.2, 00:19:27, Serial1/0

4.4.4.4/32 is now being summarized as 4.0.0.0/8

Now on to case 2, summarizing an external route. This needs to be done on R3, the ASBR that is redistributing loopback 3.3.3.3 into OSPF.

On R3:

R3(config)#router ospf 1
R3(config-router)#summary-address 3.0.0.0 255.0.0.0

Verify on R1:

R1#show ip route | begin Gateway
Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 172.12.12.2, 00:21:15, Serial1/0
O E1 3.0.0.0/8 [110/158] via 172.12.12.2, 00:00:32, Serial1/0
O IA 4.0.0.0/8 [110/129] via 172.12.12.2, 00:04:22, Serial1/0
172.12.0.0/24 is subnetted, 2 subnets
C 172.12.12.0 is directly connected, Serial1/0
O IA 172.12.23.0 [110/128] via 172.12.12.2, 00:21:15, Serial1/0

3.3.3.3/32 has now been summarized into 3.0.0.0/8

In summary,

Inter-area routes are summarized on the ABR
External routes are summarized on the ASBR
NSSA-External routes can be summarized on the ASBR or ABR

Friday, May 30, 2008

OSPF - cost of summary routes

R2 --[area1]-- R5 --[area0]-- R6

R2 is advertising 4 loopbacks into area 1, each with different costs:

R2#show run | section interface
interface Loopback0
ip address 2.2.2.2 255.255.255.255
interface Loopback1
ip address 2.2.2.3 255.255.255.255
ip ospf cost 100
interface Loopback2
ip address 2.2.2.4 255.255.255.255
ip ospf cost 200
interface Loopback3
ip address 2.2.2.5 255.255.255.255
ip ospf cost 300

R2#show run | section router ospf
router ospf 1
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 25
network 172.12.25.0 0.0.0.255 area 25

Router 6 has the following entries in the route table:

R6#show ip route | section 2.0.0.0
2.0.0.0/32 is subnetted, 4 subnets
O IA 2.2.2.2 [110/129] via 172.12.45.5, 01:17:58, Serial1/1
O IA 2.2.2.3 [110/228] via 172.12.45.5, 00:04:18, Serial1/1
O IA 2.2.2.4 [110/328] via 172.12.45.5, 00:04:35, Serial1/1
O IA 2.2.2.5 [110/428] via 172.12.45.5, 00:04:45, Serial1/1
R6#

Now if I want to summarize these routes into 2.2.2.0/24, what would the cost of the summary route be?

On router 5:

R5(config)#router ospf 1
R5(config-router)#area 25 range 2.2.2.0 255.255.255.0
R5(config-router)#

On router 6:

R6#show ip route | section 2.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
O IA 2.2.2.0 [110/129] via 172.12.45.5, 00:00:02, Serial1/1


The summary route takes the lowest cost of the specific routes, in this case the cost 129 of route to 2.2.2.2

Ah but wait!

This behavior was changed in RFC 2328. In RFC 2328, the cost of the summary route should be the cost of the component route with the highest metric. To change this behavior in IOS, enter the following command (on R5 in this example):

R5(config-router)#no compatible rfc1583

Now check R6:

R6#show ip route | section 2.0.0.0
2.0.0.0/24 is subnetted, 1 subnets
O IA 2.2.2.0 [110/428] via 172.12.45.5, 00:01:42, Serial1/1

The cost is 428 which was the cost of the route to 2.2.2.5.