• Aucun résultat trouvé

Redistributing EIGRP and OSPF

Dans le document IP NETWORKS CISCOQoS (Page 122-128)

It is quite common to find yourself in the position of needing to manage two routing protocols within the same network.This can be due to a merger between two companies or because you are migrating from one protocol to another.

EIGRP has built-in mechanisms that allow you to easily translate route informa-tion from one protocol to another.

In the example that follows, we have two companies that are merging. In this instance, the new company is running OSPF and we need to insert routes from our EIGRP network into their network.We also need to receive route informa-tion from the OSPF process. However, there are certain routes that we do not want to inject into their network.We will use a route filter to prevent these routes

from being propagated. Figure 2.25 show the two networks and the link used to connect them.

We will focus our attention on Router E. It will function both as an EIGRP Core router and an OSPF ASBR (Autonomous System Boundary Router), and we can control the redistribution process entirely from there.The first objective is to modify the original EIGRP-only configuration at Router E to add it to the OSPF 10 process.The original OSPF network is using the address space 10.31.0.0/16.We could enable OSPF on Router E using 10.0.0.0, but that would prevent us from ever using the 10.0.0.0 address space anywhere else in our network.Therefore, the configuration at Router E is:

interface serial0

ip address 10.31.8.1 255.255.255.254

router eigrp 100 network 172.16.0.0

router OSPF 10

network 10.31.0.0 0.0.255.255 area 0

Router E will now fully converge with both networks. At this point, though, it will not advertise the routes from OSPF to the neighbor EIGRP routers, nor

www.syngress.com

Figure 2.25Redistributing between EIGRP and OSPF

EIGRP 100 OSPF 10

Area 1 Area 0

172.16.8.0/21

172.16.16.0/20

10.31.8.2/30

10.31.8.1/30

10.31.32.0/19 10.31.16.0/20 Router E

Router O S0

Area 2

145.0.0.0/8 Router A

will it advertise the routes form EIGRP into area 0.We must use the redistribute command to inject the routes from each process.The configuration becomes:

router eigrp 100 network 172.16.0.0

redistribute ospf 10 metric 512 10000 255 1 1500

router ospf 10

network 10.31.0.0 0.0.255.255 area 0 redistribute eigrp 100 metric 195

Router E will now inject routes in both directions.The metricportion of the redistributecommand allows each process to convert the other protocols metric to whatever you dictate in the command. For EIGRP, these are the familiar bandwidth, delay, reliability, load, and MTU. For OSPF, the metric is an administratively assigned cost for the path.The default values for OSPF metric are generated by the formula 108/Bandwidth. In this circumstance, the link is 512 kbps, so the value is 195. If there were redundant links between the two net-works, it would be important to set this value correctly so that the correct route is chosen. In our situation, we could have selected an arbitrary value.

We could also choose to use the default-metric command in both the OSPF and EIGRP processes. If we were redistributing more than one routing protocol or a static route, applying a default metric to the routing process would eliminate the need for the metrickeyword in the redistribute command.

Previously, there was a connection from Router E on interface serial1 to 145.0.0.0/8.This connection can be added as a static route and redistributed to both the EIGRP and OSPF processes.The configuration at Router E becomes:

ip route 145.0.0.0 255.0.0.0 serial1

router eigrp 100 network 172.16.0.0

default-metric 512 10000 255 1 1500 redistribute ospf 10

reditribute static

router ospf 10

network 10.31.0.0 0.0.255.255 area 0

default-metric 195 redistribute eigrp 100 redistribute static

If we look at the route table on Router O, we see that only network

172.16.0.0 is injected along with the route to 145.0.0.0. One of our design goals is to prevent network 172.16.8.0/21 from being advertised into OSPF. If only the major network address is advertised, we will not be able to block access to an individual subnet of network 172.16.0.0 without blocking the entire network.

Fortunately, OSPF allows you to insert the keyword subnets at the end of the redistributecommand to advertise the individual subnets.

Router O#show ip route Codes:

C - connected, S - static, I - IGRP, R - RIP, M - mobile, B – BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - ISIS level-1, L2 - ISIS level-2, * - candidate

default

U - per-user static route, o - ODR

Gateway of last resort is not set

O E2 172.16.0.0/16 [110/195] via 10.31.8.1, 00:02:29, Serial0 O E2 145.0.0.0/8 [110/195] via 10.31.8.1, 00:00:09, Serial0

10.31.0.0/16 is variably subnetted, 4 subnets, 3 masks C 10.31.8.0/30 is directly connected, Serial0

………

Having made the subnets modification, we need to prevent the advertisement of 172.16.8.0/21 using a route filter.We can filter this route in two ways: we can use a distribute-list attached to an ip access list to deny the advertisement, or we can use a route map.Since we are going to block only a single advertisement, we have selected to use a distribute list.

The distribute-list command is applied to the EIGRP process and can limit routes advertised or accepted.The format of the command is distribute-list

www.syngress.com

<access list number> in/out.We will apply our distribute-list command to Router E and block the advertisement of network 172.16.8.0.

Our configuration becomes:

router eigrp 100 network 172.16.0.0

default-metric 512 10000 255 1 1500 redistribute ospf 10

reditribute static distribute-list 10 out

router ospf 10

network 10.31.0.0 0.0.255.255 area 0 default-metric 195

redistribute eigrp 100 redistribute static

access-list 10 deny 17.16.8.0 0.0.0.255 access-list 10 permit any

The following shows the final route table on Router O.We can see that it does not have a route to 172.16.8.0, and that all of the injected routes are External Type 2 routes. E2 routes simply mean that OSPF will only use the metric learned from the redistributed route. It will not increase the metric to account for the cost of the internal paths. If we wanted OSPF to include the cost of the internal paths, we would need to specify the routes as External Type 1 routes by adding the keyword metric-type 1 to the redistributionor default-metriccommands.

Router O#show ip route Codes:

C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - ISIS level-1, L2 - ISIS level-2, * - candidate default U - per-user static route, o - ODR

Gateway of last resort is not set

172.16.0.0/16 is subnetted, 1 subnet

O E2 172.16.16.0/20 [110/195] via 10.31.8.1, 00:02:44, Serial0 O E2 145.0.0.0/8 [110/195] via 10.31.8.1, 00:00:17, Serial0

10.31.0.0/16 is variably subnetted, 4 subnets, 3 masks C 10.31.8.0/30 is directly connected, Serial0

………

We can also look at the route table on Router A and see that EIGRP has learned the routes from the OSPF redistribution and tagged them as D EX routes.

Router A#show ip route Codes:

C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - ISIS level-1, L2 - ISIS level-2, * - candidate default U - per-user static route, o - ODR

Gateway of last resort is not set

D EX 145.0.0.0/8 [170/5281536] via 172.16.4.193, 00:00:17, Ethernet1

10.31.0.0/16 is variably subnetted, 3 subnets, 3 masks D EX 10.31.8.0/30 [170/5281536] via 172.16.4.193, 00:00:42,

Ethernet1

D EX 10.31.16.0/20 [170/5332736] via 172.16.4.193, 00:00:42, Ethernet1

D EX 10.31.32.0/19 [170/5332736] via 172.16.4.193, 00:00:42, Ethernet1

172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.8.0/30 is directly connected, Ethernet0

………

www.syngress.com

Dans le document IP NETWORKS CISCOQoS (Page 122-128)