You can create a filter to classify packets to determine their forwarding path within a router. Use filter-based forwarding to redirect traffic for analysis.
Filter-based forwarding is supported for Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).
Use filter-based forwarding for service provider selection when customers have Internet connectivity provided by different ISPs yet share a common access layer. When a shared media (such as a cable modem) is used, a mechanism on the common access layer looks at Layer 2 or Layer 3 addresses and distinguishes between customers. You can use filter-based forwarding when the common access layer is implemented using a combination of Layer 2 switches and a single router.
With filter-based forwarding, all packets received on an interface are considered. Each packet passes through a filter that has match conditions. If the match conditions are met for a filter and you have created a routing instance, filter-based forwarding is applied to a packet. The packet is forwarded based on the next hop specified in the routing instance. For static routes, the next hop can be a specific LSP. For more information about configuring LSPs, see the JUNOS MPLS Applications Configuration Guide.
![]() |
Note: Source-class usage filter matching and unicast reverse-path forwarding checks are not supported on an interface configured with filter-based forwarding (FBF). |
To configure filter-based forwarding, perform the following tasks:
- [edit]
- routing-instances {
-
-
routing-table-name1 {
- instance-type forwarding;
-
- routing-options {
-
- static {
- route 0.0.0.0/0 nexthop 10.0.0.1;
- }
- }
- }
-
-
routing-table-name2 {
- instance-type forwarding;
-
- routing-options {
-
- static {
- route 0.0.0.0/0 nexthop 10.0.0.2;
- }
- }
- }
- }
For IPv4, the following configuration installs interface routes into the default routing instance inet.0, as well as two forwarding routing instances—routing-table-name1.inet.0 and routing-table-name2.inet.0:
- [edit]
- routing-options {
-
- interface-routes {
- rib-group inet group-name;
- }
-
- rib-groups {
-
-
group-name {
- import-rib [ inet.0 routing-table-name1.inet.0
- routing-table-name2.inet.0 ];
- }
- }
- }
![]() |
Note: Specify inet.0 as one of the routing instances that the interface routes will be imported into. If the default instance inet.0 is not specified, interface routes will not be imported into the default routing instance. |