Saturday, September 12, 2015

Facts to remember about OSPF - Part3

OSPF Default Routing

Advertise an external type-2 default route with metric 60 as long as a static default route exist
ip route 0.0.0.0 0.0.0.0 Null0
!
router ospf 1
 default-information originate metric 60
Advertise an external type-1 default route with metric 40 no matter if a static defaul route exist

router ospf 1
 default-information originate always metric 40 metric-type 1
Conditional default routing: Advertise a default route only if prefix 66.66.66.66/32 is in the routing table (when use  route-map option always key is not needed)
interface Loopback66
 ip address 66.66.66.66 255.255.255.255
!
ip prefix-list LOOPBACK66 seq 5 permit 66.66.66.66/32
!
route-map TRACK_LOOPBACK66 permit 10
 match ip address prefix-list LOOPBACK66
!
router ospf 1
 default-information originate route-map TRACK_LOOPBACK66
OSPF Reliable Conditional Default Routing: Advertise a default route only if ICMP reachability is possible every 5 seconds
ip sla 1
 icmp-echo 155.1.108.10
 frequency 5
!
ip sla schedule 1 life forever start-time now
track 1 ip sla 1 state
!
ip route 169.254.0.1 255.255.255.255 Null0 track 1
ip prefix-list PLACEHOLDER seq 5 permit 169.254.0.1/32
!
route-map TRACK_PLACEHOLDER permit 10
 match ip address prefix-list PLACEHOLDER
!
router ospf 1
 default-information originate route-map TRACK_PLACEHOLDER

OSPF Filtering with Distribute-Lists (Intra-area filtering)
This filtering affects only the local routing table not the OSPF database so if you apply this in ABR the routers behind will still point the ABR as the gateway to reach the filtered prefix. So it must be apply to all the routers in the area. Another techniques must be apply for inter area filtering (check stub areas and type 3 LSA filter)
router ospf 1
 distribute-list 1 in
!
access-list 1 deny 150.1.1.1 0.0.0.0
access-list 1 deny 150.1.2.2 0.0.0.0
access-list 1 permit any

OSPF Summarization and Discard Routes
Suppress the matching route to Null0 when a summary in the ABR or ASBR is created in the OSPF domain.
The automatic origination of the discard route can be disabled with the no discard-route [internal | external], where internal refers to inter-area summarization performed with the area range command, and external refers to redistributed summarization performed with the summary-address command.
router ospf 1
 no discard-route internal
 area 2 range 150.1.0.0 255.255.240.0

OSPF Filtering with Administrative Distance
An OSPF route with a 255 AD will not be installed in the routing table but it will not be filtered from the OSPF database ("show ip route" will no show it but "show ip ospf summary A.B.C.D" will), the command "distance" ask for the source address, this is the originator of the prefix (ABR) not the neighbor from which you are learning the route. The originator of the prefix "advertising router"  can be check with the command "show ip ospf database summary A.B.C.D"
access-list 10 permit 155.1.146.0
!
router ospf 1
 distance 255 150.1.5.5 0.0.0.0 10

OSPF Filtering with Route-Maps
"show ip route" shows two ways to reach 155.1.146.0 by  155.1.0.4 and 155.1.0.1 (equal AD and metric). The goal is to use only 155.1.0.1. This doesn't modify OSPF database. I tried to get the same result changing metrics in the route-map but it didn't work cause that would change the OSPF database and this has to be consistent in all the members of the area
access-list 3 permit 155.1.146.0
access-list 4 permit 155.1.0.4
!
route-map DENY_VLAN146_FROM_R4 deny 10
 match ip address 3
 match ip next-hop 4
!         
route-map DENY_VLAN146_FROM_R4 permit 20
!
router ospf 1
 distribute-list route-map DENY_VLAN146_FROM_R4 in



No comments:

Post a Comment