Wednesday, January 11, 2012

ROUTE REDISTRIBUTION OVERVIEW

Route Redistribution
--------------------
Redistribution occurs from the routing table not from the routing database

when redistributing protocol x into protocol y
  - it takes routes in the routing table of protocol x
  - connected interfaces running the protocol
Connected Redistribution
------------------------
- Implicitly occurs for connected links running the redistributed protocol
- Additional connected links can explicity include or exclude
redistribute connected [metric] [route-map]
this would over ride implicit so if you had like a route map that only allowed the
loopback
interface it would override the implicit all connected interfaces running the
protocol

How IOS chooses path
----------------------
Routing database chooses one of more candidate paths
- eigrp via dual or ospf via spf rip via hop count
if multiple equal lenght exact path matches exist from different protocols it will
come
down to admin distance

sh ip protocols to view protocols running + admin distance etc

0- connected
1-static
5-Eigrp Summary
20 External BGP
90 Internal EIGRP
110- OSPF
115 - ISIS
120- RIP
160 ODR
170 External EIGRP
200 Internal BGP
255 infinite
RIP Redistribution
---------------------
- does not differenaite between internal and external route
    - admin distance of 120 for all routes
there is no default seed metric so if you do not specify a metric it will not
redistribute
redistribute "protocol" metric "hops"
default-metric "hops"
EIGRP Redistribution
---------------------
- AD of 170 for external EIGRP
    - this helps to prevent route feedback
-uses router id for loop prevention
- there is no default seed metric unless redistributing eigrp to eigrp (multiple as)
redistribute "protocol" metric "bandwidth" "delay" "load" "relability" "mtu"
default-metric "bandwidth" "delay" "delay" "load" "relability" "mtu"
The seed metric tends to only matter if you have multiple routers redistriubting if
there
is only one router redistributing with one path to the network it tends not to matter
what
the seed metric is.

OSPF Redistribution
---------------------
AD 110 for all OSPF routes
uses router id for flooding loop prevention
default seed metric is 20 and metric type is E2/N2
OSPF path selection prefers e1 > e2 > n1 > n2 (so irregardless of metric admin
distance if
it is a e1 path versus an e2 path + e2 has better admin + cost the process will
always select
the e1 path)

BGP
----
Uses origin code incomplete when redistributed into (?)
Uses normal EBGP + IBGP loop prevention
so for EBGP it uses AS path while for IBGP it uses AS split horizon rule of not
advertising
any routes learnt via IBGP any further
IGP to BGP redistribute
           - it will auto deny ospf external routes by default this is to prevent
potential route feedback
           you can override this with command
redsitribute ospf 1 match internal external
so it will match both internal + external routes
BGP to IGP redistribution
  By default when redistributing bgp into another protocol EBGP routes will be
allowed
IBGP routes will be denied by default
we can over ride with the command
bgp redistribute-internal


One of the main issue in redistributing is if routes are misselected as of admin
distance
like a path going the incorrect way is selected over a better path goin the right way
as of
admin distance

LAB
----
OK i have setup the following we will do some redistribution eigrp to ospf and ospf
to rip and vice versa checking the behaviour of the connected interfaces

so on r3
---------
r3#sh ip protocols
Routing Protocol is "eigrp 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 1, ospf 1
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    3.3.3.3/32
    10.229.254.0/24
    10.0.0.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    10.229.254.2          90      00:53:57
  Distance: internal 90 external 170
Routing Protocol is "ospf 1"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Router ID 3.3.3.3
  Number of areas in this router is 1. 1 normal 0 stub 0 nssa
  Maximum path: 4
  Routing for Networks:
    192.168.1.0 0.0.0.255 area 0
  Routing Information Sources:
    Gateway         Distance      Last Update
    3.3.3.3              110      00:40:21
  Distance: (default is 110)
we can see both ospf is running and eigrp
eigrp has a smaller admin distance of 90 ospf has admin distance of 110
we can see what networks each protocol is advertising

