Configuring OSPF on a Cisco router

router(config)#router ospf 1
router(config-router)#network 10.130.0.0 0.0.255.255 area 130

The command turns on the OSPF routing protocol with a process id of 1.
The network line must be added to tell the router which networks will be
participating in OSPF.

This command can be expanded to include stub areas and not so stubby areas.
That is how Cisco refers to it. You can run multiple processes of OSPF using
different
process ids.

Related commands:
show ip ospf neighbor
show ip ospf interface

Router-Id

The OSPF router-id will be, in order:

The one configured by the router-id command, if available and configured.
The highest IP loopback interface when OSPF starts, if a loopback exists.
The highest IP on a non-loopback interface.

Objectives :

1. Configure OSPF. R1 will act as an ASBR by redirecting a series of static routes
into the OSPF network. These Routes should NOT increment their metrics as they
pass through the network and should have an intial
OSPF cost of 200
.

All routers should have a router-id reflecting their hostname, you should be able to
ping this router-id throughout the entire OSPF network.

R1:

router ospf 1
network 172.16.30.1 0.0.0.0 areaO
router i.d 1.1.1.1
redistribute static subnets metric 200 metric-type 2

!

E1 routes increase their metrics.
E2 is default and do not increment their metrics.

!
!

R2:

router ospf 1
network 172.16.31.2 0.0.0.0 areaO
router i.d 2.2.2.2

!
!

Router-id should be set before configuring routing protocol network.
If Router-id is set after configuring routing protocol then router interface
ip address would take precedence.

For router-id the take precedence . run this command to clear the OSPF process :

clear ip ospf process

!

int loopback 1
ip address 10.10.0.1 255.255.25.0
ip ospf network point-to-point

Router OSPF will advertise a /32 loopback 1 since it will see it a /32 due to being
a loopback interface.

ip ospf network point-to-point will see it as a real network /24