device# configure terminal
device(config)# router ospf
device(config-ospf-router)# area 10.0.0.10 range 10.45.0.0 10.255.0.0 cost 20 device(config-ospf-router)# area 10.0.0.20 range 10.45.0.0 10.255.0.0 cost 20
The following example defines an area range for subnets on 10.0.0.10 and 10.0.0.20 and sets a cost of 20 for the area range.
device# configure terminal device(config)# router ospf device(config-ospf-router)# area 10.0.0.10 range 10.45.0.0 10.255.0.0 cost 20 device(config-ospf-router)# area 10.0.0.20 range 10.45.0.0 10.255.0.0 cost 20