---
title: Routing Policy
slug: aidc/routing-policy
createdAt: 2025-12-01T11:11:07.000Z
---

# <font color="#1d50a2">IP Prefix List</font>

## <font color="#1d50a2">IP Prefix List View</font>

<font color="#1d05a2">Table 1 IP Prefix List View</font>

| **Command**                                                      | **Purpose**                           |
| ---------------------------------------------------------------- | ------------------------------------- |
| **show ip prefix-list** \[**summary**\|**detail**\|*list\_name*] | Display IP prefix list configuration. |

### <font color="#1d50a2">show ip prefix-list \[summary|detail|*list\_name*\]</font>

**\[Command]**
**show ip prefix-list** \[**summary**|**detail**|*list\_name*]

**\[Purpose]**
Display IP prefix list configuration.

**\[Parameters]**

| **Parameter** | **Description**                     |
| ------------- | ----------------------------------- |
| *list\_name*  | Specify the name of IP prefix list. |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show ip prefix-list list1
ZEBRA: ip prefix-list list1: 2 entries
   seq 3 permit 10.0.0.0/24 ge 25 le 26
   seq 4 permit 20.0.0.0/24 ge 25 le 26
OSPF: ip prefix-list list1: 2 entries
   seq 3 permit 10.0.0.0/24 ge 25 le 26
   seq 4 permit 20.0.0.0/24 ge 25 le 26
BGP: ip prefix-list list1: 2 entries
   seq 3 permit 10.0.0.0/24 ge 25 le 26
   seq 4 permit 20.0.0.0/24 ge 25 le 26
ISIS: ip prefix-list list1: 2 entries
   seq 3 permit 10.0.0.0/24 ge 25 le 26
   seq 4 permit 20.0.0.0/24 ge 25 le 26
```

## <font color="#1d50a2">IP Prefix List Config</font>

<font color="#1d05a2">Table 2 IP Prefix List Config</font>

| **Command**                                                                                                                       | **Purpose**            |
| --------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| **ip prefix-list** *list\_name* \[**seq** *sequence\_number*] \{**permit\|deny**} \{**any**\|*A.B.C.D/M* \[**ge** ge\|**le** le]} | Add an IP prefix list. |

### <font color="#1d50a2">ip prefix-list *list\_name* \[seq *sequence\_number*\] \{permit|deny\} \{any|*A.B.C.D/M* \[ge *ge*|le *le*\]\}</font>

**\[Command]**
**ip prefix-list** *list\_name* \[**seq** *sequence\_number*] \{**permit**|**deny**} \{**any**|*A.B.C.D/M* \[**ge** *ge*|**le** *le*]}

**\[Purpose]**
Add an IP prefix list for reference by ROUTE-MAP.

**\[Parameters]**

| **Parameter**      | **Description**                                                   |
| ------------------ | ----------------------------------------------------------------- |
| *list\_name*       | Specify the name of IP prefix list.                               |
| *sequence\_number* | Specify the sequence number.                                      |
| *A.B.C.D/M*        | Specifiy the network segment that this table entry matches.       |
| *ge*               | Specify the minimum prefix length, and the range is from 0 to 32. |
| *le*               | Specify the maximum prefix length, and the range is from 0 to 32. |

**\[View]**
Global Configuration View

**\[Notes]**
The relationship between **le**, **ge** and **length** is: length \<= ge \<= le;
Configuration of logically conflicting table entries within the same prefix list is not allowed.
The list\_name and sequence\_number uniquely identify a table entry, and the IP prefix is not allowed to be the same between different table entries.
Run command **no ip prefix-list** *list\_name* \[**seq** *sequence\_number*] \{**permit**|**deny**} \{**any**|*A.B.C.D/M* \[**ge** *ge*|**le** *le*]}
&#x20;to delete IP prefix list.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# ip prefix-list list1 seq 3 permit 10.0.0.0/24 le 26 ge 25
```

# <font color="#1d50a2">Route-Map</font>

## <font color="#1d50a2">Route-Map View</font>

<font color="#1d05a2">Table 3 Route-Map View</font>

| **Command**                                 | **Purpose**        |
| ------------------------------------------- | ------------------ |
| **show route-map** \[*route-map*\|**json**] | Display route map. |

### <font color="#1d50a2">show route-map \[*route-map*|json\]</font>

**\[Command]**
**show route-map** \[*route-map*|**json**]

**\[Purpose]**
Display route map.

