Pages

Wednesday, 22 May 2013

Redistribution from different routing domain



R1
==
conf t
int fast 0/0
ip add 192.168.12.1 255.255.255.0
no shut
exit
int fast 0/1
ip add 192.168.13.1 255.255.255.0
no shut
exit
int loopback 0
ip add 1.1.1.1 255.255.255.255
exit
int loopback 1
ip add 11.11.11.11 255.255.255.255
exit
router rip
version 2
no auto-summary
network 192.168.12.0
network 1.1.1.1
exit
router eigrp 1
no auto-summary
network 192.168.13.1 0.0.0.0
network 11.11.11.11 0.0.0.0
exit
===============================================
R2
==
conf t
int fast 0/0
ip add 192.168.12.2 255.255.255.0
no shut
exit
int fast 0/1
ip add 192.168.23.2 255.255.255.0
no shut
exit
int loopback 0
ip add 2.2.2.2 255.255.255.255
exit
int loopback 1
ip add 22.22.22.22 255.255.255.255
exit
router rip
version 2
no auto-summary
network 192.168.12.0
network 2.2.2.2
exit
router ospf 1
network 192.168.23.2 0.0.0.0 area 0
network 22.22.22.22 0.0.0.0 area 0
exit
===================================================
R3
==
conf t
int fast 0/0
ip add 192.168.13.3 255.255.255.0
no shut
exit
int fast 0/1
ip add 192.168.23.3 255.255.255.0
no shut
exit
int loopback 0
ip add 3.3.3.3 255.255.255.255
exit
int loopback 1
ip add 33.33.33.33 255.255.255.255
exit
router eigrp 1
no auto-summary
network 192.168.13.3 0.0.0.0
network 33.33.33.33 0.0.0.0
exit
router ospf 1
network 192.168.23.3 0.0.0.0 area 0
network 3.3.3.3 0.0.0.0 area 0
exit
====================================================
Lets redistribute RIP into EIGRP at R1 and then redistribute EIGRP into OSPF at R3. First lets view the routing table of R2. It is seen that R2 prefer R1 through the RIP routing domain which is normal but after the redistribution R2 will also learn R1 loopback from the ospf domain as well as an external route but since R2 now learn the same prefix from ospf and rip it will select the ospf domain resulting to a suboptimal path.

R2#sh ip route | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.12.1, 00:00:08, FastEthernet0/0
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.23.3, 00:31:20, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1

After Redistribution

R2#sh ip route | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
O E2    1.1.1.1 [110/20] via 192.168.23.3, 00:00:49, FastEthernet0/1
O E2 192.168.13.0/24 [110/20] via 192.168.23.3, 00:00:49, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     33.0.0.0/32 is subnetted, 1 subnets
O E2    33.33.33.33 [110/20] via 192.168.23.3, 00:00:49, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.23.3, 00:47:35, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1
     11.0.0.0/32 is subnetted, 1 subnets
O E2    11.11.11.11 [110/20] via 192.168.23.3, 00:00:49, FastEthernet0/1
There are many ways to solve this suboptimal routing issue. We can use distribute list to filter out 1.1.1.1 from R2 routing table. Area filter list can also be used at R2 but the most efficient way is to use administrative distance and make the AD of that route at R2 worse than that of RIP. This will also allow for redundancy.

R2(config)#ip access-list standard NET_1
R2(config-std-nacl)#deny 1.1.1.1
R2(config-std-nacl)#permit any
R2(config-std-nacl)#exit
R2(config)#router ospf 1
R2(config-router)#distribute-list NET_1 in
Let us verify
R2(config-router)#do sh ip route | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.12.1, 00:00:16, FastEthernet0/0
O E2 192.168.13.0/24 [110/20] via 192.168.23.3, 00:04:54, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     33.0.0.0/32 is subnetted, 1 subnets
O E2    33.33.33.33 [110/20] via 192.168.23.3, 00:04:54, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.23.3, 00:04:54, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1
     11.0.0.0/32 is subnetted, 1 subnets
O E2    11.11.11.11 [110/20] via 192.168.23.3, 00:04:54, FastEthernet0/1

It has now selected the most optimal path but there is no redundancy.

Lets use prefix-list as well to do the same:

R2(config)#ip prefix-list NET_1 seq 5 deny 1.1.1.1/32
R2(config)# ip prefix-list NET_1 seq 10 permit 0.0.0.0/0 le 32
R2(config)#router ospf 1
R2(config-router)#distribute-list prefix NET_1 in
R2(config-router)#
Let us verify:
R2(config-router)#do sh ip rou | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.12.1, 00:00:13, FastEthernet0/0
O E2 192.168.13.0/24 [110/20] via 192.168.23.3, 00:01:26, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     33.0.0.0/32 is subnetted, 1 subnets
O E2    33.33.33.33 [110/20] via 192.168.23.3, 00:01:26, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.23.3, 00:01:26, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1
     11.0.0.0/32 is subnetted, 1 subnets
O E2    11.11.11.11 [110/20] via 192.168.23.3, 00:01:26, FastEthernet0/

Lets use route-map to do the same thing

R2(config)#ip access-list standard NET_1
R2(config-std-nacl)#deny 1.1.1.1
R2(config-std-nacl)#permit any
R2(config-std-nacl)#router ospf 1
R2(config-router)#distribute-list route-map NET_1

