O'Reilly logo

JUNOS Cookbook by Aviva Garrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.2. Changing a Route's Routing Information

Problem

You want to enforce your company's BGP peering relationships and control the traffic you receive from BGP peers by modifying the BGP LOCAL_PREF attribute and associating a community with certain BGP routes.

Solution

Another function of routing policy is to modify the routing information associated with BGP routes. First, match the routes to be affected:

	[edit policy-options policy-statement from-my-customers term 1]
	aviva@router1# set from neighbor 10.0.31.2/32

Use the then clause to modify the route's routing information:

	[edit policy-options policy-statement from-my-customers term 1]
	aviva@router1# set then local-preference 300
	aviva@router1# set then community set 65500:12345
	aviva@router1# set then accept

Finally, apply the policy to a BGP group:

	[edit protocols bgp]
	aviva@router1# set group external-group import from-my-customers

Discussion

For BGP routes, routing policy allows you to modify the BGP routing information associated with each route, including the BGP local preference, community, and origin attributes, and the AS paths in each route. You typically do this to manage customer traffic and peering arrangements with other ISPs. Table 9-4 lists the actions you can include in a policy to change a route's routing information. Most of these actions are specific to BGP.

Table 9-4. Actions that change routing information in matching routes

Action term

Description

as-path-prepend path

Add AS numbers to the beginning of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required