Pages

Showing posts with label OSPF. Show all posts
Showing posts with label OSPF. Show all posts

Monday, October 3, 2011

OSPF nssa

Not-so-stubby-area

OSPF nssa is the area that prohibits the LSA type 5 into the area but instead allow LSA type 7 to the area for the external routes.

There are options added on to the nssa area
 - area x nssa no-summary
     This area does not allow also the LSA type 3 or above into the area.
 - area x nssa no-redistribute
     This command is used in the the router that acts both ABR and ASBR. This command will not allow redistributed routes LSA type 7 into the nssa area but still allow the type 5 LSA in the OSPF process in area 0 ( backbone area )

Example for the NSSA no-redistribute


From the network diagram above, R2 is working as both ABR and ASBR. It redistributes the network 2.2.2.2/32 into the OSFP domian. However we do not want the router to advertise LSA type 7 in to the nssa area. but it is acceptable to have LSA type 5 in the OSPF domain. Here is the configuration on the R2.


interface Loopback0
 ip address 2.2.2.2 255.255.255.255



router ospf 1
 log-adjacency-changes
 area 1 nssa no-redistribution
 redistribute connected subnets
 network 192.168.1.2 0.0.0.0 area 0
 network 192.168.2.1 0.0.0.0 area 1


Looking at the R1 routing table, we can see the 2.2.2.2/32 network in it.



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
O E2    2.2.2.2 [110/20] via 192.168.1.2, 00:21:56, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
O IA 192.168.2.0/24 [110/20] via 192.168.1.2, 00:34:03, FastEthernet0/0
O IA 192.168.3.0/24 [110/30] via 192.168.1.2, 00:27:32, FastEthernet0/0

However R4 doesn't see the 2.2.2.2/32 network in its database and its routing table.

R4#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
C       4.4.4.4 is directly connected, Loopback0
O IA 192.168.1.0/24 [110/30] via 192.168.3.1, 00:29:46, FastEthernet0/0
O    192.168.2.0/24 [110/20] via 192.168.3.1, 00:29:46, FastEthernet0/0
C    192.168.3.0/24 is directly connected, FastEthernet0/0

So this illustrate how the nssa no-redistribute works.

Wednesday, September 21, 2011

Changing AD in OSPF

As we all know that, the default administrative distance of the OSPF is 110. However, in some cases, we will need to change this value to something else to manipulate the routing table to avoid routing loop or else. We use this following command to accomplish it.

  distance <AD>  <source address> <Mask> <ACL>

In OSPF, the source address is the router-id of the router advertising the network matched in ACL. Therefore, it  is not necessarily the attached routers. See the configuration example below.

We have 4 routers R1,R2,R3,R4. R1 tries to change the administrative distance of the network advertised from R3 from 110 to 50. R3 has the router-id  of 3.3.3.3. Therefore in R1, we can configure as followings.


Here is the routing table of R1


R1
Gateway of last resort is not set

     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.20.20.0 [110/20] via 192.168.1.2, 00:00:01, FastEthernet0/0
O IA 172.16.0.0/16 [110/21] via 192.168.4.1, 00:00:01, FastEthernet0/1
                   [110/21] via 192.168.1.2, 00:00:01, FastEthernet0/0
C    192.168.4.0/24 is directly connected, FastEthernet0/1
     10.0.0.0/32 is subnetted, 1 subnets
C       10.10.10.10 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/20] via 192.168.1.2, 00:00:01, FastEthernet0/0
O    192.168.3.0/24 [110/20] via 192.168.4.1, 00:00:01, FastEthernet0/1
     30.0.0.0/32 is subnetted, 1 subnets
O       30.30.30.30 [110/21] via 192.168.4.1, 00:00:01, FastEthernet0/1
                    [110/21] via 192.168.1.2, 00:00:01, FastEthernet0/0




Check the ospf database seen by R1


 Routing Bit Set on this LSA
  LS age: 137
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 3.3.3.3
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000004
  Checksum: 0x8D28
  Length: 60
  Area Border Router
  Number of Links: 3

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 30.30.30.30
     (Link Data) Network Mask: 255.255.255.255
      Number of TOS metrics: 0
       TOS 0 Metrics: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.3.2
     (Link Data) Router Interface address: 192.168.3.1
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 192.168.2.1
     (Link Data) Router Interface address: 192.168.2.2
      Number of TOS metrics: 0
       TOS 0 Metrics: 10



We can see that R1 receive the LSA database from R3 ( area 0 - same area ).  We apply the distance command to change the AD of ospf network from R3 as followings.



R1 

