How to configure Multi-Area OSPF on Juniper

In this lesson, we will learn how to configure multi-area OSPF on Juniper. This is the second part of our Juniper OSPF configuration series.

Before starting the configuration, we should know a few terms related to the OSPF. These are – DR, BDR, ABR and ASBR.

  • Designated Router (DR) work as a middle point for exchanging of OSPF information among multiple routers on the same, multi-access broadcast network segment.
  • Backup Designated Router (BDR) has the same role as DR but its work as a backup for DR.
  • Area Border Router (ABR) connects two or more OSPF areas.
  • Autonomous system boundary router (ASBR) has one interface which are connected with OSPF and other interface is connected with another routing protocol like BGP, IS-IS, etc.
We will be using below topology for our lab. Here, R2 is the ABR. We are not using any other routing protocol, that’s why no one is ASBR.

How to Configure Multi-area OSPF on Juniper

Advertisements

Configuring OSPF

First of all, let’s check the interface configuration of all routers.

R1:
set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.1/30
set interfaces lo0 unit 0 family inet address 1.1.1.1/32
R2:
set interfaces ge-0/0/0 unit 0 family inet address 10.1.1.2/30
set interfaces ge-0/0/1 unit 0 family inet address 10.2.2.1/30
set interfaces ge-0/0/2 unit 0 family inet address 10.3.3.1/30
set interfaces lo0 unit 0 family inet address 2.2.2.2/32
R3:
set interfaces ge-0/0/1 unit 0 family inet address 10.2.2.2/30
set interfaces ge-0/0/3 unit 0 family inet address 10.4.4.1/30
set interfaces lo0 unit 0 family inet address 3.3.3.3/32
R4:
set interfaces ge-0/0/2 unit 0 family inet address 10.3.3.2/30
set interfaces ge-0/0/3 unit 0 family inet address 10.4.4.2/30
set interfaces lo0 unit 0 family inet address 4.4.4.4/32

Now, let’s configure OSPF.

R1:
[edit]
root@R1# set protocols ospf area 0.0.0.1 interface ge-0/0/0.0

[edit]
root@R1# set protocols ospf area 0.0.0.1 interface lo0.0

[edit]
root@R1# show | compare
[edit]
+  protocols {
+      ospf {
+          area 0.0.0.1 {
+              interface ge-0/0/0.0;
+              interface lo0.0;
+          }
+      }
+  }

[edit]
root@R1# commit
commit complete

