Normally, every active route in a router or Layer-3 switch RIB is programmed directly into the hardware Forwarding Information Base (FIB). In colocation and transit edge networks, however, a common architectural mismatch arises: downstream customers demand a full BGP routing table, yet the access switch’s TCAM/FIB cannot hold hundreds of thousands of prefixes.
Simply peering multihop BGP directly between the customer and an upstream router while bypassing the switch creates forwarding loops if return traffic transits the switch. On Juniper Junos OS, the clean solution is a FIB-Filter (routing-options forwarding-table export): keep the entire BGP feed inside the control-plane RIB (inet.0) for downstream advertisement, while programming only 0.0.0.0/0 and customer routes into the PFE hardware FIB.
Lab Topology & RIB-to-FIB Filtering Architecture
Design Requirements
- Protect Switch Hardware FIB: Exclude upstream CSR (AS 65533) specific prefixes (
10.10.10.10/32through10.14.14.14/32) from the vQFX PFE forwarding table, installing only0.0.0.0/0; - Preserve Full BGP Propagation: Retain all upstream BGP routes in
inet.0and continue advertising them cleanly to the downstreamCustomerrouter (AS 65532); - Prevent Return Forwarding Loops: Install customer-originated prefixes (
192.168.192.168/32) into the vQFX FIB so return packets deliver directly to the customer instead of following the default route back upstream.
Baseline Verification Before Applying FIB-Filter
With basic BGP peering and interface addressing in place, inspect the unfiltered BGP RIB (inet.0), hardware forwarding table (default.inet), and downstream customer BGP view:
root@vqfx-re> show route protocol bgp
inet.0: 13 destinations, 13 routes (13 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[BGP/170] 00:00:49, localpref 100
AS path: 65533 I, validation-state: unverified
> to 192.1.2.1 via xe-0/0/2.0
10.10.10.10/32 *[BGP/170] 00:02:58, MED 0, localpref 100
AS path: 65533 I, validation-state: unverified
> to 192.1.2.1 via xe-0/0/2.0
10.11.11.11/32 *[BGP/170] 00:02:29, MED 0, localpref 100
AS path: 65533 I, validation-state: unverified
> to 192.1.2.1 via xe-0/0/2.0
10.12.12.12/32 *[BGP/170] 00:02:29, MED 0, localpref 100
AS path: 65533 I, validation-state: unverified
> to 192.1.2.1 via xe-0/0/2.0
10.13.13.13/32 *[BGP/170] 00:02:29, MED 0, localpref 100
AS path: 65533 I, validation-state: unverified
> to 192.1.2.1 via xe-0/0/2.0
10.14.14.14/32 *[BGP/170] 00:01:58, MED 0, localpref 100
AS path: 65533 I, validation-state: unverified
> to 192.1.2.1 via xe-0/0/2.0
192.168.192.168/32 *[BGP/170] 00:00:17, MED 0, localpref 100
AS path: 65532 I, validation-state: unverified
> to 192.0.1.2 via irb.1
root@vqfx-re> show route forwarding-table table default family inet
Routing table: default.inet
Internet:
Destination Type RtRef Next hop Type Index NhRef Netif
default user 0 50:0:0:1:0:1 ucst 1720 9 xe-0/0/2.0
default perm 0 rjct 51 1
0.0.0.0/32 perm 0 dscd 49 1
10.10.10.10/32 user 0 192.1.2.1 ucst 1720 9 xe-0/0/2.0
10.11.11.11/32 user 0 192.1.2.1 ucst 1720 9 xe-0/0/2.0
10.12.12.12/32 user 0 192.1.2.1 ucst 1720 9 xe-0/0/2.0
10.13.13.13/32 user 0 192.1.2.1 ucst 1720 9 xe-0/0/2.0
10.14.14.14/32 user 0 192.1.2.1 ucst 1720 9 xe-0/0/2.0
169.254.0.0/24 intf 0 rslv 323 1 em1.0
169.254.0.0/32 dest 0 169.254.0.0 recv 321 1 em1.0
169.254.0.1/32 dest 1 50:0:0:4:0:1 ucst 336 2 em1.0
169.254.0.2/32 intf 0 169.254.0.2 locl 322 2
169.254.0.2/32 dest 0 169.254.0.2 locl 322 2
169.254.0.255/32 dest 0 169.254.0.255 bcst 320 1 em1.0
192.0.1.0/24 intf 0 rslv 1710 1 irb.1
192.0.1.0/32 dest 0 192.0.1.0 recv 1708 1 irb.1
192.0.1.1/32 intf 0 192.0.1.1 locl 1709 2
192.0.1.1/32 dest 0 192.0.1.1 locl 1709 2
192.0.1.2/32 dest 1 50:0:0:5:0:0 ucst 1719 4 xe-0/0/1.0
192.0.1.255/32 dest 0 192.0.1.255 bcst 1707 1 irb.1
192.1.2.0/24 intf 0 rslv 1715 1 xe-0/0/2.0
192.1.2.0/32 dest 0 192.1.2.0 recv 1713 1 xe-0/0/2.0
192.1.2.1/32 dest 1 50:0:0:1:0:1 ucst 1720 9 xe-0/0/2.0
192.1.2.2/32 intf 0 192.1.2.2 locl 1714 2
192.1.2.2/32 dest 0 192.1.2.2 locl 1714 2
192.1.2.255/32 dest 0 192.1.2.255 bcst 1712 1 xe-0/0/2.0
192.168.192.168/32 user 0 192.0.1.2 ucst 1719 4 xe-0/0/1.0
224.0.0.0/4 perm 0 mdsc 50 1
224.0.0.1/32 perm 0 224.0.0.1 mcst 46 1
255.255.255.255/32 perm 0 bcst 47 1
customer#show ip b
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 192.0.1.1 0 65534 65533 i
*> 10.10.10.10/32 192.0.1.1 0 65534 65533 i
*> 10.11.11.11/32 192.0.1.1 0 65534 65533 i
*> 10.12.12.12/32 192.0.1.1 0 65534 65533 i
*> 10.13.13.13/32 192.0.1.1 0 65534 65533 i
*> 10.14.14.14/32 192.0.1.1 0 65534 65533 i
*> 192.168.192.168/32
0.0.0.0 0 32768 i
upstream#ping 192.168.192.168 source 10.10.10.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.192.168, timeout is 2 seconds:
Packet sent with a source address of 10.10.10.10
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/49/101 ms
Notice that every upstream prefix (10.10.10.10/32 through 10.14.14.14/32) is currently installed in default.inet. In production with a full Internet table, that would exhaust switch FIB hardware immediately.
Configuring Junos FIB-Filter Policy
Tag inbound customer routes with a BGP community (customer) via an import policy, then attach fib-policy under routing-options forwarding-table to admit only 0.0.0.0/0 exact and community-tagged customer BGP routes into the PFE FIB:
root@vqfx-re> show policy-options policy-statement customer-import
term customer-community-tag {
then {
community add customer;
accept;
}
}
// Tag inbound customer prefixes with the "customer" BGP community
root@vqfx-re> show policy-options policy-statement fib-policy
term default {
from {
route-filter 0.0.0.0/0 exact;
}
then accept;
}
term customer {
from {
protocol bgp;
community customer;
}
then accept;
}
term last {
then reject;
}
// Install only 0.0.0.0/0 and tagged customer BGP routes into PFE FIB; reject all other external routes
root@vqfx-re> show configuration protocols bgp group external neighbor 192.0.1.2
import customer-import;
export accept-all;
peer-as 65532;
// Apply import policy on the customer BGP session to tag customer prefixes
root@vqfx-re> show configuration routing-options forwarding-table
export fib-policy;
// Bind the FIB-filter export policy to the forwarding table
Post-Filter Verification: Clean FIB & Intact BGP Propagation
Inspect default.inet again after committing: all five upstream prefixes (10.10.10.10/32–10.14.14.14/32) have been stripped from the hardware FIB, leaving only default, interface/direct routes, and 192.168.192.168/32:
root@vqfx-re> show route forwarding-table table default family inet Routing table: default.inet Internet: Destination Type RtRef Next hop Type Index NhRef Netif default user 0 50:0:0:1:0:1 ucst 1720 4 xe-0/0/2.0 default perm 0 rjct 51 1 0.0.0.0/32 perm 0 dscd 49 1 169.254.0.0/24 intf 0 rslv 323 1 em1.0 169.254.0.0/32 dest 0 169.254.0.0 recv 321 1 em1.0 169.254.0.1/32 dest 1 50:0:0:4:0:1 ucst 336 2 em1.0 169.254.0.2/32 intf 0 169.254.0.2 locl 322 2 169.254.0.2/32 dest 0 169.254.0.2 locl 322 2 169.254.0.255/32 dest 0 169.254.0.255 bcst 320 1 em1.0 192.0.1.0/24 intf 0 rslv 1710 1 irb.1 192.0.1.0/32 dest 0 192.0.1.0 recv 1708 1 irb.1 192.0.1.1/32 intf 0 192.0.1.1 locl 1709 2 192.0.1.1/32 dest 0 192.0.1.1 locl 1709 2 192.0.1.2/32 dest 1 50:0:0:5:0:0 ucst 1719 4 xe-0/0/1.0 192.0.1.255/32 dest 0 192.0.1.255 bcst 1707 1 irb.1 192.1.2.0/24 intf 0 rslv 1715 1 xe-0/0/2.0 192.1.2.0/32 dest 0 192.1.2.0 recv 1713 1 xe-0/0/2.0 192.1.2.1/32 dest 1 50:0:0:1:0:1 ucst 1720 4 xe-0/0/2.0 192.1.2.2/32 intf 0 192.1.2.2 locl 1714 2 192.1.2.2/32 dest 0 192.1.2.2 locl 1714 2 192.1.2.255/32 dest 0 192.1.2.255 bcst 1712 1 xe-0/0/2.0 192.168.192.168/32 user 0 192.0.1.2 ucst 1719 4 xe-0/0/1.0 224.0.0.0/4 perm 0 mdsc 50 1 224.0.0.1/32 perm 0 224.0.0.1 mcst 46 1 255.255.255.255/32 perm 0 bcst 47 1
Finally, verify that the customer router still receives the complete BGP table and passes traffic end-to-end with zero packet loss:
customer#show ip bgp
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 192.0.1.1 0 65534 65533 i
*> 10.10.10.10/32 192.0.1.1 0 65534 65533 i
*> 10.11.11.11/32 192.0.1.1 0 65534 65533 i
*> 10.12.12.12/32 192.0.1.1 0 65534 65533 i
*> 10.13.13.13/32 192.0.1.1 0 65534 65533 i
*> 10.14.14.14/32 192.0.1.1 0 65534 65533 i
*> 192.168.192.168/32
0.0.0.0 0 32768 i
customer#ping 10.10.10.10 source 192.168.192.168
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.10, timeout is 2 seconds:
Packet sent with a source address of 192.168.192.168
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 21/32/67 ms
customer#
Key Takeaways
- Local & Interface Routes Are Unaffected: Junos
forwarding-table exportfilters only RIB-to-FIB installation (such as BGP routes frominet.0), never blocking locally generated direct, interface, or management routes; - Zero Impact on BGP Advertising: Because BGP selects and exports best active routes from the control-plane RIB—not the FIB—customers still receive every prefix while the switch stays safely inside its TCAM/FIB limit.