How to setup basic OSPF on JunOS

By | April 22, 2012
Warning: Trying to access array offset on value of type null in /customers/3/0/4/ on line 72

Just as in the Cisco post we first need to set up the network using the below diagram

Now we need to set the IP address on the interface.

root@% cli
root> configure
Entering configuration mode

root# edit interfaces em0

[edit interfaces em0]
root# edit unit 0

[edit interfaces em0 unit 0]
root# set family inet address

[edit interfaces em0 unit 0]
root# top

root# commit
commit complete

We use the commit command to apply and save the changes we have just made. We need to repete this on the other router. To make sure that we have sussefuly added the IP address to the interface we need to exit out of configuration mode and use the below command

Now we have our IP address we need to enable OSPF on our routers

root# edit protocols ospf

[edit protocols ospf]
root# edit area 0

[edit protocols ospf area]
root# set interface em0.0

[edit protocols ospf area]
root# top

root# commit.

To check OSPF is working we can use the below.

Now I have connected the Cisco routers to the Juniper routers and added the IP address 192.168.20.x to both R1 and JUNOS1 and put that as part of the OSPF process. This can been seen in the below diagram

Now to check if the juniper router have the routes to get to the Cisco routers

We can see that it now has routes to get to the Cisco routers. Now we will try a ping to to ensure reachability.

and now we will do the same but ping from the Cisco router

We can see all is working. All the config gets saved when we use commit on the juniper routers.