Knowledge Search


×
 

[EX/QFX] How to identify the outgoing interface for a specific destination prefix

  [KB34944] Show Article Properties


Summary:

This article explains how to identify the outgoing interface for a specific destination prefix in both legacy and ELS switches.

Solution:

Topology:

OSPF is running in the topology on all irb.10 interfaces.

In Switch-B we have exported irb.20, 30 to OSPF.

              ge-0/0/4                       ge-0/0/2
+------------+                 +------------+                 +------------+
|            |     Vlan-10     |            |      Vlan-10    |            |
| EX3400-A   +-----------------+   EX4200   +-----------------+   EX3400-B |
|            |     Trunk       |            |      Trunk      |            |
+------------+                 +------------+                 +------------+
                         ge-0/0/4                         ge-0/0/2
                                                                     irb.10
   irb.10                         irb.10                             irb.20
                                                                     irb.30​

Configuration in SW-A:

root@SW-A# show protocols ospf
area 0.0.0.0 {
    interface irb.10;
}
 
root@SW-A# run show interfaces terse irb
Interface               Admin Link Proto    Local                 Remote
irb                     up    up
irb.10                  up    up   inet     10.10.10.1/24
 
root@SW-A# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.10.10.2       irb.10                 Full      10.10.10.2       128    39
10.10.10.3       irb.10                 Full      10.10.10.3       128    34

Configuration in EX4200:​

root@EX4200# run show interfaces terse vlan
Interface               Admin Link Proto    Local                 Remote
vlan                    up    up
vlan.10                 up    up   inet     10.10.10.3/24
 
root@EX4200# show protocols ospf
area 0.0.0.0 {
    interface vlan.10;
}
 
root@EX4200# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.10.10.2       vlan.10                Full      10.10.10.2       128    33
10.10.10.1       vlan.10                Full      10.10.10.1       128    35

Configuration in SW-B:

root@SW-B# show protocols ospf
export IRB;
area 0.0.0.0 {
    interface irb.10;
}
 
root@SW-B# run show interfaces terse irb
Interface               Admin Link Proto    Local                 Remote
irb                     up    up
irb.10                  up    up   inet     10.10.10.2/24
irb.20                  up    up   inet     20.20.20.2/24
irb.30                  up    up   inet     30.30.30.2/24
 
root@SW-B# show policy-options policy-statement IRB
term 1 {
    from interface [ irb.20 irb.30 ];
    then accept;
}
term 2 {
    then reject;
}
 
root@SW-B# run show ospf neighbor
Address          Interface              State     ID               Pri  Dead
10.10.10.1       irb.10                 Full      10.10.10.1       128    31
10.10.10.3       irb.10                 Full      10.10.10.3       128    38

Verification:

EX4200 (Legacy):

root@EX4200# run show route
 
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
10.10.10.0/24      *[Direct/0] 23:29:43
                    > via vlan.10
10.10.10.3/32      *[Local/0] 23:29:43
                      Local via vlan.10
20.20.20.0/24      *[OSPF/150] 01:07:40, metric 0, tag 0
                    > to 10.10.10.2 via vlan.10
30.30.30.0/24      *[OSPF/150] 01:07:40, metric 0, tag 0
                    > to 10.10.10.2 via vlan.10
224.0.0.5/32       *[OSPF/10] 01:12:03, metric 1
                      MultiRecv

Identify the outgoing interface to the prefix 20.20.20.2:

root@EX4200# run show route 20.20.20.2
 
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
20.20.20.0/24      *[OSPF/150] 00:23:52, metric 0, tag 0
                    > to 10.10.10.2 via vlan.10    <-- Next-hop
root@EX4200# run show route 20.20.20.2 extensive
 
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
20.20.20.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 20.20.20.0/24 -> {10.10.10.2}
        *OSPF   Preference: 150
                Next hop type: Router, Next hop index: 1322
                Address: 0x275c3a0
                Next-hop reference count: 4
                Next hop: 10.10.10.2 via vlan.10, selected
                Session Id: 0x1
                State: <Active Int Ext>
                Age: 24:31      Metric: 0
                Validation State: unverified
                        Tag: 0
                Task: OSPF
                Announcement bits (1): 0-KRT
                AS path: I
