Cisco – Router OSPF to Static Route

ciscoospfpacket-tracerrouterrouting

What configuration do I need to connect ospf configure router to the other one which has a static route?

router 1 config:

hostname ISP
int g0/0
  ip add 210.1.1.1 255.255.255.224
  no shut
int s0/0/1
  ip add 172.20.0.222 255.255.255.252
  no shut
ip route 172.20.0.128 255.255.255.224 s0/0/1
ip route 0.0.0.0 0.0.0.0 s0/0/1

Router 0 config:

hostname R2
int g0/0
  ip add 172.20.0.129 255.255.255.224
  no shut
int s0/0/1
  ip add 172.20.0.221 255.255.255.252
  no shut
int s0/0/0
  ip add 172.20.0.218 255.255.255.252 
  no shut
router ospf 1
router-id 2.2.2.2
network 172.20.0.128 0.0.0.31 area 0
network 172.20.0.220 0.0.0.3 area 0
passive-interface g0/0

Topology

Best Answer

You either use static routes all around, which doesn't scale and needs manual intervention when routes change, or you use a dynamic routing protocol, like OSPF, which can adapt to changing conditions.

A routing protocol like OSPF must be run on all the routers. Running it on only one router doesn't do anything since it is designed to exchange information with other routers running the same routing protocol.

Router don't need a routing protocol to have a routing table, they need a routing protocol to share routes. That doesn't happen unless they are all running the routing protocol.