1. Detect a loop and choose the preferred route
Network engineering studentBackground
A learner wants to compare multiple routes, reject a path containing the local AS, and apply a prefix policy before selecting the best remaining path.
Problem
Identify which routes are denied by loop detection or policy and determine the preferred accepted route.
How to use
Set the local AS to 64500, enter four route entries, add a policy for 203.0.113.0/24, and enable best-path selection.
{"localAs":64500,"routeEntries":"[{\"prefix\":\"203.0.113.0/24\",\"asPath\":\"64501 64496\",\"localPref\":100,\"med\":50,\"origin\":\"igp\"},{\"prefix\":\"203.0.113.0/24\",\"asPath\":\"64502 64496\",\"localPref\":200,\"med\":100,\"origin\":\"igp\"},{\"prefix\":\"198.51.100.0/24\",\"asPath\":\"64500 64496\",\"localPref\":150,\"med\":10,\"origin\":\"igp\"},{\"prefix\":\"192.0.2.0/24\",\"asPath\":\"64503\",\"localPref\":120,\"med\":20,\"origin\":\"egp\"}]","policyRules":"[{\"name\":\"raise preferred prefix\",\"action\":\"permit\",\"prefix\":\"203.0.113.0/24\",\"setLocalPref\":180},{\"name\":\"deny documentation loop\",\"action\":\"deny\",\"prefix\":\"198.51.100.0/24\"}]","defaultAction":"deny","selectBestPath":true}Outcome
The route containing AS 64500 is rejected as a loop, the matching policy changes Local Preference for 203.0.113.0/24, and the accepted routes are ranked in the decision table.