router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 0.0.0.0 255.255.255.255 area 0
 distance 50 3.3.3.3 0.0.0.0 1


access-list 1 permit any


This will change the AD for the network 30.30.30.30/32 to 50.


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

     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.20.20.0 [110/20] via 192.168.1.2, 00:05:10, FastEthernet0/0
O IA 172.16.0.0/16 [50/21] via 192.168.4.1, 00:05:10, FastEthernet0/1
                   [50/21] via 192.168.1.2, 00:05:10, FastEthernet0/0
C    192.168.4.0/24 is directly connected, FastEthernet0/1
     10.0.0.0/32 is subnetted, 1 subnets
C       10.10.10.10 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/20] via 192.168.1.2, 00:05:10, FastEthernet0/0
O    192.168.3.0/24 [110/20] via 192.168.4.1, 00:05:10, FastEthernet0/1
     30.0.0.0/32 is subnetted, 1 subnets
O       30.30.30.30 [50/21] via 192.168.4.1, 00:05:10, FastEthernet0/1
                    [50/21] via 192.168.1.2, 00:05:10, FastEthernet0/0

Monday, May 30, 2011

OSPF(ASBR) Summary address

There are 2 summarizations in OSPF routing protocols: Area summarization and External summarization. The area summarization is the summarization between the area. We can use "area x range x.x.x.x x.x.x.x" format to do so.  However, in this post, we will talk about external summarization. We use "summary-address x.x.x.x x.x.x.x" format to achieve this. 

In the example below, we consider R1 and the ASBR of the OSPF because it is a gateway between routing protocols (RIP and OSPF). We will show the effect of the "summary-address x.x.x.x x.x.x.x" command here.

We have network 20.1.1.0/24 being redistributed from RIP to OSPF. The 20.1.1.0/24 network will be an external route and shown in the R3 routing table as E2 type. Below shown the result without using the summary address command and with the command enable.


Without "summary-address" command.

Lets view routing table of R3

R3
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

     20.0.0.0/24 is subnetted, 1 subnets
O E2    20.1.1.0 [110/20] via 192.168.2.1, 00:00:01, FastEthernet0/0
     172.16.0.0/24 is subnetted, 3 subnets
C       172.16.1.0 is directly connected, Loopback0
C       172.16.2.0 is directly connected, Loopback1
C       172.16.3.0 is directly connected, Loopback2
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback4
O E2 192.168.1.0/24 [110/20] via 192.168.2.1, 00:08:12, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0


When enable the ASBR summarization at router R1

Let's see the configuration of R1 first regarding the external summarization.
R1
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 redistribute rip subnets
 network 172.16.0.0 0.0.255.255 area 0
 network 192.168.2.0 0.0.0.255 area 0
 summary-address 20.0.0.0 255.0.0.0
 redistribute ospf 1 metric 3

Let's now check the routing table of R3
R3
R3#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

O E2 20.0.0.0/8 [110/20] via 192.168.2.1, 00:07:18, FastEthernet0/0
     172.16.0.0/24 is subnetted, 3 subnets
C       172.16.1.0 is directly connected, Loopback0
C       172.16.2.0 is directly connected, Loopback1
C       172.16.3.0 is directly connected, Loopback2
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback4
O E2 192.168.1.0/24 [110/20] via 192.168.2.1, 00:08:03, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0





Friday, March 11, 2011

OSPF Demand-Circuit

In the normal OSPF process, OSPF sets the age of the LSA to 30 minutes. When the LSA timer expires, the router flooding / refresh the LSA again. This is to ensure that each router has the updated OSPF database. However, in the pay-per-use link or low-speed link, we sometimes do not want to enable the 30 minutes LSA aging time. We can enable OSPF demand-circuit to help us for this purpose.

The OSPF demand-circuit will set LSA age bit to DONOTAGE value. By setting this the LSA aging process is stopped and no periodic update.

Command

interface s1/1
   ip ospf demand-circuit




.

Sunday, January 30, 2011

OSPF tunnel recursive routing issue

Core Issue

If the tunnel interface learns that the best path to the tunnel destination is through the tunnel itself, the interface shuts down temporarily.

Resolution

To avoid recursive routing problems, keep passenger and transport network routing information disjointed with one of these methods:

  • Use a different Autonomous System (AS) number or tag.
  • Use a different routing protocol.
  • Use static routes to override the first hop, but watch for routing loops. For more information, refer to the Special Considerations section of Configuring Logical Interfaces.




Example Scenario



Configuration Plan 