r3(config)#router eigrp 1
r3(config-router)#redistribute ospf 1
r3(config-router)#exit

r3#sh ip eigrp top
IP-EIGRP Topology Table for AS(1)/ID(3.3.3.3)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
P 2.2.2.2/32, 1 successors, FD is 20640000
        via 10.229.254.2 (20640000/128256), Serial1/0
P 3.3.3.3/32, 1 successors, FD is 128256
        via Connected, Loopback0
P 10.229.254.0/24, 1 successors, FD is 20512000
        via Connected, Serial1/0
r3#
no sign of the ospf routes in the eigrp database

on r1
-----
r1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/21152000] via 10.229.254.3, 01:02:23, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/2297856] via 10.229.254.3, 01:04:58, Serial0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.229.254.0 is directly connected, Serial0/0
r1#
no sign of the ospf routes in r1 routing table something is wrong

r3
---
r3(config)#router eigrp 1
r3(config-router)#no redistribute ospf 1
r3(config-router)#redistribute ospf 1 metric ?
  <1-4294967295>  Bandwidth metric in Kbits per second
r3(config-router)#redistribute ospf 1 metric 100 100 100 100 100
r3(config-router)#

ok so now i will specify a metric so bandwidth delay etc i just specfied all 100 it
does not really matter as there is only 1 way of this eigrp AS via r3

r3#
*Mar  1 01:39:51.882: %SYS-5-CONFIG_I: Configured from console by console
r3#sh ip eigrp top
IP-EIGRP Topology Table for AS(1)/ID(3.3.3.3)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
P 44.44.44.44/32, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
P 11.11.11.11/32, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
P 22.22.22.22/32, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
P 33.33.33.33/32, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
P 2.2.2.2/32, 1 successors, FD is 20640000
        via 10.229.254.2 (20640000/128256), Serial1/0
P 3.3.3.3/32, 1 successors, FD is 128256
        via Connected, Loopback0
P 10.229.254.0/24, 1 successors, FD is 20512000
        via Connected, Serial1/0
P 192.168.1.0/24, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
P 192.168.2.0/24, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
       r - reply Status, s - sia Status
P 192.168.3.0/24, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
P 192.168.4.0/24, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
P 192.168.5.0/24, 1 successors, FD is 25625600
        via Redistributed (25625600/0)
r3#

we are now seeing a whole load of routes from the ospf coming up as redistributed
on r1
-----

r1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/21152000] via 10.229.254.3, 01:11:49, Serial0/0
     33.0.0.0/32 is subnetted, 1 subnets
D EX    33.33.33.33 [170/26137600] via 10.229.254.3, 00:07:59, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/2297856] via 10.229.254.3, 01:14:24, Serial0/0
     22.0.0.0/32 is subnetted, 1 subnets
D EX    22.22.22.22 [170/26137600] via 10.229.254.3, 00:07:59, Serial0/0
D EX 192.168.4.0/24 [170/26137600] via 10.229.254.3, 00:07:59, Serial0/0
D EX 192.168.5.0/24 [170/26137600] via 10.229.254.3, 00:08:00, Serial0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.229.254.0 is directly connected, Serial0/0
     11.0.0.0/32 is subnetted, 1 subnets
D EX    11.11.11.11 [170/26137600] via 10.229.254.3, 00:08:01, Serial0/0
D EX 192.168.1.0/24 [170/26137600] via 10.229.254.3, 00:08:01, Serial0/0
D EX 192.168.2.0/24 [170/26137600] via 10.229.254.3, 00:08:01, Serial0/0
     44.0.0.0/32 is subnetted, 1 subnets
D EX    44.44.44.44 [170/26137600] via 10.229.254.3, 00:08:01, Serial0/0
D EX 192.168.3.0/24 [170/26137600] via 10.229.254.3, 00:08:01, Serial0/0
r1#

notice there is a distinction between the natively learnt eigrp routes and the
redistributed ospf routes. The external routes have EX and a admin distance of 170
comparted to the interfnal admin distance of 90 for the eigrp routes