Let us verify:
R2(config-router)#do sh ip rou | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.12.1, 00:00:03, FastEthernet0/0
O E2 192.168.13.0/24 [110/20] via 192.168.23.3, 00:01:43, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     33.0.0.0/32 is subnetted, 1 subnets
O E2    33.33.33.33 [110/20] via 192.168.23.3, 00:01:43, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.23.3, 00:01:43, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1
     11.0.0.0/32 is subnetted, 1 subnets
O E2    11.11.11.11 [110/20] via 192.168.23.3, 00:01:43, FastEthernet0/1

Another effective method that will allow redundancy is to summarized 1.1.1.1 at the ASBR (R3) before advertising it to R2 with this R1 will learn 1.1.1.1 through R1 with a more specific address.

R3(config-router)#router ospf 1
R3(config-router)#summary-address 1.1.0.0 255.255.0.0
R3(config-router)#
Let us verify:

R2#sh ip route | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R       1.1.1.1/32 [120/1] via 192.168.12.1, 00:00:14, FastEthernet0/0
O E2    1.1.0.0/16 [110/20] via 192.168.23.3, 00:03:19, FastEthernet0/1
O E2 192.168.13.0/24 [110/20] via 192.168.23.3, 00:07:53, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     33.0.0.0/32 is subnetted, 1 subnets
O E2    33.33.33.33 [110/20] via 192.168.23.3, 00:07:53, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.23.3, 00:07:53, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1
     11.0.0.0/32 is subnetted, 1 subnets
O E2    11.11.11.11 [110/20] via 192.168.23.3, 00:07:53, FastEthernet0/1

Another effective method is to use administrative distance. The AD of the route 1.1.1.1 learn via ospf can be increased to more than the AD of RIP. Lets increase the AD to 150. To use AD we need the source of the advertising route which we can get by using the show ip ospf database.
R2#sh ip ospf database

            OSPF Router with ID (22.22.22.22) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
22.22.22.22     22.22.22.22     1349        0x80000002 0x009571 2
33.33.33.33     33.33.33.33     1350        0x80000002 0x0040B9 2

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
192.168.23.3    33.33.33.33     1350        0x80000001 0x00A6AE

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
1.1.1.1         33.33.33.33     1392        0x80000001 0x00D740 0
2.2.2.2         33.33.33.33     1392        0x80000001 0x00A96A 0
11.11.11.11     33.33.33.33     1392        0x80000001 0x000AE5 0
33.33.33.33     33.33.33.33     1395        0x80000001 0x001285 0
192.168.12.0    33.33.33.33     505         0x80000001 0x00CFD6 0
192.168.13.0    33.33.33.33     1395        0x80000001 0x00C4E0 0

The source is 33.33.33.33
R2(config)#router ospf 1
R2(config-router)#distance 150 33.33.33.33 0.0.0.0
R2(config-router)#

Let us verify:


R2(config-router)#do sh ip rou | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.12.1, 00:00:11, FastEthernet0/0
O E2 192.168.13.0/24 [150/20] via 192.168.23.3, 00:02:35, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     33.0.0.0/32 is subnetted, 1 subnets
O E2    33.33.33.33 [150/20] via 192.168.23.3, 00:02:35, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [150/11] via 192.168.23.3, 00:02:35, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1
     11.0.0.0/32 is subnetted, 1 subnets
O E2    11.11.11.11 [150/20] via 192.168.23.3, 00:02:35, FastEthernet0/1

However, this changes all the ospf routes learn from 33.33.33.33 (R3) to an AD of 150. If we want to change only the route 1.1.1.1 then we need to match it with either a standard access-list or extended access-list.

R2(config)#access-list 1 permit 1.1.1.1
R2(config)#router ospf 1
R2(config-router)#distance 150 33.33.33.33 0.0.0.0 1

Lets verify:
R2(config-router)#do sh ip route | be Gateway
Gateway of last resort is not set

C    192.168.12.0/24 is directly connected, FastEthernet0/0
     1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 192.168.12.1, 00:00:01, FastEthernet0/0
O E2 192.168.13.0/24 [110/20] via 192.168.23.3, 00:02:40, FastEthernet0/1
     2.0.0.0/32 is subnetted, 1 subnets
C       2.2.2.2 is directly connected, Loopback0
     33.0.0.0/32 is subnetted, 1 subnets
O E2    33.33.33.33 [110/20] via 192.168.23.3, 00:02:40, FastEthernet0/1
     3.0.0.0/32 is subnetted, 1 subnets
O       3.3.3.3 [110/11] via 192.168.23.3, 00:02:40, FastEthernet0/1
     22.0.0.0/32 is subnetted, 1 subnets
C       22.22.22.22 is directly connected, Loopback1
C    192.168.23.0/24 is directly connected, FastEthernet0/1
     11.0.0.0/32 is subnetted, 1 subnets
O E2    11.11.11.11 [110/20] via 192.168.23.3, 00:02:40, FastEthernet0/1

With this solution it is only the ospf route of 1.1.1.1 that has an AD of 150 the others maintain their default AD of 110.

1 comments:

  1. Thanks for for the post it really helps me.

    ReplyDelete