**\[Parameters]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *route-map*   | Route map name. |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show route-map
ZEBRA:
route-map: test Invoked: 0 Optimization: enabled Processed Change: false
 permit, sequence 10 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
 permit, sequence 1000 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
OSPF:
route-map: test Invoked: 0 Optimization: enabled Processed Change: false
 permit, sequence 10 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
 permit, sequence 1000 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
OSPF6:
route-map: test Invoked: 0 Optimization: enabled Processed Change: false
 permit, sequence 10 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
 permit, sequence 1000 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
BGP:
route-map: test Invoked: 0 Optimization: enabled Processed Change: false
 permit, sequence 10 Invoked 0
  Match clauses:
  Set clauses:
    as-path exclude 1 31
    comm-list 1
  Call clause:
  Action:
    Exit routemap
 permit, sequence 1000 Invoked 0
  Match clauses:
    community 10
  Set clauses:
    as-path prepend 1 1
  Call clause:
  Action:
    Exit routemap
ISIS:
route-map: test Invoked: 0 Optimization: enabled Processed Change: false
 permit, sequence 10 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
 permit, sequence 1000 Invoked 0
  Match clauses:
  Set clauses:
  Call clause:
  Action:
    Exit routemap
```

## <font color="#1d50a2">Route-Map Config</font>

<font color="#1d05a2">Table 4 Route-Map Config</font>

| **Command**                                                                                                                                                     | **Purpose**                                                |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| **route-map** *route-map* \{**permit**\|**deny**} *seq-num*                                                                                                     | Create a route map and enter Route-map Configuration View. |
| **description** *description*                                                                                                                                   | Specify the description for the route-map.                 |
| **matchas-path** *as\_path\_filter\_name*                                                                                                                       | Match AS-path list.                                        |
| **match community** \{*community\_list\_number\|community\_list\_name*} \[**exact-match**]                                                                      | Match BGP community list.                                  |
| **match extcommunity** \{*extcommunity\_list\_number*\|*extcommunity\_list\_name*}                                                                              | Match BGP/VPN extended community list.                     |
| **match** \{**ip**\|**ipv6**} **address** \{**prefix-len** *length*\|**prefix-list** *list\_name*}                                                              | Match address of route.                                    |
| **match** \{**ip**\|**ipv6**} **next-hop** \{**prefix-len** *length*\|**prefix-list** *list\_name*\|**address**\{*A.B.C.D*\|*X\:X\::X\:X*}\|**type blackhole**} | Match next-hop address of route.                           |
| **match local-preference** *preference\_value*                                                                                                                  | Match local-preference of route.                           |
| **match metric** *metric\_value*                                                                                                                                | Match metric of route.                                     |
| **match peer&#x20;**\{*A.B.C.D*\|*X\:X\::X\:X*\|*interface\_name*}                                                                                              | Match peer address.                                        |
| **set as-path prepend** \{*as-path*\|**last-as** *number*}                                                                                                      | Prepend to the as-path.                                    |
| **set as-path exclude** *AS-number*                                                                                                                             | Exclude from the as-path.                                  |
| **setcommunity** *AA\:NN*                                                                                                                                       | Set BGP Community.                                         |
| **set community none**                                                                                                                                          | Set no BGP Community.                                      |
| **set distance** *distance*                                                                                                                                     | Set BGP Administrative Distance to use.                    |
| **set extcommunitynone**                                                                                                                                        | Set no extended community attribute.                       |
| **set extcommunity rt** *ASN\:NN\_OR\_IP-ADDRESS\:NN*                                                                                                           | Set Route Target extended community.                       |
| **set extcommunity soo** *ASN\:NN\_OR\_IP-ADDRESS\:NN*                                                                                                          | Set Site-of-Origin extended community.                     |
| **setip next-hop** \{*A.B.C.D\|peer-address*}                                                                                                                   | Set next-hop IP address.                                   |
| **set ipv6 next-hop** \{**local** *X\:X\::X\:X*\|**global** *X\:X\::X\:X*\|**peer-address**}                                                                    | Set next-hop IPv6 address.                                 |
| **set local-preference** *preference\_value*                                                                                                                    | Set local-preference of route.                             |
| **set metric** \{*metric\_value*\|**rtt**\|**+rtt**\|**-rtt**}                                                                                                  | Set metric value.                                          |
| **set weight** *weight*                                                                                                                                         | Set BGP weight for routing table.                          |

### <font color="#1d50a2">route-map *route-map* \{permit|deny\} *seq-num*</font>

**\[Command]**
**route-map** *route-map* \{**permit**|**deny**} *seq-num*

**\[Purpose]**
Create a route map and enter Route-map Configuration View.

**\[Parameters]**

| **Parameter** | **Description**                                |
| ------------- | ---------------------------------------------- |
| *route-map*   | Route map name.                                |
| *seq-num*     | Sequence number, the range is from 1 to 65535. |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no route-map** *route-map* \{**permit**|**deny**} *seq\_num* to delete the route map.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 100
sonic(config-route-map)#
```