We will now redistribute eigrp into ospf
so on r3

r3
---
r3(config)#router ospf 1
r3(config-router)#redistribute eigrp 1
% Only classful networks will be redistributed
r3(config-router)#
notice if we just do redistribute eigrp 1 it straight away tells us that only
classfull networks will be redistributed
lets take a look on s1
s1
---
switch1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     33.0.0.0/32 is subnetted, 1 subnets
O       33.33.33.33 [110/2] via 192.168.4.3, 00:06:52, Port-channel4
     22.0.0.0/32 is subnetted, 1 subnets
O       22.22.22.22 [110/2] via 192.168.2.2, 00:06:52, Port-channel2
C    192.168.4.0/24 is directly connected, Port-channel4
C    192.168.5.0/24 is directly connected, Port-channel20
     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/3
C    192.168.2.0/24 is directly connected, Port-channel2
     44.0.0.0/32 is subnetted, 1 subnets
O       44.44.44.44 [110/2] via 192.168.5.4, 00:06:52, Port-channel20
O    192.168.3.0/24 [110/2] via 192.168.4.3, 00:06:52, Port-channel4
                    [110/2] via 192.168.2.2, 00:06:52, Port-channel2

only classfull subnets are redistributed as none of the subnets are classfull from
the eigrp AS they will not be redistributed so we see no sign of the routes

r3
--
r3(config)#router ospf 1
r3(config-router)#redistribute eigrp 1 subn
r3(config-router)#exit
r3#sh ip ospf database
            OSPF Router with ID (3.3.3.3) (Process ID 1)
                Router Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum Link count
3.3.3.3         3.3.3.3         695         0x80000006 0x00EC11 2
15.15.15.1      15.15.15.1      1571        0x80000010 0x00468D 6
22.22.22.22     22.22.22.22     1387        0x80000006 0x005BF1 3
33.33.33.33     33.33.33.33     1218        0x80000006 0x00F7CA 3
44.44.44.44     44.44.44.44     828         0x80000004 0x002A01 2
                Net Link States (Area 0)
Link ID         ADV Router      Age         Seq#       Checksum
192.168.2.1     15.15.15.1      1630        0x80000002 0x0020F7
192.168.3.2     22.22.22.22     1387        0x80000002 0x00870E
192.168.4.1     15.15.15.1      1375        0x80000002 0x0032B7
192.168.5.1     15.15.15.1      878         0x80000002 0x004F6D
                Type-5 AS External Link States
Link ID         ADV Router      Age         Seq#       Checksum Tag
2.2.2.2         3.3.3.3         137         0x80000001 0x00315B 0
3.3.3.3         3.3.3.3         139         0x80000001 0x000385 0
10.229.254.0    3.3.3.3         139         0x80000001 0x004F56 0

we now have type 5 lsa in r3 ospf database
r1
--
switch1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
O E2    2.2.2.2 [110/20] via 192.168.1.3, 00:03:57, FastEthernet0/3
     33.0.0.0/32 is subnetted, 1 subnets
O       33.33.33.33 [110/2] via 192.168.4.3, 00:13:10, Port-channel4
     3.0.0.0/32 is subnetted, 1 subnets
O E2    3.3.3.3 [110/20] via 192.168.1.3, 00:03:57, FastEthernet0/3
     22.0.0.0/32 is subnetted, 1 subnets
O       22.22.22.22 [110/2] via 192.168.2.2, 00:13:10, Port-channel2
C    192.168.4.0/24 is directly connected, Port-channel4
C    192.168.5.0/24 is directly connected, Port-channel20
     10.0.0.0/24 is subnetted, 1 subnets
O E2    10.229.254.0 [110/20] via 192.168.1.3, 00:03:58, FastEthernet0/3
     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/3
C    192.168.2.0/24 is directly connected, Port-channel2
     44.0.0.0/32 is subnetted, 1 subnets
