This article provides an example of how to configure source-based routing on SRX
To explain source-based routing on SRX, an example of two groups of users is used; one that will go through a lower bandwidth (ISP1) and the other group of users will go through a higher bandwidth (ISP2). Assume that the PCs from 192.168.10.2 to 192.168.10.126 will go through ISP1. Similarly, PCs from 192.168.10.129 to 192.168.10.254 will go through ISP2. All PCs will come in via ge-0/0/0.0 , ISP1 is connected to fe-0/0/2.0 , and ISP2 is connected to fe-0/0/3.0 .
interfaces { ge-0/0/0 { unit 0 { family inet { filter { input 2nd-ISP; } address 192.168.10.128/24; } } } fe-0/0/2 { unit 0 { description ISP1; family inet { address 1.1.1.1/24; } } } fe-0/0/3 { unit 0 { description ISP2; family inet { address 1.2.2.1/24; } } } }
firewall { family inet { filter 2nd-ISP { term 0 { from { source-address { 192.168.10.128/25; } } then { routing-instance 2nd-router; } } term 1 { then accept; } } } }
routing-instances { 2nd-router { instance-type forwarding; routing-options { static { route 0.0.0.0/0 next-hop 1.2.2.254; } } } }
routing-options { interface-routes { rib-group inet 2nd-router; } static { route 0.0.0.0/0 next-hop 1.1.1.254; } rib-groups { 2nd-router { import-rib [inet.0 2nd-router.inet.0]; } } }
2025-04-22: Updated technical documentation link in Related Information
2024-10-14: minor non tech changes
2020-03-25: Article reviewed for accuracy; it is valid and accurate