IPv4 Static Routing on Juniper

juniper-static-routing

IPv4 Static Route Configuration on Juniper Routers

Static Routing is the manual route configuration on routers. In Juniper JUNOS, static route configuration is done similarly like other vendor operating systems. In this lesson, you will learn how to configure Juniper static route on Juniper routers, we will focus on Junos static route configuration. IPv4 static routing is one of the key configuration lessons of Juniper JNCIA Certification. You can also view Cisco static route configuration example.

 

Here, we will start with“static route” command, and after that, we willl mention the destination network and then we will write next-hop ip address after “next-hop” keyword. By the way, we will do this static route configuration under “routing-options” hierarchy in Juniper JUNOS.

 

For our JUNOS Static Route Configuration, we will use the below simple topology.


juniper-static-routing
 

juniper-junos@Kosem> configure

[edit]
juniper-junos@Kosem# edit routing-options

[edit routing-options]
juniper-junos@Kosem# set static route 10.10.10.0/24 next-hop 172.16.1.1

[edit routing-options]
juniper-junos@Kosem# show static { route 10.10.10.0/24 next-hop 172.16.1.1; }

[edit routing-options] juniper-junos@Kosem# commit

commit complete

 

To show the configured static route, we will use “run show route protocol static” command on Juniper router.

 

juniper-junos@Kosem# run show route protocol static
inet.0: 10 destinations, 1 routes (1 active, 0 holddown, 0 hidden) + = Active Route, – = Last Active, * = Both

10.10.10.0/24 *[Static/5] 00:01:12 > to 172.16.1.1 via ge-1/1/1.0

 

As you can see, the destination network can be reached via ge-1/1/1.0 interface.

 

This means that the next hop is 172.16.1.1 and “static” keyword shows that this is a Static Route. The number beside this keyword shows the default Static Route Preference.

 

By default, static routes have preference value 5 [Static/5]. But this can be change for some network management requirements. After this change, static routes become floating routes. Let’s give an example to these floating static routes.

 

[edit routing-options]
juniper-junos@Kosem# set static default preference 150

[edit routing-options]
juniper-junos@Kosem# commit

commit complete

 

After this change, you can see the change of Preference value. [Static/150]

 

juniper-junos@Kosem# run show route protocol static

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

10.10.10.0/24 *[Static/150] 00:01:12 > to 172.16.1.1 via ge-1/1/1.0

 


 

Aggregate Routes on Juniper Routers

You can aggregate routes in Juniper routers, in JUNOS. To aggregate routes on a Juniper router, we will use “aggregate” command with the aggregation address that covers the other subnets.

 

Think about that there are routes to the below destinations. Let’s aggregate the below addresses:

10.10.10.0/24
10.10.20.0/24
10.10.30.0/24
10.10.40.0/24

 

To calculate the aggregate address, let’s check the third octets(10,20,30,40). Let’s write the binary versions of the third octets values.

00001010
00010100
00011110
00101000

 

As you can see for four values, the first two bits are same. So, only the last six bits are changing. So, our aggregation address’s subnet mask will be like below:

First octet(8 bits) + Second octet(8 bits) + Third octet (2 bits) = 18

 

And the aggregate address will be 10.10.0.0/18.

 

[edit]
juniper-junos@Kosem# routing-options

[edit routing-options]
juniper-junos@Kosem# set aggregate route 10.10.0.0/18

 

To verify the Aggregate route configuration, we will use the below configuration.

 

juniper-junos@Kosem# run show route protocol aggregate

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

10.10.0.0/18 *[Aggregate/130] 00:02:14 Reject

 

To see the details of this aggregated route, to determine the subnets under it, we can use “show route aggregate detail” command.

 

juniper-junos@Kosem# run show route protocol aggregate detail
inet.0: 10 destinations, 20 routes (1 active, 0 holddown, 0 hidden)

10.10.0.0/18 (1 entry, 1 announced)
*Aggregate Preference: 130 Next hop type: Reject State: Age: 4 Task:
Aggregate Announcement bits (2): 0-KRT 5-Resolve inet.0 AS path: I (LocalAgg) Flags: Depth: 0 Active AS path list: AS path: I Refcount: 4 Contributing Routes (3): 10.10.10.0/24 proto Static 10.10.20.0/24 proto Static 10.10.30.0/24 proto Static 10.10.40.0/24 proto Static

 

Lesson tags: Static Routing, junos, juniper
Back to: JNCIS > Protocol-Independant Routing

Leave a Reply

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

Latest Blog Posts