O       44.44.44.44 [110/2] via 192.168.5.4, 00:13:12, Port-channel20
O    192.168.3.0/24 [110/2] via 192.168.4.3, 00:13:12, Port-channel4
                    [110/2] via 192.168.2.2, 00:13:12, Port-channel2
switch1#

we now see e2 routes which is the default they have the same metric of 110 but by
ospf selection policy e2 is less preferred than O
Now we will have a look at redistributing rip into ospf and see the affect on both
the ospf domain and the eigrp domain see do we have connectivity from the eigrp
domain to the rip domain

so on s4
s4
---
switch4(config)#router ospf 1
switch4(config-router)#redistribute rip subnets
switch4(config-router)#

so on s1
---------
 switch1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
O E2    2.2.2.2 [110/20] via 192.168.1.3, 00:00:19, FastEthernet0/3
     33.0.0.0/32 is subnetted, 1 subnets
O       33.33.33.33 [110/2] via 192.168.4.3, 00:00:19, Port-channel4
     3.0.0.0/32 is subnetted, 1 subnets
O E2    3.3.3.3 [110/20] via 192.168.1.3, 00:00:19, FastEthernet0/3
     4.0.0.0/32 is subnetted, 1 subnets
O E2    4.4.4.4 [110/20] via 192.168.5.4, 00:00:19, Port-channel20
     172.25.0.0/24 is subnetted, 2 subnets
O E2    172.25.16.0 [110/20] via 192.168.5.4, 00:00:19, Port-channel20
O E2    172.25.15.0 [110/20] via 192.168.5.4, 00:00:20, Port-channel20
     22.0.0.0/32 is subnetted, 1 subnets
O       22.22.22.22 [110/2] via 192.168.2.2, 00:00:20, Port-channel2
C    192.168.4.0/24 is directly connected, Port-channel4
C    192.168.5.0/24 is directly connected, Port-channel20
     10.0.0.0/24 is subnetted, 1 subnets
O E2    10.229.254.0 [110/20] via 192.168.1.3, 00:00:21, FastEthernet0/3
     11.0.0.0/32 is subnetted, 1 subnets
C       11.11.11.11 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/3
C    192.168.2.0/24 is directly connected, Port-channel2
     44.0.0.0/32 is subnetted, 1 subnets
O       44.44.44.44 [110/2] via 192.168.5.4, 00:00:21, Port-channel20
O    192.168.3.0/24 [110/2] via 192.168.4.3, 00:00:21, Port-channel4
                    [110/2] via 192.168.2.2, 00:00:21, Port-channel2
switch1#

we can see the rip routes on s1 like 172.25.16 and .15
lets take a look at a router in the eigrp domain
so r1
r1
---

r1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/21152000] via 10.229.254.3, 01:33:33, Serial0/0
     33.0.0.0/32 is subnetted, 1 subnets
D EX    33.33.33.33 [170/26137600] via 10.229.254.3, 00:29:42, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/2297856] via 10.229.254.3, 01:36:07, Serial0/0
     4.0.0.0/32 is subnetted, 1 subnets
D EX    4.4.4.4 [170/26137600] via 10.229.254.3, 00:01:53, Serial0/0
     172.25.0.0/24 is subnetted, 2 subnets
D EX    172.25.16.0 [170/26137600] via 10.229.254.3, 00:01:54, Serial0/0
D EX    172.25.15.0 [170/26137600] via 10.229.254.3, 00:01:54, Serial0/0
     22.0.0.0/32 is subnetted, 1 subnets
D EX    22.22.22.22 [170/26137600] via 10.229.254.3, 00:29:43, Serial0/0
D EX 192.168.4.0/24 [170/26137600] via 10.229.254.3, 00:29:52, Serial0/0
D EX 192.168.5.0/24 [170/26137600] via 10.229.254.3, 00:29:52, Serial0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.229.254.0 is directly connected, Serial0/0
     11.0.0.0/32 is subnetted, 1 subnets