root@EX4200# run show route 10.10.10.2
 
inet.0: 6 destinations, 6 routes (6 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
10.10.10.0/24      *[Direct/0] 22:48:07
                    > via vlan.10
 
root@EX4200# run show arp no-resolve | match vlan.10 | match 10.2
f4:a7:39:c9:d7:32 10.10.10.2      vlan.10              none
 
root@EX4200# run show ethernet-switching table | match d7:32
  vlan10            f4:a7:39:c9:d7:32 Learn          0 ge-0/0/2.0  <-- this interface is the outgoing interface for the prefix ( 30.30.30.2/32 )

The command below will verify whether the correct next-hop information is placed in the forwarding table or not.

root@EX4200# run show route forwarding-table destination 10.10.10.2
Routing table: default.inet
Internet:
Destination        Type RtRef Next hop           Type Index NhRef Netif
10.10.10.2/32      dest     0 f4:a7:39:c9:d7:32  ucst  1322     4 vlan.10  <-- The forwarding table has populated the correct next-hop mac-address.
 
Routing table: __master.anon__.inet
Internet:
Destination        Type RtRef Next hop           Type Index NhRef Netif
default            perm     0                    rjct  1286     1

Verification:

EX3400(ELS):

root@SW-B# run show route
 
inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
10.10.10.0/24      *[Direct/0] 1d 02:55:42
                    > via irb.10
10.10.10.2/32      *[Local/0] 1d 04:54:02
                      Local via irb.10
10.219.26.64/26    *[Direct/0] 2d 23:31:20
                    > via me0.0
10.219.26.97/32    *[Local/0] 2d 23:31:20
                      Local via me0.0
20.20.20.0/24      *[Direct/0] 1d 02:55:42
                    > via irb.20
20.20.20.2/32      *[Local/0] 1d 02:55:42
                      Local via irb.20
30.30.30.0/24      *[Direct/0] 1d 02:52:34
                    > via irb.30
30.30.30.2/32      *[Local/0] 1d 02:53:40
                      Local via irb.30
224.0.0.5/32       *[OSPF/10] 02:16:06, metric 1
                      MultiRecv
root@SW-A# run show route 30.30.30.2
 
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
 
30.30.30.0/24      *[OSPF/150] 00:28:37, metric 0, tag 0
                    > to 10.10.10.2 via irb.10
root@SW-A# run show route 30.30.30.2 extensive
 
inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
30.30.30.0/24 (1 entry, 1 announced)
TSI:
KRT in-kernel 30.30.30.0/24 -> {10.10.10.2}
        *OSPF   Preference: 150
                Next hop type: Router, Next hop index: 1742
                Address: 0x1db8ecc
                Next-hop reference count: 4
                Next hop: 10.10.10.2 via irb.10, selected
                Session Id: 0x0
                State: <Active Int Ext>
                Age: 28:56      Metric: 0
                Validation State: unverified
                        Tag: 0
                Task: OSPF
                Announcement bits (1): 0-KRT
                AS path: I
root@SW-A# run show arp no-resolve | match irb.10 | match 10.2
f4:a7:39:c9:d7:32 10.10.10.2      irb.10 [ge-0/0/4.0]      none
 
root@SW-A# run show route forwarding-table destination 30.30.30.2
Routing table: default.inet
Internet:
Destination        Type RtRef Next hop           Type Index    NhRef Netif
30.30.30.0/24      user     0 10.10.10.2         ucst     1742     4 ge-0/0/4.0  <-- In ELS the forwarding table will populate with the exact physical interface(instead of logical interface)
 
Routing table: __juniper_services__.inet
Internet:
Destination        Type RtRef Next hop           Type Index    NhRef Netif
default            perm     0                    dscd     1664     2
 
Routing table: default-switch.inet
Internet:
Destination        Type RtRef Next hop           Type Index    NhRef Netif
default            perm     0                    rjct     1683     1
Related Links: