[Prev][Next][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 create a routing policy prependpolicy1 that prepends 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 117.
  3. If you are finished configuring the router, commit the configuration.
  4. To suppress route information, see Configuring Damping Parameters (Optional).

Table 117: Creating a Policy to Prepend AS Numbers

Task

J-Web Configuration Editor

CLI Configuration Editor

Navigate to the Policy statement level in the configuration hierarchy.

  1. In the J-Web interface, select Configure>CLI Tools>Point and Click CLI.
  2. Next to Policy options, click Configure or Edit.
  3. Next to Policy statement, click Add new entry.

From the [edit] hierarchy level, enter

edit policy-options policy-statement

Create a prepend policy and term—for example, prependpolicy1 and prependterm1.

  1. In the Policy name box, type prependpolicy1.
  2. Next to Term, click Add new entry.
  3. In the Term name box, type prependterm1.

Enter

set prependpolicy1 term prependterm1

Specify the routes to prepend AS numbers to. For example:

  • Routes greater than or equal to 172.16.0.0/12
  • Routes greater than or equal to 192.168.0.0/16
  • Routes greater than or equal to 10.0.0.0/8
  1. Next to From, click Configure.
  2. Next to Route filter, click Add new entry.
  3. In the Value box, type 172.16.0.0/12.
  4. From the Modifier list, select Orlonger.
  5. Click OK.

Specify the first routes to prepend:

set from route-filter 172.16.0.0/12 orlonger

  1. Next to From, click Configure.
  2. Next to Route filter, click Add new entry.
  3. In the Value box, type 192.168.0.0/16.
  4. From the Modifier list, select Orlonger.
  5. Click OK.

Specify the next routes to prepend:

set from route-filter 192.168.0.0/16 orlonger

  1. Next to From, click Configure.
  2. Next to Route filter, click Add new entry.
  3. In the Value box, type 10.0.0.0/8.
  4. From the Modifier list, select Orlonger.
  5. Click OK until you return to the Term page.

Specify the last routes to prepend:

set from route-filter 10.0.0.0/8 orlonger

Specify the AS numbers to prepend. Separate each AS number with a space—for example, 1 1 1 1.

  1. Next to Then, click Configure.
  2. In the AS path prepend box, type 1 1 1 1.
  3. 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 Bgp level in the configuration hierarchy.

  1. On the main Configuration page next to Protocols, click Configure or Edit.
  2. Next to Bgp, click Configure or Edit.

From the [edit] hierarchy level, enter

edit protocols bgp

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

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

  1. Next to Import, click Add new entry.
  2. In the Value box, type prependpolicy1.
  3. Click OK.

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.


[Prev][Next][Report an Error]