Tuesday, September 1, 2015

OSPF- Miscellaneous



1.OSPF Distance Command

9.9.9 .9/32 is advertised by R9 

R6 

router ospf 10
 network 6.6.6.6 0.0.0.0 area 3
 network 16.0.0.0 0.0.0.255 area 3
 network 69.0.0.0 0.255.255.255 area 3
 distance 205 1.1.1.1 0.0.0.0 20

access-list 20 permit 9.9.9.9


***************************LOG***********************

Show ip route

      6.0.0.0/32 is subnetted, 1 subnets
C        6.6.6.6 is directly connected, Loopback0
      9.0.0.0/32 is subnetted, 1 subnets
O IA     9.9.9.9 [110/1004] via 16.0.0.1, 00:00:05, FastEthernet0/0
      13.0.0.0/24 is subnetted, 1 subnets
O IA     13.0.0.0 [110/2] via 16.0.0.1, 00:00:05, FastEthernet0/0

R6#sh ip route 9.9.9.9
Routing entry for 9.9.9.9/32
  Known via "ospf 10", distance 205, metric 1004, type inter area
  Last update from 16.0.0.1 on FastEthernet0/0, 00:03:26 ago
  Routing Descriptor Blocks:
  * 16.0.0.1, from 1.1.1.1, 00:03:26 ago, via FastEthernet0/0
      Route metric is 1004, traffic share count is 1


R6#sh ip ospf database summary 9.9.9.9

            OSPF Router with ID (66.6.6.6) (Process ID 10)

                Summary Net Link States (Area 3)

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 535
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 9.9.9.9 (summary Network Number)
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000004
  Checksum: 0x180B
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 1003

R6#

**************************

To make any route unreachable
R6

router ospf 10
 network 6.6.6.6 0.0.0.0 area 3
 network 16.0.0.0 0.0.0.255 area 3
 network 69.0.0.0 0.255.255.255 area 3
 distance 255 1.1.1.1 0.0.0.0 20

access-list 20 permit 9.9.9.9

R6#sh ip route 9.9.9.9
% Network not in table
R6

NOTE:- " Prefix  will remain in database..'"

OSPF Route Filtering



Case 1 Route filtering with Distribute list

R6

int lo5
ip add 69.1.1.1 255.255.255.255
int lo6
ip add 69.2.1.1 255.255.255.255
int lo7
ip add 69.3.1.1 255.255.255.255
int lo8
ip add 69.4.1.1 255.255.255.255

router ospf 10
#net 69.0.0.0 0.255.255.255 area 3

R1

access-list 1 deny   69.1.1.1
access-list 1 deny   69.2.1.1
access-list 1 permit any

router ospf 10
distribute-list 1 in

***************************LOG************************
********************************************************

Before applying the configuration n R1

R1

      69.0.0.0/32 is subnetted, 4 subnets
O        69.1.1.1 [110/2] via 16.0.0.6, 00:00:06, FastEthernet0/0
O        69.2.1.1 [110/2] via 16.0.0.6, 00:00:07, FastEthernet0/0
O        69.3.1.1 [110/2] via 16.0.0.6, 00:00:07, FastEthernet0/0
O        69.4.1.1 [110/2] via 16.0.0.6, 00:00:07, FastEthernet0/0

after applying the Configuration

      69.0.0.0/32 is subnetted, 2 subnets
O        69.3.1.1 [110/2] via 16.0.0.6, 00:00:06, FastEthernet0/0
O        69.4.1.1 [110/2] via 16.0.0.6, 00:00:06, FastEthernet0/0

69.1.1.1 & 69.2.1.1 is not in Routing table but it will not prevent prefix in Database so  other router will have routes in  routing table.
filter is  only local to the router’s routing table
in 

R2

R2#sh ip ospf  database |  be  Summary Net Link States
                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
6.6.6.6         1.1.1.1         924         0x80000001 0x006AB4
9.9.9.9         2.2.2.2         1689        0x80000003 0x00E73A
16.0.0.0        1.1.1.1         697         0x80000005 0x009C87
69.1.1.1        1.1.1.1         720         0x80000001 0x00D915
69.2.1.1        1.1.1.1         720         0x80000001 0x00CD20
69.3.1.1        1.1.1.1         720         0x80000001 0x00C12B
69.4.1.1        1.1.1.1         720         0x80000001 0x00B536
172.16.0.2      2.2.2.2         938         0x80000005 0x00ABC6
172.16.0.9      2.2.2.2         938         0x80000005 0x0099E5

      69.0.0.0/32 is subnetted, 4 subnets
O IA     69.1.1.1 [110/4] via 23.0.0.3, 00:13:00, FastEthernet0/1
O IA     69.2.1.1 [110/4] via 23.0.0.3, 00:13:00, FastEthernet0/1
O IA     69.3.1.1 [110/4] via 23.0.0.3, 00:13:00, FastEthernet0/1
O IA     69.4.1.1 [110/4] via 23.0.0.3, 00:13:00, FastEthernet0/1

Case -2 OSPF Filtering with Route-Maps

R1(config)#router ospf 10
R1(config-router)#no distribute-list 1 in

route-map filter deny 10
 match ip address 1
!
route-map filter permit 20
!
!
access-list 1 permit 69.1.1.1
access-list 1 permit 69.2.1.1

!



R1(config-router)#distribute-list route-map filter out
% OUT direction is not allowed in case of OSPF

router ospf 10
distribute-list route-map filter in

**************LOGS***************



R1

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
6.6.6.6         1.1.1.1         1489        0x80000001 0x006AB4
9.9.9.9         2.2.2.2         238         0x80000004 0x00E53B
16.0.0.0        1.1.1.1         1262        0x80000005 0x009C87
69.1.1.1        1.1.1.1         1285        0x80000001 0x00D915
69.2.1.1        1.1.1.1         1285        0x80000001 0x00CD20
69.3.1.1        1.1.1.1         1285        0x80000001 0x00C12B
69.4.1.1        1.1.1.1         1285        0x80000001 0x00B536
172.16.0.2      2.2.2.2         1506        0x80000005 0x00ABC6
172.16.0.9      2.2.2.2         1506        0x80000005 0x0099E5

R1#sh ip  route 69.1.1.1
% Subnet not in table

R1#sh ip  route 69.2.1.1
% Subnet not in table

R1#sh ip  route 69.3.1.1
Routing entry for 69.3.1.1/32
  Known via "ospf 10", distance 110, metric 2, type intra area
  Last update from 16.0.0.6 on FastEthernet0/0, 00:00:49 ago
  Routing Descriptor Blocks:
  * 16.0.0.6, from 66.6.6.6, 00:00:49 ago, via FastEthernet0/0
      Route metric is 2, traffic share count is 1

R1#sh ip  route 69.4.1.1
Routing entry for 69.4.1.1/32
  Known via "ospf 10", distance 110, metric 2, type intra area
  Last update from 16.0.0.6 on FastEthernet0/0, 00:00:57 ago
  Routing Descriptor Blocks:
  * 16.0.0.6, from 66.6.6.6, 00:00:57 ago, via FastEthernet0/0
      Route metric is 2, traffic share count is 1