### <font color="#1d50a2">description *description*</font>

**\[Command]**
**description** *description*

**\[Purpose]**
Specify the description for the route-map.

**\[Parameters]**

| **Parameter** | **Description** |
| ------------- | --------------- |
| *description* | In string form. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no description** *description* to delete description.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# route-map test permit 1000
sonic(config)# description test
```

### <font color="#1d50a2">match as-path *as\_path\_filter\_name*</font>

**\[Command]**
**match as-path** *as\_path\_filter\_name*

**\[Purpose]**
Match AS-path list.

**\[Parameters]**

| **Parameter**            | **Description** |
| ------------------------ | --------------- |
| *as\_path\_filter\_name* | AS-path list.   |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no match as-path** *as\_path\_filter\_name* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match as-path test
```

### <font color="#1d50a2">match community \{*community\_list\_number|community\_list\_name*\} \[exact-match\]</font>

**\[Command]**
**match community** \{community\_list\_number|community\_list\_name} \[**exact-match**]

**\[Purpose]**
Match BGP community list.

**\[Parameters]**

| **Parameter**             | **Description**                                                                       |
| ------------------------- | ------------------------------------------------------------------------------------- |
| *community\_list\_number* | Community-list number, range from 1 to 500. 1-99 as standard and 100-500 as expanded. |
| *community\_list\_name*   | Community name.                                                                       |
| **exact-match**           | Exact match.                                                                          |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no match community** \{*community\_list\_number*|*community\_list\_name*} \[**exact-match**] to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match community test
```

### <font color="#1d50a2">match extcommunity \{*extcommunity\_list\_number*|*extcommunity\_list\_name*\}</font>

**\[Command]**
**match *ext*community** \{*extcommunity\_list\_number*|*extcommunity\_list\_name*}

**\[Purpose]**
Match BGP/VPN extended community list.

**\[Parameters]**

| **Parameter**                | **Description**                                                                       |
| ---------------------------- | ------------------------------------------------------------------------------------- |
| *extcommunity\_list\_number* | Community-list number, range from 1 to 500. 1-99 as standard and 100-500 as expanded. |
| *extcommunity\_list\_name*   | Specify extcommunity-list.                                                            |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **nomatch extcommunity** \{*extcommunity\_list\_number*|*extcommunity\_list\_name*} to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match extcommunity 100
```

### <font color="#1d50a2">match \{ip|ipv6\} address \{prefix-len *length*|prefix-list *list\_name*\}</font>

**\[Command]**
**match** \{**ip**|**ipv6**} **address** \{**prefix-len** *length*|**prefix-list** *list\_name*}

**\[Purpose]**
Match address of route.

**\[Parameters]**

| **Parameter** | **Description**                     |
| ------------- | ----------------------------------- |
| *length*      | IP address length.                  |
| *list\_name*  | Specify the name of IP prefix list. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no match** \{**ip**|**ipv6**} **address** \{**prefix-len** *length*|**prefix-list** *list\_name*} to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match ip address prefix-list test
```

### <font color="#1d50a2">match \{ip|ipv6\} next-hop \{prefix-len *length*|prefix-list *list\_name*|address\{*A.B.C.D*|*X\:X\:\:X\:X*\}|type blackhole\}</font>

**\[Command]**
**match** \{**ip**|**ipv6**} **next-hop** \{**prefix-len** *length*|**prefix-list** *list\_name*|**address** \{*A.B.C.D*|*X\:X\::X\:X*}|**type blackhole**}

**\[Purpose]**
Match next-hop address of route.

**\[Parameters]**

| **Parameter** | **Description**                     |
| ------------- | ----------------------------------- |
| *length*      | IP address length.                  |
| *list\_name*  | Specify the name of IP prefix list. |
| *A.B.C.D*     | IPv4 address.                       |
| *X\:X\::X\:X* | IPv6 address.                       |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no match** \{**ip**|**ipv6**} **next-hop** \{**prefix-len** *length*|**prefix-list** *list\_name*|**address** \{*A.B.C.D*|*X\:X\::X\:X*}|**typeblackhole**} to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match ip next-hop type blackhole
```

