This was a simple straight answer for my requirement, Let me pen down the requirement exactly.
I am having multiple static routes on my router while i have to advertise only few of them. When i was checking for the redistribute static command i got this option of route map.
All i have done is created prefix list to permit the segments which i want to advertise and match that prefix list with the routemap and advertise static subnets of routemap. Configuration is as below
router ospf 100
log-adjacency-changes
redistribute static subnets route-map LAN
network 20.0.0.0 0.0.0.255 area 0
network 30.0.0.0 0.0.0.255 area 0
!
ip route 50.0.0.0 255.255.255.0 30.0.0.2
ip route 60.0.0.0 255.255.255.0 30.0.0.2
ip route 70.0.0.0 255.255.255.0 30.0.0.2
ip prefix-list LAN seq 10 permit 40.0.0.0/24
ip prefix-list LAN seq 20 permit 50.0.0.0/24
ip prefix-list LAN seq 30 permit 60.0.0.0/24
Now the neighbors are learing only 50.0.0.0/24 and 60.0.0.0/24 subnets not all.
I am having multiple static routes on my router while i have to advertise only few of them. When i was checking for the redistribute static command i got this option of route map.
All i have done is created prefix list to permit the segments which i want to advertise and match that prefix list with the routemap and advertise static subnets of routemap. Configuration is as below
router ospf 100
log-adjacency-changes
redistribute static subnets route-map LAN
network 20.0.0.0 0.0.0.255 area 0
network 30.0.0.0 0.0.0.255 area 0
!
ip route 50.0.0.0 255.255.255.0 30.0.0.2
ip route 60.0.0.0 255.255.255.0 30.0.0.2
ip route 70.0.0.0 255.255.255.0 30.0.0.2
ip prefix-list LAN seq 10 permit 40.0.0.0/24
ip prefix-list LAN seq 20 permit 50.0.0.0/24
ip prefix-list LAN seq 30 permit 60.0.0.0/24
Now the neighbors are learing only 50.0.0.0/24 and 60.0.0.0/24 subnets not all.