Tunnel specification
Tunnel source: Loopback interface (10.1.1.1/24)
Tunnel destination :  10.1.2.1/24
Tunnel ip address : 172.16.1.1/24




Before Tunnel created
R1 has static default route sending out to R2. Therefore, destination tunnel (10.1.2.1/24) is reachable though static route.


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 192.168.1.2 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R    192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:02, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 192.168.1.2


However, when we configure the tunnel interface between R1 and R2 with the tunnel source and destination as stated above. The destination tunnel is now reachable through the tunnel itself instead of through static route. 



After tunnel configuration
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 192.168.1.2 to network 0.0.0.0

     172.16.0.0/24 is subnetted, 1 subnets
C       172.16.1.0 is directly connected, Tunnel0
     10.0.0.0/24 is subnetted, 2 subnets
O       10.1.2.0 [110/11112] via 172.16.1.2, 00:00:02, Tunnel0
C       10.1.1.0 is directly connected, Loopback0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R    192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:05, FastEthernet0/0
S*   0.0.0.0/0 [1/0] via 192.168.1.2



From the core issue above which stated that 

"If the tunnel interface learns that the best path to the tunnel destination is through the tunnel itself, the interface shuts down temporarily."

At this time the tunnel interface learns the path to the tunnel destination through the tunnel interface itself. (172.16.1.2 = tunnel interface ). Therefore, it create the tunnel recursive routing issue as shown below that the tunnel interface will be temporary disable.




01:11:39: %LINEPROTO-5-UPDOWN:
          Line protocol on Interface Tunnel0, changed state to up
01:11:48: %TUN-5-RECURDOWN:
          Tunnel0 temporarily disabled due to recursive routing
01:11:49: %LINEPROTO-5-UPDOWN:
          Line protocol on Interface Tunnel0, changed state to down
01:12:49: %LINEPROTO-5-UPDOWN:
          Line protocol on Interface Tunnel0, changed state to up
01:12:58: %TUN-5-RECURDOWN:
          Tunnel0 temporarily disabled due to recursive routing
01:12:59: %LINEPROTO-5-UPDOWN:
          Line protocol on Interface Tunnel0, changed state to down

Saturday, January 29, 2011

OSPF authentication

Sample command of the OSPF md5 authentiation


Configuration


R1
interface serial 0/0
ip ospf message-digest-key 1 md5 PASSWORD

router ospf 10
area 0 authentication message-digest




Tuesday, January 18, 2011

IPv6 OSPF Configuration

OSPF IPv6 configuration example



Tasks :
-  Set up IPv6 according to the diagram
-  Configure Area 10 as a nssa
-  Redistribute network 1111::/64 into ospf area.
-  Configure Area 2 as a standard OSPF area
-  Verify that R4 has 1111::/64 in its database type 5 advertised from R2
-  Verify that R3 has 1111::/64 in its database type 7

Configuration
****Download Here  *****


Verify
R4 has 1111::/64 in its database type 5 advertised from R2

R4#sh ipv6 ospf database

            OSPFv3 Router with ID (4.4.4.4) (Process ID 1)

<omitted>

                Type-5 AS External Link States

ADV Router      Age         Seq#        Prefix
2.2.2.2         671         0x80000001  1111::/64
R4#

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

Verify that R3 has 1111::/64 in its database type 7 

R3#sh ipv6 ospf database

            OSPFv3 Router with ID (3.3.3.3) (Process ID 1)

                Type-7 AS External Link States (Area 10)

ADV Router      Age         Seq#        Prefix
3.3.3.3         753         0x80000001  1111::/64

                Link (Type-8) Link States (Area 10)

ADV Router      Age         Seq#        Link ID    Interface
2.2.2.2         1021        0x80000002  5          Fa0/0
3.3.3.3         786         0x80000002  4          Fa0/0

                Intra Area Prefix Link States (Area 10)

ADV Router      Age         Seq#        Link ID    Ref-lstype  Ref-LSID
3.3.3.3         781         0x80000001  4096       0x2002      4

Saturday, January 15, 2011

OSPF-RIP Sub-Optimal problem

OSPF-RIP Sub-Optimal problem

Suboptimal problem can occur when there are 2 or more routers connecting between 2 routing domain, especially OSPF and RIP. The behavior of suboptimal problem is router will use suboptimal path to forward the packets. This example below shows the suboptimal problem and how to solve it if it occurs.

Example

R1 and R2 are routers between 2 routing domain: OSPF and RIP.  R1 and R2 both redistribute RIP routers to OSPF domain. Consider network 10.10.10.0/24 in the routing table of R2 before and after redistribution


Before 
R2#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

     172.16.0.0/24 is subnetted, 2 subnets
