В данной статье рассмотрим особенности применения local AS в BGP на оборудовании серии ME. 

Рассмотрим изменения атрибута AS-PATH в различных режимах работы функционала local-as.


Проверим работу функционала на предложенной схеме.  В данной статье приведен пример конфигурации только узла R2.

1) Режим работы local-as без дополнительной команды 'mode':

Конфигурация router bgp
router bgp 65100  
    neighbor 172.27.72.229
    address-family ipv4 unicast
    local-as 65432
    mode no-prepend
    remote-as 45679
    update-source 172.27.72.227
  exit

  neighbor 2.1.3.1
    address-family ipv4 unicast
    exit
    remote-as 65106
    update-source 2.1.3.2
  exit
exit
Вывод информации о анонсируемых маршрутах
 0/ME5200S:KONDA-PE21# show  bgp  neighbors  2.1.3.1 advertised-routes 
Thu Mar 12 05:40:03 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 2.1.3.1
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    2.1.1.0/24          2.1.3.2          0       0       advertised            no-aggregation                  65100 65432 45679 i 

  Total entries: 1
  
0/ME5200S:KONDA-PE21# show  bgp  neighbors  172.27.72.229 advertised-routes 
Thu Mar 12 05:40:05 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 172.27.72.229
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    192.0.1.0/24        172.27.72.227    0       0       advertised            no-aggregation                  65432 65100 65106 123 i 

  Total entries: 1

Cессия с соседом устанавливается с использованием номера сконфигурированного командой local-as <number AS>. Как мы можем наблюдать, как к полученным маршрутам от R1, так и к переданным маршрутам R3, мы добавили как local-as, так и global-as в атрибут AS-PATH.

2) mode no-prepend

Конфигурация router bgp
router bgp 65100  
    neighbor 172.27.72.229
    address-family ipv4 unicast
    local-as 65432
    mode no-prepend
    remote-as 45679
    update-source 172.27.72.227
  exit

  neighbor 2.1.3.1
    address-family ipv4 unicast
    exit
    remote-as 65106
    update-source 2.1.3.2
  exit
exit
Вывод информации о анонсируемых маршрутах
 0/ME5200S:KONDA-PE21# show  bgp  neighbors  2.1.3.1 advertised-routes 
Thu Mar 12 05:40:03 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 2.1.3.1
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    2.1.1.0/24          2.1.3.2          0       0       advertised            no-aggregation                  65100 45679 i 

  Total entries: 1
  
0/ME5200S:KONDA-PE21# show  bgp  neighbors  172.27.72.229 advertised-routes 
Thu Mar 12 05:40:05 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 172.27.72.229
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    192.0.1.0/24        172.27.72.227    0       0       advertised            no-aggregation                  65432 65100 65106 123 i 

  Total entries: 1

В данном режиме к маршруту полученному от R3, добавили local as и global as в атрибут AS-PATH при отправке соседу R1, а к маршруту полученному от R1, добавили global as в атрибуте AS-PATH при отправке соседу R3.

3) mode no-prepend-replace

Конфигурация router bgp
router bgp 65100  
    neighbor 172.27.72.229
    address-family ipv4 unicast
    local-as 65432
    mode no-prepend-replace
    remote-as 45679
    update-source 172.27.72.227
  exit

  neighbor 2.1.3.1
    address-family ipv4 unicast
    exit
    remote-as 65106
    update-source 2.1.3.2
  exit
exit
Вывод информации о анонсируемых маршрутах
 0/ME5200S:KONDA-PE21# show  bgp  neighbors  2.1.3.1 advertised-routes 
Thu Mar 12 05:40:03 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 2.1.3.1
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    2.1.1.0/24          2.1.3.2          0       0       advertised            no-aggregation                  65100 45679 i 

  Total entries: 1
  
