OSPF into BGP

The following configuration example shows a route map named BGP-LP
with three statements that are used to control which routes will be redistributed
from OSPF into BGP. The router has already been configured with two
access lists, numbered 23 and 103 (not shown.) The first route map statement,
with sequence number 10, is a permit statement. The match condition
tells it to use access list 23. Any traffic permitted by access list 23 matches
this statement and will be redistributed into BGP. Any traffic explicitly
denied by access list 23 will not be redistributed into BGP. The set condition
tells it to set a BGP local preference for all traffic that matches statement 10.
Traffic not matching access list 23 will be checked against the second route
map statement.
The second route map statement, sequence number 20, is a deny statement
that matches access list 103. Any traffic permitted by access list 103 will be
denied by this statement, and thus will not be redistributed. Any traffic
explicitly denied by access list 103 will be ignored by this statement, and
checked against the next route map statement. This route map statement has
no set conditions. Traffic not matching route map statements 10 or 20 will
be checked against statement 30.
The third route map statement, sequence number 30, is a permit statement
with no match or set conditions. This statement matches everything and sets
nothing, thus permitting all other traffic without changing it. Without this
statement, all other traffic would be denied.
Lastly, the route map is applied to the redistribution command, to filter
routes redistributed from OSPF into BGP.
Router(config)#route-map BGP-LP permit 10
Router(config-route-map)#match ip address 23
Router(config-route-map)#set local-preference 200
Router(config-route-map)#!
Router(config-route-map)#route-map BGP-LP deny 20
Router(config-route-map)#match ip address 103
Router(config-route-map)#!
Router(config-route-map)#route-map BGP-LP permit 30
!
Router(config)#router bgp 65001
Router(config-router)#redistribute ospf 1 route-map BGP-LP