O       172.16.1.0 [110/20] via 172.16.2.2, 00:34:13, FastEthernet0/1
C       172.16.2.0 is directly connected, FastEthernet0/1
R    10.0.0.0/8 [120/1] via 192.168.2.2, 00:00:06, FastEthernet0/0
R    192.168.1.0/24 [120/1] via 192.168.2.2, 00:00:06, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0


After redistribution

R2# 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

     172.16.0.0/24 is subnetted, 2 subnets
O       172.16.1.0 [110/20] via 172.16.2.2, 00:30:30, FastEthernet0/1
C       172.16.2.0 is directly connected, FastEthernet0/1
O E2 10.0.0.0/8 [110/20] via 172.16.2.2, 00:07:18, FastEthernet0/1
O E2 192.168.1.0/24 [110/20] via 172.16.2.2, 00:07:18, FastEthernet0/1
C    192.168.2.0/24 is directly connected, FastEthernet0/0
R2#


We can see from the before and after routing table of R2 that the optimal path to 10.10.10.0/24 is through R3. However, when doing the redistribution we found out that R2 uses path through R4 in order to reach 10.10.10.0/24 which is called suboptimal path problem.

Suboptimal path



This problem occurs between OSPF and RIP. The reason that R2 chooses R4 as a next-hop to reach 10.10.10.0/24 is R2 received 10.10.10.0/24 information from R1 via OSPF (E2). At this time, R2 has 2 paths to reach 10.10.10.0/24 network via RIP and VIA OSPF(E2). Because the administrative distance of OSFP is better than RIP, R2 therefore choose OSPF path. That caused the suboptimal problem.

Solution of Suboptimal problem

1. AD distance ospf external 180
Set the administrative distance of the external route in OSPF domain from 120 to 180 when redistribute route at R1. R2 will see OSPF(E2) which has AD = 180 and compare with RIP which is 120. Then R2 will choose RIP route to reach 10.10.10.0/24 network since RIP AD is better than 180.

R1#
router ospf 1
distance ospf external 180

R2#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

     172.16.0.0/24 is subnetted, 2 subnets
O       172.16.1.0 [110/20] via 172.16.2.2, 00:00:56, FastEthernet0/1
C       172.16.2.0 is directly connected, FastEthernet0/1
R    10.0.0.0/8 [120/1] via 192.168.2.2, 00:00:22, FastEthernet0/0
R    192.168.1.0/24 [120/1] via 192.168.2.2, 00:00:22, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
R2#

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

2. Change RIP AD  from 120 to 109
Administrative distance of OSPF is 110 as opposed to RIP which is 120. This solution suggested that we change RIP AD to 109. Therefore, when R2 received 10.10.10.0/24 information from both OSPF and RIP. It will choose RIP since it has better administrative distance.

R1#
router rip
distance 109


R2#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

     172.16.0.0/24 is subnetted, 2 subnets
O       172.16.1.0 [110/20] via 172.16.2.2, 00:00:22, FastEthernet0/1
C       172.16.2.0 is directly connected, FastEthernet0/1
R    10.0.0.0/8 [109/1] via 192.168.2.2, 00:00:11, FastEthernet0/0
R    192.168.1.0/24 [109/1] via 192.168.2.2, 00:00:11, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
R2#


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

3. Use distribute list blocking RIP route at R2 from R1
When redistributing RIP into OSPF, we can set a tag on all routes from RIP. In this example, we set tag 100 to RIP routes.



R1#
router ospf 1
redistribute rip subnets tag 100

R2 needs to create a route-map denying routes which has tag 100 into its routing table.

R2
router ospf 1
 router-id 2.1.1.1.1
 log-adjacency-changes
 redistribute rip subnets tag 100
 network 172.16.0.0 0.0.255.255 area 0
 distribute-list route-map no-ospf-tag-100-in in
!
!

R2
// creating a route-map

route-map no-ospf-tag-100-in deny 10
 match tag 100
!
route-map no-ospf-tag-100-in permit 20
!
!

Verify configuration 

R2#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

     172.16.0.0/24 is subnetted, 2 subnets
O       172.16.1.0 [110/20] via 172.16.2.2, 00:00:01, FastEthernet0/1
C       172.16.2.0 is directly connected, FastEthernet0/1
R    10.0.0.0/8 [120/1] via 192.168.2.2, 00:00:19, FastEthernet0/0
R    192.168.1.0/24 [120/1] via 192.168.2.2, 00:00:19, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/0
R2#

Friday, January 7, 2011

OSPF interesting Command

