set interfaces ge-0/0/1 unit 0 family inet filter input FILTER1 set routing-options interface-routes rib-group inet PBR-DUNA set routing-options static route 0.0.0.0/0 next-hop 85.33.110.121 set routing-options static route 0.0.0.0/0 next-hop 192.168.5.254 set routing-options rib-groups PBR-DUNA import-rib inet.0 set routing-options rib-groups PBR-DUNA import-rib routing-table-ISP1.inet.0 set routing-options rib-groups PBR-DUNA import-rib routing-table-ISP2.inet.0 set firewall filter FILTER1 term to-own from address 192.168.1.244/32 set firewall filter FILTER1 term to-own then accept set firewall filter FILTER1 term TERM1 from destination-port 80 set firewall filter FILTER1 term TERM1 from destination-port 443 set firewall filter FILTER1 term TERM1 then routing-instance routing-table-ISP2 set firewall filter FILTER1 term default then routing-instance routing-table-ISP1 set routing-instances routing-table-ISP1 instance-type forwarding set routing-instances routing-table-ISP1 routing-options static route 0.0.0.0/0 qualified-next-hop 85.33.110.121 set routing-instances routing-table-ISP1 routing-options static route 0.0.0.0/0 qualified-next-hop 192.168.5.254 preference 100 set routing-instances routing-table-ISP2 instance-type forwarding set routing-instances routing-table-ISP2 routing-options static route 0.0.0.0/0 qualified-next-hop 192.168.5.254 set routing-instances routing-table-ISP2 routing-options static route 0.0.0.0/0 qualified-next-hop 85.33.110.121 preference 100 set services rpm probe ISP-1 test ping-ISP-1 probe-type icmp-ping set services rpm probe ISP-1 test ping-ISP-1 target address 150.150.150.2 set services rpm probe ISP-1 test ping-ISP-1 probe-count 10 set services rpm probe ISP-1 test ping-ISP-1 test-interval 60 set services rpm probe ISP-2 test ping-ISP-2 probe-type icmp-ping set services rpm probe ISP-2 test ping-ISP-2 target address 160.160.160.2 set services rpm probe ISP-2 test ping-ISP-2 probe-count 10 set services rpm probe ISP-2 test ping-ISP-2 test-interval 60 set event-options policy test-failed-ISP1 events PING_TEST_FAILED set event-options policy test-failed-ISP1 within 240 events PING_TEST_COMPLETED set event-options policy test-failed-ISP1 within 240 events KERNEL set event-options policy test-failed-ISP1 within 240 events SYSTEM set event-options policy test-failed-ISP1 attributes-match ping_test_failed.test-owner matches ISP-1 set event-options policy test-failed-ISP1 attributes-match ping_test_failed.test-name matches ping-ISP-1 set event-options policy test-failed-ISP1 attributes-match ping_test_completed.test-owner matches ISP-1 set event-options policy test-failed-ISP1 attributes-match ping_test_completed.test-name matches ping-ISP-1 set event-options policy test-failed-ISP1 attributes-match SYSTEM.message matches "Starting of initial processes complete" set event-options policy test-failed-ISP1 attributes-match KERNEL.message matches "event-processing \(PID.*\)started" set event-options policy test-failed-ISP1 then event-script watch-default-ISP1.slax arguments next-hop 85.33.110.121 set event-options policy test-completed-ISP1 events PING_TEST_COMPLETED set event-options policy test-completed-ISP1 within 240 events PING_TEST_FAILED set event-options policy test-completed-ISP1 within 240 events KERNEL set event-options policy test-completed-ISP1 within 240 events SYSTEM set event-options policy test-completed-ISP1 attributes-match ping_test_completed.test-owner matches ISP-1 set event-options policy test-completed-ISP1 attributes-match ping_test_completed.test-name matches ping-ISP-1 set event-options policy test-completed-ISP1 attributes-match ping_test_failed.test-owner matches ISP-1 set event-options policy test-completed-ISP1 attributes-match ping_test_failed.test-name matches ping-ISP-1 set event-options policy test-completed-ISP1 attributes-match SYSTEM.message matches "Starting of initial processes complete" set event-options policy test-completed-ISP1 attributes-match KERNEL.message matches "event-processing \(PID .*\) started" set event-options policy test-completed-ISP1 then event-script watch-default-ISP1.slax arguments next-hop 85.33.110.121 set event-options policy test-failed-ISP2 events PING_TEST_FAILED set event-options policy test-failed-ISP2 within 240 events PING_TEST_COMPLETED set event-options policy test-failed-ISP2 within 240 events KERNEL set event-options policy test-failed-ISP2 within 240 events SYSTEM set event-options policy test-failed-ISP2 attributes-match ping_test_failed.test-owner matches ISP-2 set event-options policy test-failed-ISP2 attributes-match ping_test_failed.test-name matches ping-ISP-2 set event-options policy test-failed-ISP2 attributes-match ping_test_completed.test-owner matches ISP-2 set event-options policy test-failed-ISP2 attributes-match ping_test_completed.test-name matches ping-ISP-2 set event-options policy test-failed-ISP2 attributes-match SYSTEM.message matches "Starting of initial processes complete" set event-options policy test-failed-ISP2 attributes-match KERNEL.message matches "event-processing \(PID.*\)started" set event-options policy test-failed-ISP2 then event-script watch-default-ISP2.slax arguments next-hop 192.168.5.254 set event-options policy test-completed-ISP2 events PING_TEST_COMPLETED set event-options policy test-completed-ISP2 within 240 events PING_TEST_FAILED set event-options policy test-completed-ISP2 within 240 events KERNEL set event-options policy test-completed-ISP2 within 240 events SYSTEM set event-options policy test-completed-ISP2 attributes-match ping_test_completed.test-owner matches ISP-2 set event-options policy test-completed-ISP2 attributes-match ping_test_completed.test-name matches ping-ISP-2 set event-options policy test-completed-ISP2 attributes-match ping_test_failed.test-owner matches ISP-2 set event-options policy test-completed-ISP2 attributes-match ping_test_failed.test-name matches ping-ISP-2 set event-options policy test-completed-ISP2 attributes-match SYSTEM.message matches "Starting of initial processes complete" set event-options policy test-completed-ISP2 attributes-match KERNEL.message matches "event-processing \(PID .*\) started" set event-options policy test-completed-ISP2 then event-script watch-default-ISP2.slax arguments next-hop 192.168.5.254 set event-options event-script file watch-default-ISP2.slax set event-options event-script file watch-default-ISP1.slax set routing-options static route 150.150.150.2/32 next-hop 85.33.110.121 set routing-options static route 150.150.150.2/32 retain set routing-options static route 160.160.160.2/32 next-hop 192.168.5.254 set routing-options static route 160.160.160.2/32 retain