D EX    11.11.11.11 [170/26137600] via 10.229.254.3, 00:29:52, Serial0/0
D EX 192.168.1.0/24 [170/26137600] via 10.229.254.3, 00:29:52, Serial0/0
D EX 192.168.2.0/24 [170/26137600] via 10.229.254.3, 00:29:52, Serial0/0
     44.0.0.0/32 is subnetted, 1 subnets
D EX    44.44.44.44 [170/26137600] via 10.229.254.3, 00:29:52, Serial0/0
D EX 192.168.3.0/24 [170/26137600] via 10.229.254.3, 00:29:52, Serial0/0
r1#
we are learning 172.25.16.0 from our redistribution

R3
---
say we do not want this from eigrp as we only want to learn the routes from the ospf
domain not the rip domain
r3(config-router)#router eigrp 1
r3(config-router)#$e ospf 1 match internal metric 100 100 100 100 100
r3(config-router)#
this did not work i had to a no router ospf 1 metric 100 100 100 100
then do
router ospf 1 match internal metric 100 100 100 100 100
r1
---
r1#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
D       2.2.2.2 [90/21152000] via 10.229.254.3, 01:39:41, Serial0/0
     33.0.0.0/32 is subnetted, 1 subnets
D EX    33.33.33.33 [170/26137600] via 10.229.254.3, 00:00:55, Serial0/0
     3.0.0.0/32 is subnetted, 1 subnets
D       3.3.3.3 [90/2297856] via 10.229.254.3, 01:42:16, Serial0/0
     22.0.0.0/32 is subnetted, 1 subnets
D EX    22.22.22.22 [170/26137600] via 10.229.254.3, 00:00:55, Serial0/0
D EX 192.168.4.0/24 [170/26137600] via 10.229.254.3, 00:00:55, Serial0/0
D EX 192.168.5.0/24 [170/26137600] via 10.229.254.3, 00:00:56, Serial0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.229.254.0 is directly connected, Serial0/0
     11.0.0.0/32 is subnetted, 1 subnets
D EX    11.11.11.11 [170/26137600] via 10.229.254.3, 00:00:57, Serial0/0
D EX 192.168.1.0/24 [170/26137600] via 10.229.254.3, 00:00:57, Serial0/0
D EX 192.168.2.0/24 [170/26137600] via 10.229.254.3, 00:00:57, Serial0/0
     44.0.0.0/32 is subnetted, 1 subnets
D EX    44.44.44.44 [170/26137600] via 10.229.254.3, 00:00:57, Serial0/0
D EX 192.168.3.0/24 [170/26137600] via 10.229.254.3, 00:00:57, Serial0/0
r1#

now on r1 i am only seeing the subnets from the ospf domain not anything
redistributed into ospf i.e rip and external network

ok on s4 lets redistribute ospf into rip
this time we will do a scenerio where rip as only wants to see the routes from the
ospf domain

s4
---
switch4(config-router)#router rip
switch4(config-router)#redistribute ospf 1 match external
switch4(config-router)#

switch4#sh ip rip database
4.0.0.0/8    auto-summary
4.4.4.4/32
    [1] via 172.25.15.44, 00:00:13, FastEthernet0/4
172.25.0.0/16    auto-summary
172.25.15.0/24    directly connected, FastEthernet0/4
172.25.16.0/24
    [1] via 172.25.15.44, 00:00:13, FastEthernet0/4
switch4#

ok we do not seem to be learning any redistributed from either ospf or eigrp lets
check on r5
r5#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/1] via 172.25.16.4, 00:00:21, Serial0/1/0
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
     172.25.0.0/24 is subnetted, 2 subnets
C       172.25.16.0 is directly connected, Serial0/1/0
R       172.25.15.0 [120/1] via 172.25.16.4, 00:00:21, Serial0/1/0
r5#

just rip routes
the problem is we have not set metric on s4 for the redistribution

s4
---
switch4(config)#router rip
switch4(config-router)#redistribute ospf 1 match external metric 5
switch4(config-router)#
switch4#sh ip rip database
2.0.0.0/8    auto-summary
2.2.2.2/32    redistributed
    [5] via 3.3.3.3,