### <font color="#1d50a2">match local-preference *preference\_value*</font>

**\[Command]**
**match local-preference** *preference\_value*

**\[Purpose]**
Match local-preference of route.

**\[Parameters]**

| **Parameter**       | **Description**                               |
| ------------------- | --------------------------------------------- |
| *preference\_value* | Route preference, range from 0 to 4294967295. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **nomatch local-preference** *preference\_value* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match local-preference 12
```

### <font color="#1d50a2">match metric *metric\_value*</font>

**\[Command]**
**match metric** *metric\_value*

**\[Purpose]**
Match metric of route.

**\[Parameters]**

| **Parameter**   | **Description**                           |
| --------------- | ----------------------------------------- |
| *metric\_value* | Route metric, range from 0 to 4294967295. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no match metric** *metric\_value* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match metric 12
```

### <font color="#1d50a2">match peer \{*A.B.C.D*|*X\:X\:\:X\:X*|*interface\_name*\}</font>

**\[Command]**
**match peer** \{A.B.C.D|*X\:X\::X\:X*|interface\_name}

**\[Purpose]**
Match peer address.

**\[Parameters]**

| **Parameter**     | **Description** |
| ----------------- | --------------- |
| *A.B.C.D*         | IPv4 address    |
| *X\:X\::X\:X*     | IPv6 address    |
| *interface\_name* | interface name  |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no match peer** \{*A.B.C.D*|*X\:X\::X\:X*|*interface\_name*} to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# match peer 1.1.1.1
```

### <font color="#1d50a2">set as-path prepend \{*as-path*|last-as *number*\}</font>

**\[Command]**
**set as-path prepend** \{*as-path*|**last-as** *number*}

**\[Purpose]**
Prepend to the as-path.

**\[Parameters]**

| **Parameter**        | **Description**                                                                         |
| -------------------- | --------------------------------------------------------------------------------------- |
| *as-path*            | AS number, range from 1 to 4294967295. Specify multiple AS numbers separated by spaces. |
| **last-as** *number* | Use the last AS-number in the as-path. The number range is 1\~10.                       |

**\[View]**
Route-map Configuration View

**\[Notes]**
**set as-path prepend** \{*as-path*|**last-as** *number*} to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set as-path prepend 100 200
```

### <font color="#1d50a2">set as-path exclude *AS-number*</font>

**\[Command]**
**set as-path exclude** *AS-number*

**\[Purpose]**
Exclude from the as-path.

**\[Parameters]**

| **Parameter** | **Description**                                                                         |
| ------------- | --------------------------------------------------------------------------------------- |
| *AS-number*   | AS number, range from 1 to 4294967295. Specify multiple AS numbers separated by spaces. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set as-path exclude** *AS-number* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set as-path exclude 12
```

### <font color="#1d50a2">set community *AA\:NN*</font>

**\[Command]**
**set community** *AA\:NN*

**\[Purpose]**
Set BGP Community.

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                                                                                                                                                                      |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *AA\:NN*      | Community number in *AA\:NN* format (where AA and NN are (0-65535)) or local-AS\|no-advertise\|no-export\|internet\|graceful-shutdown\|accept-own-nexthop\|accept-own\|route-filter-translated-v4\|route-filter-v4\|route-filter-translated-v6\|route-filter-v6\|llgr-stale\|no-llgr\|blackhole\|no-peer or additive |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set community** *AA\:NN* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set community 12
```

### <font color="#1d50a2">set community none</font>

**\[Command]**
**set communitynone**

**\[Purpose]**
Set no BGP Community.

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set community** to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set community none
```

### <font color="#1d50a2">set distance *distance*</font>

**\[Command]**
**set distance** *distance*

**\[Purpose]**
Set BGP Administrative Distance to use.

**\[Parameters]**

| **Parameter** | **Description**      |
| ------------- | -------------------- |
| *distance*    | Range from 0 to 255. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set distance** *distance* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set distance 12
```

### <font color="#1d50a2">set extcommunity none</font>

**\[Command]**
**set extcommunitynone**

