Now that we understanding the details about the Routing table and the forwarding table, I would like to show you a LAB where we can have more insight about this topic.
I do have my Juniper router having a static default route and have one interface with an IP address.
Let’s see the routing table:
root@R1# run show route
inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:00:10
Discard
10.10.10.0/24 *[Direct/0] 00:53:58
> via ge-0/0/2.0
10.10.10.1/32 *[Local/0] 00:53:58
Local via ge-0/0/2.0
It shows inet.0 meaning that it is for unicast routing and 3 routes are active.
The 0.0.0.0/0 is a default static route that I have created, so anyone want to go to any destination network which is not in the routing table, it will use this default route.
The 10.10.10.0/24 entry is because I have an IP address on ge-0/0/2 then it will add its network id as a Direct type, and will add the IP address of a local type.
Let’s see how if a packet wants to go to 8.8.8.8, which of those 3 routes it will choose:
root@R1> show route 8.8.8.8
inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:07:12
Discard
root@R1>
Indeed, it will take the default route to reach 8.8.8.8 because the other entries do not match.
If you want to see the direct routes only on your router, that’s possible to use this command:
root@R1> show route protocol direct
inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
10.10.10.0/24 *[Direct/0] 01:03:08
> via ge-0/0/2.0
This will show you the Direct routes. If you want to see the static, OSPF, RIP or any other protocol, you just need to replace the word “direct” by the protocol that you wish to see.
root@R1> show route protocol ?
Possible completions:
access Access route
access-internal Access-internal route
aggregate Locally generated aggregate route
anchor Anchor route
arp Prefixes learned via ARP
bgp Border Gateway Protocol
ccc Circuit cross-connect
direct Directly connected routes
dvmrp Distance Vector Multicast Routing Protocol
esis End System-to-Intermediate System
evpn EVPN
flow Locally defined flow route
frr Prefixes created by Host (Direct route) Fast reroute
isis Intermediate System-to-Intermediate System
l2circuit Layer 2 circuit
l2vpn Layer 2 virtual private network
ldp Label Distribution Protocol
local Local system addresses
mpls Multiprotocol Label Switching
msdp Multicast Source Discovery Protocol
mvpn BGP-MVPN Protocol
ospf Open Shortest Path First
The other thing that I want to show you, in case you have 2 or more path to a destination and one of them is the active and the other is inactive, and you just want to see the active ones, you can issue the following command:
root@R1> show route active-path
inet.0: 3 destinations, 3 routes (3 active, 0 holddown, 0 hidden)
+ = Active Route, – = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:12:55
Discard
10.10.10.0/24 *[Direct/0] 01:06:43
> via ge-0/0/2.0
10.10.10.1/32 *[Local/0] 01:06:43
Local via ge-0/0/2.0
Of course, in my case all paths are active, but if you had inactive paths then they won’t show up with this command.
We have seen now the routing table, let’s see the forwarding table which is inside the routing engine, mainly called master forwarding table:
root@R1> show route forwarding-table
Routing table: default.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default user 0 dscd 34 2
default perm 0 rjct 36 1
0.0.0.0/32 perm 0 dscd 34 2
10.10.10.0/24 intf 0 rslv 555 1 ge-0/0/2.0
10.10.10.0/32 dest 0 10.10.10.0 recv 553 1 ge-0/0/2.0
10.10.10.1/32 intf 0 10.10.10.1 locl 554 2
10.10.10.1/32 dest 0 10.10.10.1 locl 554 2
10.10.10.255/32 dest 0 10.10.10.255 bcst 552 1 ge-0/0/2.0
224.0.0.0/4 perm 0 mdsc 35 1
224.0.0.1/32 perm 0 224.0.0.1 mcst 31 1
255.255.255.255/32 perm 0 bcst 32 1
Routing table: __master.anon__.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 rjct 521 1
0.0.0.0/32 perm 0 dscd 519 1
224.0.0.0/4 perm 0 mdsc 520 1
224.0.0.1/32 perm 0 224.0.0.1 mcst 516 1
255.255.255.255/32 perm 0 bcst 517 1
—(more)—
Please have a look at the default destination. There are types: user and permanent.
The user one is the default route that is being configured by someone on the Juniper router and it has a priority over the permanent one because it comes before it. Meaning that if you have a default route, then all traffic which don’t have an entry in the forwarding table will go to the default route. In case no default route is being created, then they will go to the permanent one which is created by the Juniper kernel and has an action as reject, meaning it will drop the packet.
Finally, let’s have a look of the forwarding table inside the packet forwarding engine:
root@R1> show pfe route ip
Slot 0
IPv4 Route Table 0, default.0, 0x0:
Destination NH IP Addr Type NH ID Interface
——————————— ————— ——– —– ———
default Discard 34 RT-ifl 0
0.0.0.0 Discard 34 RT-ifl 0
10.10.10/24 Resolve 555 RT-ifl 329 ge-0/0/2.0 ifl 329
10.10.10.0 10.10.10.0 Recv 553 RT-ifl 329 ge-0/0/2.0 ifl 329
10.10.10.1 10.10.10.1 Local 554 RT-ifl 0
10.10.10.255 Bcast 552 RT-ifl 329 ge-0/0/2.0 ifl 329
224/4 mdiscard 35 RT-ifl 0
224.0.0.1 Mcast 31 RT-ifl 0
255.255.255.255 Bcast 32 RT-ifl 0
IPv4 Route Table 1, __juniper_private1__.1, 0x20:
Destination NH IP Addr Type NH ID Interface
——————————— ————— ——– —– ———
—(more)—
Based on this table, all packets are being routed on the Juniper router.
This is all what I wanted to show you in this lesson, see you in the upcoming one 😊
0 Comments