Topic: tech juniper jir prev next
tech juniper jir > 03: Routing Instances
Unique collection of routing tables, interfaces and routing protocol parameters.
A single device can imitate multiple devices.
The default routing instance is called master
. The master
routing instance
includes routing tables inet.0
, inet6.0
. It might also contain other,
private tables used by Junos; these can be ignored.
edit routing-instances
Typical uses for user defined routing instances include filter-based forwarding, VPNs and system virtualisation.
Interfaces are assigned to routing instances in the routing-instances
(instance name)
hierarchy.
The command show interfaces terse routing-instance all
will list interfaces,
including the routing instance they are in.
A routing instance can contain its own tables, such as inet.0
, just like the
master
routing instance.
A routing instance configuration can contain the usual routing configuration;
routing-instances {
new-instance {
instance-type virtual-router;
interface ...;
routing-options {
static {
route ...
}
}
protocols {
ospf {
...
}
}
}
}
To test connectivity in the new instance;
ping ... routing-instance new-instance
To show a routing table;
show route table new-instance.inet.0
To show all routing instance;
show route instance
Share routes between routing instances.
FBF: filter based forwarding - forward based on characteristics other then the destination IP address.
The following configuration options are used to share routes between multiple routing instances.
instance-import
instance-export
auto-export
Under edit routing-options
, import-rib
is the list of tables the routes
are shared into and can include multiple tables. export-rib
is the table the
routes are taken from;
routing-options {
rib-groups {
(rib group name) {
export-rib (routing table name);
import-rib (routing table name);
import-policy (policy-name);
}
}
}
In import-rib
, the primary table (where the routes are taken from) must be
listed first. If export-rib
is present, it must be the primary table; hence
export-rib
is often omitted.
RIB groups are applied to routing instances, interfaces, or both.
OSPF routes should be shared from inet.0
to test.inet.0
;
routing-options {
rib-groups {
test {
import-rib [ inet.0 test.inet.0 ];
}
}
}
protocols {
ospf {
rib-group test;
area 0.0.0.0 {
...
}
}
}
A logical tunnel interface can be created to route between instances. A peer relationship is created over the logical interface. Logical tunnels are not supported on all Junos devices.
interfaces {
lt-0/0/0 {
unit 0 {
encapsulation ethernet;
peer-unit 1;
family inet;
}
unit 1 {
encapsulation ethernet;
peer-unit 0;
family inet;
}
}
}