**\[Purpose]**
Set no extended community attribute.

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set extcommunity** to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set extcommunity none
```

### <font color="#1d50a2">set extcommunity rt *ASN\:NN\_OR\_IP-ADDRESS\:NN*</font>

**\[Command]**
**set extcommunity rt** *ASN\:NN\_OR\_IP-ADDRESS\:NN*

**\[Purpose]**
Set Route Target extended community.

**\[Parameters]**

| **Parameter**                 | **Description**                                                                    |
| ----------------------------- | ---------------------------------------------------------------------------------- |
| *ASN\:NN\_OR\_IP-ADDRESS\:NN* | VPN extended community. When specifying more than one, separate them with a space. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set extcommunity rt** *ASN\:NN\_OR\_IP-ADDRESS\:NN* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set extcommunity rt 100:1:2
```

### <font color="#1d50a2">set extcommunity soo *ASN\:NN\_OR\_IP-ADDRESS\:NN*</font>

**\[Command]**
**set extcommunity soo** *ASN\:NN\_OR\_IP-ADDRESS\:NN*

**\[Purpose]**
Set Site-of-Origin extended community.

**\[Parameters]**

| **Parameter**                 | **Description**                                                                    |
| ----------------------------- | ---------------------------------------------------------------------------------- |
| *ASN\:NN\_OR\_IP-ADDRESS\:NN* | VPN extended community. When specifying more than one, separate them with a space. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set extcommunity soo** *ASN\:NN\_OR\_IP-ADDRESS\:NN* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set extcommunity soo 100:1:2
```

### <font color="#1d50a2">set ip next-hop \{*A.B.C.D*|*peer-address*\}</font>

**\[Command]**
**set ip next-hop** \{*A.B.C.D*|*peer-address*}

**\[Purpose]**
Set next-hop IP address.

**\[Parameters]**

| **Parameter**  | **Description**                 |
| -------------- | ------------------------------- |
| *A.B.C.D*      | IPv4 address.                   |
| *peer-address* | Use peer address (for BGP only) |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set ip next-hop** *A.B.C.D* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set ip next-hop 1.1.1.1
```

### <font color="#1d50a2">set ipv6 next-hop \{local *X\:X\:\:X\:X*|global *X\:X\:\:X\:X*|peer-address\}</font>

**\[Command]**
**set ipv6 next-hop** \{**local** *X\:X\::X\:X*|**global** *X\:X\::X\:X*|**peer-address**}

**\[Purpose]**
Set next-hop IPv6 address.

**\[Parameters]**

| **Parameter**            | **Description**                 |
| ------------------------ | ------------------------------- |
| **local** *X\:X\::X\:X*  | IPv6 local address.             |
| **global** *X\:X\::X\:X* | IPv6 global address.            |
| **peer-address**         | Use peer address (for BGP only) |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set ipv6 next-hop local** *X\:X\::X\:X* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set ipv6 next-hop local 100::1
```

### <font color="#1d50a2">set local-preference *preference\_value*</font>

**\[Command]**
**set local-preference** *preference\_value*

**\[Purpose]**
Set local-preference of route.

**\[Parameters]**

| **Parameter**       | **Description**                 |
| ------------------- | ------------------------------- |
| *preference\_value* | Preference value (0-4294967295) |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set local-preference** *preference\_value* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set local-preference 12
```

### <font color="#1d50a2">set metric \{*metric\_value*|rtt|+rtt|-rtt\}</font>

**\[Command]**
**set metric** \{*metric\_value*|**rtt**|**+rtt**|**-rtt**}

**\[Purpose]**
**Set metric value.**

**\[Parameters]**

| **Parameter**   | **Description**                                                                |
| --------------- | ------------------------------------------------------------------------------ |
| *metric\_value* | Metric value (use +/- for additions or subtractions) (-4294967295-4294967295). |
| *rtt*           | Assign round trip time.                                                        |
| *+rtt*          | Add round trip time.                                                           |
| *-rtt*          | Subtract round trip time.                                                      |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set metric** \{*metric\_value*|**rtt**|**+rtt**|**-rtt** } to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set metric 12
```

### <font color="#1d50a2">set weight *weight*</font>

**\[Command]**
**set weight** *weight*

**\[Purpose]**
Set BGP weight for routing table.

**\[Parameters]**

| **Parameter** | **Description**                           |
| ------------- | ----------------------------------------- |
| *weight*      | Weight value, range from 0 to 4294967295. |

**\[View]**
Route-map Configuration View

**\[Notes]**
Run command **no set weight** *weight* to delete the configuration.

**\[Use Cases]**

```plaintext
sonic(config)# route-map test permit 1000
sonic(config-route-map)# set weight 12
```

