The last topic that I want to discuss in routing is about the instances. By default, all routings that we do belong to the same instance which is inet.0 and we have seen it before in this book.
Now say that your Juniper router is providing services to customers, and you do not want to put all customers in the same instance meaning in the same routing table. So you want each customer to be separated with a routing table by itself and not able to see the routing of the other customers. This way, you can create an instance for each customer and you will be able to separate their routings from each other.
Let’s see on R1 what we have as routing now:
root@R1> show route
inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
1.1.1.1/32 *[Direct/0] 01:18:28
> via lo0.0
2.2.2.2/32 *[Static/5] 01:09:32
> to 192.168.12.2 via ge-0/0/2.0
192.168.12.0/24 *[Direct/0] 01:18:28
> via ge-0/0/2.0
192.168.12.1/32 *[Local/0] 01:18:28
Local via ge-0/0/2.0
root@R1>
I can see that all routing entries are in the same instance which is inet.0.
Let’s say that I want to put 192.168.12.0/24 network in a separated instance, meaning in another routing table. 1st we need to create the new instance:
root@R1# edit routing-instances MY-INSTANCE
[edit routing-instances MY-INSTANCE]
root@R1#
This has been created. Let’s give it a type as virtual-router:
[edit routing-instances MY-INSTANCE]
root@R1# set instance-type ?
Possible completions:
evpn EVPN routing instance
forwarding Forwarding instance
l2backhaul-vpn L2Backhaul/L2Wholesale routing instance
l2vpn Layer 2 VPN routing instance
layer2-control Layer 2 control protocols
mpls-internet-multicast Internet Multicast over MPLS routing instance
no-forwarding Nonforwarding instance
virtual-router Virtual routing instance
virtual-switch Virtual switch routing instance
vpls VPLS routing instance
vrf Virtual routing forwarding instance
[edit routing-instances MY-INSTANCE]
root@R1# set instance-type virtual-router
[edit routing-instances MY-INSTANCE]
root@R1#
When you say the instance-type if virtual-router, you are saying that you are separating the routing table of this instance with the main one.
The last part is to put the interface in that instance:
[edit routing-instances MY-INSTANCE]
root@R1# set interface ge-0/0/2.0
[edit routing-instances MY-INSTANCE]
root@R1# show
instance-type virtual-router;
interface ge-0/0/2.0;
[edit routing-instances MY-INSTANCE]
root@R1#
Great!
Now I will commit the configuration and see if I shall have 2 different routing tables shown:
[edit routing-instances MY-INSTANCE]
root@R1# commit and-quit
commit complete
Exiting configuration mode
root@R1> show route
inet.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
1.1.1.1/32 *[Direct/0] 01:25:26
> via lo0.0
MY-INSTANCE.inet.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
192.168.12.0/24 *[Direct/0] 00:00:02
> via ge-0/0/2.0
192.168.12.1/32 *[Local/0] 00:00:02
Local via ge-0/0/2.0
root@R1>
Here we go. I do have 2 different routing tables and 192.168.12.0/24 network has move to the instance that I have created 😊
This is all what I wanted to show you in this lesson and in this chapter, hope you enjoyed all this chapter’s lessons and see you in the upcoming one 😊
0 Comments