3.0.0.0/8    auto-summary
3.3.3.3/32    redistributed
    [5] via 3.3.3.3,
4.0.0.0/8    auto-summary
4.4.4.4/32
    [1] via 172.25.15.44, 00:00:22, FastEthernet0/4
10.0.0.0/8    auto-summary
10.229.254.0/24    redistributed
    [5] via 3.3.3.3,
172.25.0.0/16    auto-summary
172.25.15.0/24    directly connected, FastEthernet0/4
172.25.16.0/24
    [1] via 172.25.15.44, 00:00:22, FastEthernet0/4
switch4#
we are getting redistributed routes 10.229.254.0

r5#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/1] via 172.25.16.4, 00:00:13, Serial0/1/0
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
     172.25.0.0/24 is subnetted, 2 subnets
C       172.25.16.0 is directly connected, Serial0/1/0
R       172.25.15.0 [120/1] via 172.25.16.4, 00:00:13, Serial0/1/0
     10.0.0.0/24 is subnetted, 1 subnets
R       10.229.254.0 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
r5#
we are only getting routes from the external eigrp domain as they are external routes
in ospf and we are matching external in redistribution command under rip process
notice that the redistribute routes in rip do not come up as anything to signify them
as external they have the same metric as internal rip routes

s4
--

i have redistributed connected
switch4(config)#router rip
switch4(config-router)#redistribute connected
switch4(config-router)#


I also a new connected/loopback interface which no protocol is advertised
switch4(config)#int lo11
switch4(config-if)#33
02:35:29: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback11, changed state
to
switch4(config-if)#ip address 44.4.4.1 255.255.255.255
switch4(config-if)#
lets take a look at r5


r5#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/6] via 172.25.16.4, 00:00:18, Serial0/1/0
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/6] via 172.25.16.4, 00:00:18, Serial0/1/0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/1] via 172.25.16.4, 00:00:18, Serial0/1/0
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
     172.25.0.0/24 is subnetted, 2 subnets
C       172.25.16.0 is directly connected, Serial0/1/0
R       172.25.15.0 [120/1] via 172.25.16.4, 00:00:18, Serial0/1/0
R    192.168.5.0/24 [120/2] via 172.25.16.4, 00:00:18, Serial0/1/0
     10.0.0.0/24 is subnetted, 1 subnets
R       10.229.254.0 [120/6] via 172.25.16.4, 00:00:20, Serial0/1/0
     44.0.0.0/32 is subnetted, 2 subnets
R       44.44.44.44 [120/2] via 172.25.16.4, 00:00:20, Serial0/1/0
R       44.4.4.1 [120/2] via 172.25.16.4, 00:00:20, Serial0/1/0
r5#
now we are learning 192.168.5,0 which is an interface running ospf and also interface
 that is not been advertised by any protocol lo11 which is ip 44.4.4.1
doing redistribute connected will advertise any connected routes no matter what
protocol they are running
say for some reason only want redistribute the connected 44.4.4.1 interface not the
interface running ospf

switch4(config)#route-map CONNECTEDFILTER
switch4(config-route-map)#match interface lo11
switch4(config-route-map)#exit
switch4(config)#router rip
switch4(config-router)#redistribute connected route-map CONNECTEDFILTER
switch4(config-router)#

switch4#sh route-map
route-map CONNECTEDFILTER, permit, sequence 10
  Match clauses:
    interface Loopback11
  Set clauses:
  Policy routing matches: 0 packets, 0 bytes
switch4#

we can see in the route-map we have sequence 10 permit match lo11 then it will
implicitly deny any other connected routes lets view the results
r5#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/6] via 172.25.16.4, 00:00:03, Serial0/1/0
     33.0.0.0/32 is subnetted, 1 subnets
R       33.33.33.33 [120/6] via 172.25.16.4, 00:00:03, Serial0/1/0
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/6] via 172.25.16.4, 00:00:03, Serial0/1/0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/1] via 172.25.16.4, 00:00:03, Serial0/1/0
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
     172.25.0.0/24 is subnetted, 2 subnets
