I am trying to load balance a router to send traffic over two uplinks (with equal capacity). I generated static routes for every /8 on the internet (for ipv4) and plugged it in. Unfortunately it does not appear to be having the desired effect. I noticed that checking the forwarding table for a specific ip there were three routes, my two static /8s and a single more specific route (a /24 instead of /8) which was learned through bgp. Can anyone confirm that Junos will route traffic to a more specific route even if it was discovered from a less preferred source such as BGP over a manually entered static route.
This source suggests that the way the route was learned is always chosen first (item 2 after checking link is up)
Choose the path with the lowest preference value (routing protocol process preference).
1.0.0.0/8 and 1.0.0.0/24 (for example) aren't the same route, so there is no competition between the two /8's and the one /24's to get into the FIB. The two /8's go in, and when it learns the /24 it goes in too because it is more specific (so a different route). You can't have a /8's rejected because of the presence of a /24 could you (You'd be missing a major portion of the /8)?
Also, why are you generating /8's for every block on the IPv4 address space when you could just generate two 0/0 routes? (Assuming one upstream provider!). Having said that, I can't help you with getting your load balancing working, as I don't know enough about JunOS.