[Contents] [Prev] [Next] [Index] [Report an Error]

Configuring a Policy to Prepend the AS Path (Optional)

You can prepend or add one or more autonomous system (AS) numbers at the beginning of an AS path. The AS numbers are added after the local AS number has been added to the path. Prepending an AS path makes a shorter AS path look longer and therefore less preferable to the Border Gateway Protocol (BGP).

For example, from AS 1, there are two equal paths (through AS 2 and AS 3) to reach AS 4. You might want packets from certain sources to use the path through AS 2. Therefore, you must make the path through AS 3 look less preferable so that BGP chooses the path through AS 2. In AS 1, you can prepend multiple AS numbers.

To prepend multiple AS numbers:

  1. Navigate to the top of the configuration hierarchy in either the J-Web or CLI configuration editor.
  2. Perform the configuration tasks described in Table 107.
  3. If you are finished configuring the policy, commit the configuration.
  4. Go on to Configuring Damping Parameters (Optional).

Table 107: Creating a Policy to Prepend AS Numbers

Task

J-Web Configuration Editor

CLI Configuration Editor

Navigate to the Term level in the configuration hierarchy.

In the J-Web configuration editor hierarchy, select Policy options>Policy statement>Term.

From the top of the CLI configuration hierarchy, enter

edit policy-options policy-statement prependpolicy1 term prependterm1

Specify the routes to prepend AS numbers to.

  1. In the From option, click Configure.
  2. In the Value box, enter the prefixes you wish to prepend.
  3. In the Route filter box, click Add new entry.
  4. Click OK.
  1. Prepend routes 172.168.0.0/12 or longer:

    set from route-filter 172.16.0.0/12 orlonger

  2. Prepend routes 192.168.0.0/16 or longer:

    set from route-filter 192.168.0.0/16 orlonger

  3. Prepend routes 10.0.0.0/8 or longer:

    set from route-filter 10.0.0.0/8 orlonger

Specify the AS numbers to prepend.

  1. In the configuration editor hierarchy, select Policy options>Policy statement>Term.
  2. In the Then option, click Configure.
  3. In the AS path prepend box, enter the string of AS numbers to prepend. Separate each AS number with a space.
  4. Click OK.

Specify the AS numbers to prepend, and enclose them inside double quotation marks:

set then as-path-prepend “1 1 1 1”

Navigate to the Protocols>BGP> level in the configuration hierarchy.

In the J-Web configuration editor hierarchy, select Protocols>BGP>.

From the top of the CLI configuration hierarchy, enter

edit protocols bgp

Apply the policy as an import policy for all BGP routes.

  1. In the Import box, click Add new entry.
  2. In the Value box, enter the name of the policy.
  3. Click OK.

The routing policy is evaluated when routes are being imported to the routing table.

Apply the policy:

set import prependpolicy1

You can refer to the same routing policy one or more times in the same or a different import statement.


[Contents] [Prev] [Next] [Index] [Report an Error]