0/ME5200S:KONDA-PE21# show  bgp  neighbors  172.27.72.229 advertised-routes 
Thu Mar 12 05:40:05 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 172.27.72.229
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    192.0.1.0/24        172.27.72.227    0       0       advertised            no-aggregation                  65432 65106 123 i 

  Total entries: 1

К маршруту полученному от R3, добавили local-as в атрибут AS-PATH при отправке соседу R1, а к маршруту полученному от R1 добавили global-as в атрибуте AS-PATH при отправке соседу в R3.

3) mode no-prepend-replace-dual

Происходит тот же самый процесс добавления AS-PATH к маршрутам, что и в mode no-prepend-replace,  но отличием является то, что есть возможность установить bgp соседство как по local-as так и по global-as и в зависимости от того с каким номером as установилось соседство такой as и будет добавляться к маршрутам.

Конфигурация router bgp
router bgp 65100  
    neighbor 172.27.72.229
    address-family ipv4 unicast
    local-as 65432
    mode  no-prepend-replace-dual 
    remote-as 45679
    update-source 172.27.72.227
  exit

  neighbor 2.1.3.1
    address-family ipv4 unicast
    exit
    remote-as 65106
    update-source 2.1.3.2
  exit
exit

0/ME5200S:KONDA-PE21# show  bgp  neighbors  172.27.72.229
Thu Mar 12 07:48:53 2026
  BGP router identifier 172.27.72.227, local AS number 65100
    
    BGP neighbor is 172.27.72.229
    Description: 
     Remote AS 45679, local AS 65432, external link <<  соседство поднято от AS 65432

Вывод информации о анонсируемых маршрутах
 0/ME5200S:KONDA-PE21# show  bgp  neighbors  2.1.3.1 advertised-routes 
Thu Mar 12 05:40:03 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 2.1.3.1
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    2.1.1.0/24          2.1.3.2          0       0       advertised            no-aggregation                  65100 45679 i << к маршруту от R1 добавили global AS-PATH  

  Total entries: 1
  
0/ME5200S:KONDA-PE21# show  bgp  neighbors  172.27.72.229 advertised-routes 
Thu Mar 12 05:40:05 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 172.27.72.229
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    192.0.1.0/24        172.27.72.227    0       0       advertised            no-aggregation                  65432 65106 123 i << к маршруту от R3 добавили local AS-PATH 

  Total entries: 1

Со стороны R1 поменяем конфигурацию remote-as на 65100

Конфигурация router bgp
0/ME5200S:KONDA-PE21# show  bgp  neighbors  172.27.72.229
Thu Mar 12 08:37:09 2026
  BGP router identifier 172.27.72.227, local AS number 65100
    
    BGP neighbor is 172.27.72.229
    Description: 
     Remote AS 45679, local AS 65100, external link <<  соседство поднято от AS 65100
Вывод информации о анонсируемых маршрутах
 0/ME5200S:KONDA-PE21# show  bgp  neighbors  2.1.3.1 advertised-routes 
Thu Mar 12 05:40:03 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 2.1.3.1
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    2.1.1.0/24          2.1.3.2          0       0       advertised            no-aggregation                  65100 45679 i  << к маршруту от R1 добавился  global AS-PATH 

  Total entries: 1
  
0/ME5200S:KONDA-PE21# show  bgp  neighbors  172.27.72.229 advertised-routes 
Thu Mar 12 05:40:05 2026
  BGP router identifier 172.27.72.227, local AS number 65100 
  Graceful Restart is disabled
  BGP table state: active
  
  Status codes: a additional-path
  Origin codes: i igp, e egp, ? incomplete
  
  Advertised routes for peer: 172.27.72.229
  
  Network               Next hop         Metric  LocPrf  Advertisement status  Local agr type                  Path 
  --------------------- ---------------- ------- ------- --------------------- ------------------------------- ----- 
    192.0.1.0/24        172.27.72.227    0       0       advertised            no-aggregation                  65100 65106 123 i << к маршруту от R3 добавился  global AS-PATH


  Total entries: 1

  • Нет меток