So if I understand you correctly, you have two different leased lines from two different providers with two different networks connected to the same router? If that is the case, there are a few way to accomplish this. First, you create two default routes, with the secondary being weighted. So for example, if primary leased line in the network 22.214.171.124/30 and your interface is 126.96.36.199 and the ISP is 188.8.131.52, your default route will be 0.0.0.0 0.0.0.0 184.108.40.206, and on the secondary, the network was 220.127.116.11/30 with your inteface as 18.104.22.168 and the ISP as 22.214.171.124, you would have another default roue that is weighted 0.0.0.0 0.0.0.0 126.96.36.199 5. The 5 assigns a metric of 5 to the route, where normal static routes have a metric of 0, so if there are two of the same static routes configred on the router, only the static route with the metric of 0 will be in the routing table. If physical inteface that is assocaited with the next-hop of the default route goes down, then the default route is removed from the routing table and the weighed default route, which is pointing to the secondary ISP, is now installed into the routing table. The only downside to this is that a failure is only when that interface between the ISP goes down. If there is a backend problem at the ISP and you leased lines is still up, the primary default-route will stay in the table and not failover.
A second method, which I will not discuss in detail unless you would like more information, is to use IP SLA’s. IP SLA’s can track a downstream IP address by using ICMP and then remove a route and place another into the routing table, if it misses a series of pings.
Hope this helps