- Maintains two DBs for routing information
- Routing Table - Contains all the routing information learned by all routing protocols.
- Forwarding table - Contains the routes actually used to forward packets through the router.
RoutingTable
- Used by the routing protocol processes to maintain a DB of routing info.
- The routing protocol process stores statically configured routes, directly connected interface routes, and all routing info learned from all routing protocols.
- The routing process uses this routing info to select active route which is the best possible route to forward packets.
- By default, Junos maintains three kinds of routing tables:
- Unicast Routing Table: Info about all unicast routing protocols - BGP (Border Gateway Protocol), IS-IS (Intermediate System Protocol), OSPF (Open Shortest Path First), RIP (Routing Information Protocol), etc…
- Multicast Routing Table: DVMRP (Distance Vector Multicast Routing Protocol), PIM (Protocol Independent Multicast)
- MPLS Routing Table: Stores MPLS (Multi Protocol Label Switching) path and label information.
Few important routing tables in Junos Devices:
inet.0
- default IPv4 unicast RT.
inet.1
- IPv4 multicast forwarding cache.
inet.2
- Unicast routes for multicast reverse path forwarding (RPF) lookup.
inet.3
- IPv4 MPLS routing table for path information.
inet6.0
- Default IPv6 unicast routing table.
inet6.1
- IPv6 Multicast forwarding cache.
mpls.0
- for MPLS label switching operations.
iso.0
- used for IS-IS routing.
Forwarding Table
- All active routes from the routing table are installed into the forwarding table.
- Junos Kernel maintains a master copy of the forwarding table.
- It copies the forwarding table to the packet forwarding engine, which is responsible for forwarding packets.
show route
- displays the routing table
- holdown routes - are in pending state before its decalred as inactive.
- hidden - routes that are not used because of a routing policy.
- The number after the
*[Static/
indicates the preference value.
- To know the route to a specific host use -
show route your-host-ip-address
show route protocol direct/static
- shows only direct or static routes.
show route terse/extensive/brief
show route active-path
show route forwarding-table
Destination Type
perm
- routes that are installed by kernel.
dest
- remote addresses directly reachable through interface.
intf
- installed as a result of configuring an interface.
user
- installed by the routing protocol process or as a sresult of the configuration.
iddn
- destination route for which the interface is unreachable.
ignr
- ignore this route.
Next Hop Types
ucst
- unicast.
bcst
- broadcast.
hold
- next hop is waiting to be resolved into a uni/multicast.
locl
- local address of an interface.
indr
- indirect next hop.
dscd
- discards silently without sending ICMP unreachable message.
rjct
- discards but sends ICMP message.
Static Routing
- Permanent fixtures in the routing and forwarding tables
- These routes generally do not change and are not manipulated by external protocols.
- To create a static route in the routing table, you must, at minimum define the route as static, define the network you want to route to and associate a next-hop IP with it
- Route is inserted into the forwarding table when the next-hop address is reachable.
[edit routing-options]
# set static route 198.168.5.1 next-hop 10.1.1.1
# commit
# run show route
Resolve
- By default, Junos requires that the next hop IP of static routes be reachable using the direct route.
- unlike software from other vendors, Junos does not perform recursive lookups of next hops by default.
- This behavior can be changed by using the
resolve
keyword.
- In addition to the
resolve
option, a route to the indirect next hop is also required.
No Re-advertise
- Static routes are eligible to be advertised that is exported from the routing table into dynamic routing protocols, if a policy to do so in configured.
- To mark an IPv4 route to be not advertised, we need to use
no-advertise
option.
- It is recommended to use
no-advertise
option on static routes used for management traffic.
Qualified Next Hop
- A static route can have multiple next hops associated with it.
- In such cases, multiple routes are inserted into the routing table, and Junos must make a route selection.
- By default, Junos chooses in a random fashion one of the next-hop addresses to install into the forwarding table.
- qualified next hop allows to configure multiple next-hop addresses for a route and have them treated differently.
Route Retention
- By default, static routes are not retained in the forwarding table when the routing process shutdowns like router reboot or something.
- When the routing process starts up again, any route configures as static routes must be added to the forwarding table again.
- This can cause latency, so we can use the
retain
keyword.
set static route 192.168.1.1/24 retain
Passive Route
- When a static route;s next-hop address is unreachable, the route is marked as passive, and it is removed from the routing or forwarding tables.
- Marking a route as
passive
forces the route to be included in the routing tables regardless of next-hop reachability.
- -
set static route 192.168.1.1/24 passive
Dynamic Routing
- Easy to configure - No need of manual configs.
- Increased network availability - when routes change or fail, updates are done automatically.
- Better network scalability - On growth of network, new routes may emerge which are easily learnt.
- Autonomous System - Means a collection of routers under a common administrative domain.
- Dynamic Routing protocols can be classified as
- Exterior Gateway - Used for routing between autonomous systems (Inter-autonomous system routing). Eg: BGP.
- Interior Gateway - Inside an autonomous system (Intra-autonomous system routing). Eg: RIP, OSPF, IGRP.
- Distance Vector
- Link State
Routing Instances
- A routing instance is a collection of routing tables, interfaces and routing protocol parameters.
- Each routing instance has a unique name and corresponding unicast table.
- For eg, if you config a routing instance with the name
my-instance
, the corresponsing IP unicast table is my-instance.init.0
- By using routing instances, a single device can effectively imitate multiple devices.
- Imagine you can have two different customers to manage and you group their devices into two different routing instaces where one won’t communicate with another by default.
- logically split your Junos device into multiple instances.
[edit routing-instance R1]
# set instance-type virtual-router
# set interface ge-0/0/1.0
# top
[edit]
# commit