Here is a scenario and working route-map example for Policy base routing.
I'm new Junos i'm struggling with Firewall filters and Policy-statements in Junos.

Can you help me to convert this simple scenario from Cisco IOS to JUNOS equivalent.

What it does below it matchs a packet from any source but destination and set its next hop to

Matching criteria using Access List

access-list 104 permit ip any log-input


route-map PBR permit 10
 match ip address 104
 set ip default next-hop

And at the End it is applied.

interface FastEthernet0/1  
 ip address  
 ip policy route-map PBR
  • @TeunVink Like i create a firewall family inet filter and i match the source and destination IPs with that then i try to create policy-statement and try to match filter and try to set the next hop but i can't find next hop thing in that and also not able to match inet filter i created earlier.I just want this question answered for how to do this basic thing as a reference
    – Terminator
    Oct 15, 2017 at 20:46
  • You're mixing up things here. Firewall filters are used for blocking or allowing traffic, not for defining routing policies, you'll need to define policy statements for that under the 'policy-options' section: juniper.net/documentation/en_US/junos/topics/reference/…
    – Teun Vink
    Oct 15, 2017 at 20:50
  • 1
    By the way, Stack Exchanges are not meant for a 'please do my work' type of question. We're happy to help you, but you will need to do some work yourself by showing us what you've tried and where you ran into problems.
    – Teun Vink
    Oct 15, 2017 at 20:52
  • @TeunVink I'm learning about juniper this isn't my work.
    – Terminator
    Oct 15, 2017 at 20:57
  • 1
    @TeunVink simply means that we're not going to convert the configuration for you. Since there really isn't a decent way to answer the question without doing all of the work for you, I'll point you in the right direction, and if you have questions about that, you can edit your question or ask a new one. This particular solution in Juniper is called Filter-Based Forwarding. Oct 16, 2017 at 12:58

1 Answer 1


This feature in JunOS called Filter based forwarding. You can find configurations examples for MX platform here. Example with dual-ISP routing on SRX platform here

Here also working example for SRX platform. We have network, traffic from which should be routed thru non-default route, except local destination networks.

user@srx1400> show route 0/0 exact

inet.0: 450 destinations, 474 routes (450 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both          *[Static/5] 69w5d 17:17:29
                    > to via ge-0/0/1.0

Interface, behind which source addresses are located:

user@srx1400> show configuration interfaces ge-0/0/2.100

description "SRV";
vlan-id 100;
family inet {
    filter {
        input ge-0/0/1.100-in;

Firewall filter:

user@srx1400> show configuration firewall filter ge-0/0/1.100-in

term inject-default {
    from {
        source-address {
        destination-address {
    then {
        routing-instance ri_fw_injdefault;
term default {
    then accept;

Routing instance configuration:

user@srx1400> show configuration routing-instances ri_fw_injdefault

instance-type forwarding;
routing-options {
    static {
        route next-hop;

Set up RIB-Groups:

user@srx1400> show configuration routing-options

interface-routes {
    rib-group inet fbf-group;
static {
rib-groups {
    fbf-group {
        import-rib [ inet.0 ri_fw_injdefault.inet.0 ];


After all set, lets check routing table for ri_fw_injdefault instance:

user@srx1400> show route 0/0 exact table ri_fw_injdefault.inet.0

ri_fw_injdefault.inet.0: 81 destinations, 81 routes (81 active, 0 holddown, 
0 hidden)
+ = Active Route, - = Last Active, * = Both          *[Static/5] 38w1d 00:19:55
                    > to via ge-0/0/3.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.