C       172.25.16.0 is directly connected, Serial0/1/0
R       172.25.15.0 [120/1] via 172.25.16.4, 00:00:03, Serial0/1/0
     22.0.0.0/32 is subnetted, 1 subnets
R       22.22.22.22 [120/6] via 172.25.16.4, 00:00:04, Serial0/1/0
R    192.168.4.0/24 [120/6] via 172.25.16.4, 00:00:04, Serial0/1/0
     10.0.0.0/24 is subnetted, 1 subnets
R       10.229.254.0 [120/6] via 172.25.16.4, 00:00:04, Serial0/1/0
     11.0.0.0/32 is subnetted, 1 subnets
R       11.11.11.11 [120/6] via 172.25.16.4, 00:00:04, Serial0/1/0
R    192.168.1.0/24 [120/6] via 172.25.16.4, 00:00:04, Serial0/1/0
R    192.168.2.0/24 [120/6] via 172.25.16.4, 00:00:04, Serial0/1/0
     44.0.0.0/32 is subnetted, 1 subnets
R       44.4.4.1 [120/2] via 172.25.16.4, 00:00:04, Serial0/1/0
R    192.168.3.0/24 [120/6] via 172.25.16.4, 00:00:04, Serial0/1/0

notice 192.168.5.0 is gone the connected route running ospf also the loopback 0
44.44.44.44 is gone we only have the connected route 44.4.4.1
r5#sh ip route 192.168.5.0
% Network not in table

Ok we will change back to redistribute both internal and external & also take off no
redistribute connected route-map CONNECTEDFILTER

S4
----
switch4(config-router)#router rip
switch4(config-router)#no redistribute ospf 1 match external metric 5
switch4(config-router)#redistribute ospf 1 metric 5
switch4(config-router)#no redistribute connected route-map CONNECTEDFILTER
switch4(config-router)#

r5#sh ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
     2.0.0.0/32 is subnetted, 1 subnets
R       2.2.2.2 [120/6] via 172.25.16.4, 00:00:11, Serial0/1/0
     33.0.0.0/32 is subnetted, 1 subnets
R       33.33.33.33 [120/6] via 172.25.16.4, 00:00:11, Serial0/1/0
     3.0.0.0/32 is subnetted, 1 subnets
R       3.3.3.3 [120/6] via 172.25.16.4, 00:00:11, Serial0/1/0
     4.0.0.0/32 is subnetted, 1 subnets
R       4.4.4.4 [120/1] via 172.25.16.4, 00:00:11, Serial0/1/0
     5.0.0.0/24 is subnetted, 1 subnets
C       5.5.5.0 is directly connected, Loopback0
     172.25.0.0/24 is subnetted, 2 subnets
C       172.25.16.0 is directly connected, Serial0/1/0
R       172.25.15.0 [120/1] via 172.25.16.4, 00:00:11, Serial0/1/0
     22.0.0.0/32 is subnetted, 1 subnets
R       22.22.22.22 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
R    192.168.4.0/24 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
R    192.168.5.0/24 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
     10.0.0.0/24 is subnetted, 1 subnets
R       10.229.254.0 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
     11.0.0.0/32 is subnetted, 1 subnets
R       11.11.11.11 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
R    192.168.1.0/24 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
R    192.168.2.0/24 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
     44.0.0.0/32 is subnetted, 1 subnets
R       44.44.44.44 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
R    192.168.3.0/24 [120/6] via 172.25.16.4, 00:00:13, Serial0/1/0
r5#
ok i am recieving all routes now notice also i am recieving any interface connected
to r5 running ospf i.e 44.44.44.44 and 192.168.5.0 but i am not recieving the route
44.4.4.1 as it is not running the protocol. So by default the redistribute command
will redistribute all ospf routes and interfaces with ospf running but not interfaces
which do not have ospf running

No comments:

Post a Comment