[edit]
root@R1#
show | compare” helps us to see candidate configuration (recent configuration which is not committed yet.

Here for R1, our OSPF area is 0.0.0.1. We do not need to use any special commands for this, just need to put the area as 0.0.0.1.

But, for R2, interface ge-0/0/0 is in area 0.0.0.1 and the other interfaces is in 0.0.0.0 area. That’s why it will be ABR which connect area 0.0.0.1 and 0.0.0.0.

R2:
[edit]
root@R2# set protocols ospf area 0.0.0.1 interface ge-0/0/0.0

[edit]
root@R2# set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

[edit]
root@R2# set protocols ospf area 0.0.0.0 interface ge-0/0/2.0

[edit]
root@R2# set protocols ospf area 0.0.0.0 interface lo0.0

[edit]
root@R2# show | compare
[edit]
+  protocols {
+      ospf {
+          area 0.0.0.1 {
+              interface ge-0/0/0.0;
+          }
+          area 0.0.0.0 {
+              interface ge-0/0/1.0;
+              interface ge-0/0/2.0;
+              interface lo0.0;
+          }
+      }
+  }

[edit]
root@R2# commit
commit complete

[edit]
root@R2#

Now, let’s quickly configure R3 and R4.

Advertisements
R3:
[edit]
root@R3# set protocols ospf area 0.0.0.0 interface ge-0/0/1.0

[edit]
root@R3# set protocols ospf area 0.0.0.0 interface ge-0/0/3.0

[edit]
root@R3# set protocols ospf area 0.0.0.0 interface lo0.0

[edit]
root@R3# commit
commit complete

[edit]
root@R3#
R4:
[edit]
root@R4# set protocols ospf area 0.0.0.0 interface ge-0/0/2.0

[edit]
root@R4# set protocols ospf area 0.0.0.0 interface ge-0/0/3.0

[edit]
root@R4# set protocols ospf area 0.0.0.0 interface lo0.0

[edit]
root@R4# commit
commit complete

[edit]
root@R4#

This is all the configuration, when we have multiple areas in OSPF for Junos enabled devices. At this point, let’s verify our OSPF for all four routers.

R1:
root@R1> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.1.1.2         ge-0/0/0.0             Full      2.2.2.2          128    32

R2:
root@R2> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.2.2.2         ge-0/0/1.0             Full      3.3.3.3          128    34
10.3.3.2         ge-0/0/2.0             Full      4.4.4.4          128    33
10.1.1.1         ge-0/0/0.0             Full      1.1.1.1          128    33

R3:
root@R3> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.2.2.1         ge-0/0/1.0             Full      2.2.2.2          128    38
10.4.4.2         ge-0/0/3.0             Full      4.4.4.4          128    33

R4:
root@R4> show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.3.3.1         ge-0/0/2.0             Full      2.2.2.2          128    39
10.4.4.1         ge-0/0/3.0             Full      3.3.3.3          128    31

It looks like our OSPF is UP and running perfectly. Let’s check routes in R1 and R2.

R1:
root@R1> show route

inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[Direct/0] 02:58:49
                    > via lo0.0
2.2.2.2/32         *[OSPF/10] 00:19:49, metric 1
                    > to 10.1.1.2 via ge-0/0/0.0
3.3.3.3/32         *[OSPF/10] 00:19:42, metric 2
                    > to 10.1.1.2 via ge-0/0/0.0
4.4.4.4/32         *[OSPF/10] 00:19:42, metric 2
                    > to 10.1.1.2 via ge-0/0/0.0
10.1.1.0/30        *[Direct/0] 04:06:56
                    > via ge-0/0/0.0
10.1.1.1/32        *[Local/0] 04:07:00
                      Local via ge-0/0/0.0
10.2.2.0/30        *[OSPF/10] 00:19:49, metric 2
                    > to 10.1.1.2 via ge-0/0/0.0
10.3.3.0/30        *[OSPF/10] 00:19:49, metric 2
                    > to 10.1.1.2 via ge-0/0/0.0
10.4.4.0/30        *[OSPF/10] 00:19:42, metric 3
                    > to 10.1.1.2 via ge-0/0/0.0
224.0.0.5/32       *[OSPF/10] 00:22:55, metric 1
                      MultiRecv

root@R1>
R2:
root@R2> show route

inet.0: 12 destinations, 12 routes (12 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[OSPF/10] 00:20:23, metric 1
                    > to 10.1.1.1 via ge-0/0/0.0
2.2.2.2/32         *[Direct/0] 02:59:04
                    > via lo0.0
3.3.3.3/32         *[OSPF/10] 00:20:18, metric 1
                    > to 10.2.2.2 via ge-0/0/1.0
4.4.4.4/32         *[OSPF/10] 00:20:18, metric 1
                    > to 10.3.3.2 via ge-0/0/2.0
10.1.1.0/30        *[Direct/0] 04:06:58
                    > via ge-0/0/0.0
10.1.1.2/32        *[Local/0] 04:06:59
                      Local via ge-0/0/0.0
10.2.2.0/30        *[Direct/0] 04:06:57
                    > via ge-0/0/1.0
10.2.2.1/32        *[Local/0] 04:06:59
                      Local via ge-0/0/1.0
10.3.3.0/30        *[Direct/0] 04:06:57
                    > via ge-0/0/2.0
10.3.3.1/32        *[Local/0] 04:06:59
                      Local via ge-0/0/2.0
10.4.4.0/30        *[OSPF/10] 00:20:18, metric 2
                    > to 10.2.2.2 via ge-0/0/1.0
                      to 10.3.3.2 via ge-0/0/2.0
224.0.0.5/32       *[OSPF/10] 00:20:39, metric 1
                      MultiRecv

root@R2>
R3:
root@R3> show route protocol ospf

inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[OSPF/10] 00:23:54, metric 2
                    > to 10.2.2.1 via ge-0/0/1.0
2.2.2.2/32         *[OSPF/10] 00:23:54, metric 1
                    > to 10.2.2.1 via ge-0/0/1.0
4.4.4.4/32         *[OSPF/10] 02:21:47, metric 1
                    > to 10.4.4.2 via ge-0/0/3.0
10.1.1.0/30        *[OSPF/10] 00:23:54, metric 2
                    > to 10.2.2.1 via ge-0/0/1.0
10.3.3.0/30        *[OSPF/10] 00:23:54, metric 2
                    > to 10.2.2.1 via ge-0/0/1.0
                      to 10.4.4.2 via ge-0/0/3.0
224.0.0.5/32       *[OSPF/10] 02:23:30, metric 1
                      MultiRecv

root@R3>
R4:
root@R4> show route protocol ospf

inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

1.1.1.1/32         *[OSPF/10] 00:23:41, metric 2
                    > to 10.3.3.1 via ge-0/0/2.0
2.2.2.2/32         *[OSPF/10] 00:23:41, metric 1
                    > to 10.3.3.1 via ge-0/0/2.0
3.3.3.3/32         *[OSPF/10] 02:21:36, metric 1
                    > to 10.4.4.1 via ge-0/0/3.0
10.1.1.0/30        *[OSPF/10] 00:23:41, metric 2
                    > to 10.3.3.1 via ge-0/0/2.0
10.2.2.0/30        *[OSPF/10] 00:23:41, metric 2
                    > to 10.3.3.1 via ge-0/0/2.0
                      to 10.4.4.1 via ge-0/0/3.0
224.0.0.5/32       *[OSPF/10] 02:21:46, metric 1
                      MultiRecv

root@R4>

Finally, ping can prove everything is OK. We are pinging from R1 to R2, R3, R4 and our source are lo0 (IP: 1.1.1.1).

root@R1> ping 2.2.2.2 source 1.1.1.1 rapid count 50
PING 2.2.2.2 (2.2.2.2): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 2.2.2.2 ping statistics ---
50 packets transmitted, 50 packets received, 0% packet loss
round-trip min/avg/max/stddev = 3.548/10.695/72.269/8.852 ms

root@R1>

root@R1> ping 3.3.3.3 source 1.1.1.1 rapid count 50
PING 3.3.3.3 (3.3.3.3): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 3.3.3.3 ping statistics ---
50 packets transmitted, 50 packets received, 0% packet loss
round-trip min/avg/max/stddev = 7.888/14.405/21.115/4.094 ms

root@R1>

root@R1> ping 4.4.4.4 source 1.1.1.1 rapid count 50
PING 4.4.4.4 (4.4.4.4): 56 data bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
--- 4.4.4.4 ping statistics ---
50 packets transmitted, 50 packets received, 0% packet loss
round-trip min/avg/max/stddev = 8.254/16.774/64.533/9.052 ms

root@R1>

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top