OSPF is a very popular routing protocol using in the network these days. Here below are the interesting command that helps optimizing / improving and better controlling your OSPF environment.

Flood Reduction
ip ospf flood-reduction
Reduces unneccessary flooding and refreshing of LSA in satable networks

No advertise database
ip ospf database-filter all out
To filter outgoing LSAs to an OSPF interface

Fast Hello
ip ospf dead-interval minimal hellp-multiplier x
Hello packet will be sent out x times in every 1 second.

Thursday, January 6, 2011

OSPF Virtual Link

OSPF Virtual Link vs GRE tunnel

In a normal circumstance, all OSPF areas are connected to the backbone area (Area 0). However, in some cases, it is a need to connect an area to non-backbone area. To be able to communicate back to area 0, it is required to have virtual link connecting area 0 to the area.  

Basically, the virtual link is a tunnel interface. Therefore, another way to accomplish the virtual link is to configure the GRE tunnel  carrying the ospf packet over between those 2 areas. Here is the key comparison for configuring 2 types of links.

Virtual-link:
  • It is considered part of (Area 0) by default, without any additional configuration.
  • It dose not require any kind of addressing.
  • Configuration is only needed under the OSPF routing process.
  • Only routing updates are tunneled into the virtual-link, but data traffic is not.
  • Transit area can not be a stub area.
GRE tunnel:
  • Tunnel interfaces must be created and addressing is required. (can be unnumbered).
  • Tunnel Address must be advertised into (Area 0) using a network command.
  • Both routing updates and data traffic are tunneled; this introduces more overhead.
  • Transit area can be any type; this means its your only option if the transit is a stub area.

Ref  :  http://www.networkers-online.com/blog/2008/10/ospf-virtual-links-vs-gre-tunnels/

Below is an example of the disconnected area.



From the diagram above area 10 needs to connect to area 0 via area 25. Virtual links or GRE tunnel is required between them.

Virtual Link configuration

R1
router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 area 25 virtual-link 3.3.3.3 (neighbor ID)
 network 10.1.1.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.255 area 25

R3
router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 area 25 virtual-link 1.1.1.1 (neighbor ID)
 network 172.16.1.0 0.0.0.255 area 10
 network 192.168.1.0 0.0.0.255 area 25


R2 Routing table

Gateway of last resort is not set

     20.0.0.0/24 is subnetted, 1 subnets
O IA    20.20.20.0 [110/4] via 10.1.1.2, 15:35:29, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.1.0 [110/3] via 10.1.1.2, 15:35:29, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0
O IA 192.168.1.0/24 [110/2] via 10.1.1.2, 15:41:46, FastEthernet0/0



GRE tunnel configuration

R1 
interface Tunnel0
 ip address 100.100.100.1 255.255.255.0
 ip ospf 1 area 0
 tunnel source FastEthernet0/1
 tunnel destination 192.168.1.2
!
Tunnel will be put in the area 0

router ospf 1
 router-id 1.1.1.1
 log-adjacency-changes
 network 10.1.1.0 0.0.0.255 area 0
 network 192.168.1.0 0.0.0.255 area 25

R3

interface Tunnel0
 ip address 100.100.100.2 255.255.255.0
 ip ospf 1 area 0
 tunnel source FastEthernet0/1
 tunnel destination 192.168.1.1
!
Tunnel will be put in the area 0

router ospf 1
 router-id 3.3.3.3
 log-adjacency-changes
 network 172.16.1.0 0.0.0.255 area 10
 network 192.168.1.0 0.0.0.255 area 25

Verify tunnel interface 

R3#sh ip int brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            172.16.1.1      YES manual up                    up
FastEthernet0/1            192.168.1.2     YES manual up                    up
Loopback0                  3.3.3.3         YES manual up                    up
Tunnel0                    100.100.100.2   YES manual up                    up

R3#ping 100.100.100.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.100.100.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/48/72 ms


R2 Routing table
Gateway of last resort is not set

     100.0.0.0/24 is subnetted, 1 subnets
O       100.100.100.0 [110/11112] via 10.1.1.2, 00:00:10, FastEthernet0/0
     20.0.0.0/24 is subnetted, 1 subnets
O IA    20.20.20.0 [110/11114] via 10.1.1.2, 00:00:00, FastEthernet0/0
     172.16.0.0/24 is subnetted, 1 subnets
O IA    172.16.1.0 [110/11113] via 10.1.1.2, 00:00:00, FastEthernet0/0
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0
O IA 192.168.1.0/24 [110/2] via 10.1.1.2, 00:09:38, FastEthernet0/0
R2#