Saturday, May 10, 2014

OSPF External Path Selection, TCL PING Scripting

Lessons Learned:

Redistribution from the RIP process into the OSPF process
When the RIP router originates routes as long as the OSPF area is a normal area these are going to be TYPE 5 LSAs in the OSPF database.  Either the E1 or E2 routes, By default the routes will show as E2 and the default metric is 20.

Under the OSPF process –
We simply say –

R4(config-router)#redistribute rip
% Only classful networks will be redistributed (this is a backwards compatibility feature – only clasful summarize will be included in the OSPF database)
R4(config-router)#

This will advertise the RIP routes with the default values.  To remove the classful subnets we need to add the keyword “subnets to the redist – process.

R4(config-router)#redistribute rip subnets
This should advertise anything running RIP including the connected interfaces running RIP into the OSPF database- TYPE 5 LSA”s

                Type-5 AS External Link States

Link ID         ADV Router      Age         Seq#       Checksum Tag
192.168.47.0    192.168.47.4    192         0x80000001 0x00C0AA 0

Or we can view the External
  LS age: 231
  Options: (No TOS-capability, DC)
  LS Type: AS External Link
  Link State ID: 192.168.47.0 (External Network Number )
  Advertising Router: 192.168.47.4
  LS Seq Number: 80000001
  Checksum: 0xC0AA
  Length: 36
  Network Mask: /24
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

All other OSPF routers in the topology should show the RIP routes as E2 routes:

R3#sh ip route
O E2 192.168.47.0/24 [110/20] via 10.1.43.4, 00:04:24, FastEthernet0/0

Also if we show the RIP route specifically

R3#sh ip route 192.168.47.0
Routing entry for 192.168.47.0/24
  Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 1
  Last update from 10.1.43.4 on FastEthernet0/0, 00:06:14 ago
  Routing Descriptor Blocks:
  * 10.1.43.4, from 192.168.47.4, 00:06:14 ago, via FastEthernet0/0
      Route metric is 20, traffic share count is 1

This says – the metric is 20 the type is 2 and the forward is 1 – the forward is to get to the ASBR.
This is a function of the E2 routes. They separate the seed metric plus the metric to the ASBR.
Note: the farther away from the ASBR the Forward metric will increment. If there is ever a tie in the E2 routes, we will look at the forward Metric for the best path.

Note: if we set these routes as External type 1 routes, then there’s no difference between the metric and the forward metric. The only time this really matter is when there are multiple exit points for the domain.

We can set the metric type during redistribution.
Verify –
We need to verify can we reach the destination from the other protocol.
R3#ping 192.168.47.7

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.47.7, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 16/32/44 ms
R3#

And I can reach my RIP router. If we can reach the destination we can assume the redistribution is correct. If the Routing domain is large there would be a lot of checks.
For Verification of a large domain we can use TCL scripts

TCL – stands for the Tool Command Language – this is an open standards language.
IOS – supports TCL 8.3.4
-99% of programming is outside the CCIS scope
-useful in redistribution for automating PING scripts

Only problem with TCL Scripts is the syntax has to be exact and there’s not a real reference guide

TCL PING Script Example:
R3#tclsh  (staring a TCL Shell)
R3(tcl)#foreach X {  (this says create a forloop and define a variable X, for each value that X has, run the ping command for the variables value. )

Ex:
tclsh
#foreach x {            
+>(tcl)# 10.1.43.4
+>(tcl)# 192.168.47.7
+>(tcl)# 172.16.41.1
+>(tcl)# 10.1.16.6
+>(tcl)#} { ping $X }


The end result is it will ping these IP’s in order. 

No comments:

Post a Comment