You can use any of the following three ways to set the weights in routes coming in from
router Boston:
•
The neighbor weight command
•
The set weight command in route maps
•
An AS-path access list
Using the neighbor weight Command
The following commands assign a weight of 1000 to all routes router LA receives from
AS 100 and assign a weight of 500 to all routes router LA receives from AS 300:
host1(config)#router bgp 400
host1(config-router)#neighbor 10.5.5.1 remote-as 100
host1(config-router)#neighbor 10.5.5.1 weight 1000
host1(config-router)#neighbor 10.72.4.2 remote-as 300
host1(config-router)#neighbor 10.72.4.2 weight 500
Router LA sends traffic through router Boston in preference to router NY.
Using a Route Map
A route map instance is a set of conditions with an assigned number. The number after
the permit keyword designates an instance of a route map. For example, instance 10 of
route map 10 begins with the following:
host1(config)#route-map 10 permit 10
In the following commands to configure router LA, instance 10 of route map 10 assigns
a weight of 1000 to any routes from AS 100. Instance 20 assigns a weight of 500 to
routes from any other AS.
host1(config)#router bgp 400
host1(config-router)#neighbor 10.5.5.1 remote-as 100
host1(config-router)#neighbor 10.5.5.1 route-map 10 in
host1(config-router)#neighbor 10.72.4.2 remote-as 300
host1(config-router)#neighbor 10.72.4.2 route-map 20 in
host1(config-router)#exit
host1(config)#route-map 10
host1(config-route-map)#set weight 1000
host1(config-route-map)#route-map 20
host1(config-route-map)#set weight 500
See JunosE IP Services Configuration Guide for more information about using route maps.
Using an AS-Path Access List
The following commands assign weights to routes filtered by AS-path access lists on
router LA:
host1(config)#router bgp 400
host1(config-router)#neighbor 10.5.5.1 remote-as 100
host1(config-router)#neighbor 10.5.5.1 filter-list 1 weight 1000
host1(config-router)#neighbor 10.72.4.2 remote-as 300
host1(config-router)#neighbor 10.72.4.2 filter-list 2 weight 500
host1(config-router)#exit
host1(config)#ip as-path access-list 1 permit ^100_
Copyright © 2010, Juniper Networks, Inc.110
JunosE 11.2.x BGP and MPLS Configuration Guide