Импортировать получаемые по BGP маршруты в другую табличку маршрутизации (routing-instances) с использованием rib-group для семейства протокола BGP.
Имеем BGP пира:
set protocols bgp local-as 49620
set protocols bgp group KICHKAS-NET type external
set protocols bgp group KICHKAS-NET peer-as 42714
set protocols bgp group KICHKAS-NET neighbor 172.16.100.2 import KICHKASNET-IN
set protocols bgp group KICHKAS-NET neighbor 172.16.100.2 export KICHKASNET-OUT
От пира получаем определенные подсети:
itbiz@border> show route receive-protocol bgp 172.16.100.2
inet.0: 112 destinations, 112 routes (111 active, 0 holddown, 1 hidden)
Prefix Nexthop MED Lclpref AS path
* 10.10.0.0/16 172.16.100.2 0 42714 I
* 10.11.0.0/16 172.16.100.2 0 42714 I
* 10.12.0.0/16 172.16.100.2 0 42714 I
...
Добавляем конфигурацию rib-groups:
set protocols bgp family inet unicast rib-group FROM-INET0---NAT-RI
set routing-instances NAT-RI instance-type virtual-router
set routing-instances NAT-RI interface ms-0/2/0.100
set routing-instances NAT-RI routing-options static route 0.0.0.0/0 next-hop ms-0/2/0.100
set routing-instances NAT-RI routing-options static route 10.0.64.0/22 next-table inet.0
set routing-options rib-groups FROM-INET0---NAT-RI export-rib inet.0
set routing-options rib-groups FROM-INET0---NAT-RI import-rib inet.0
set routing-options rib-groups FROM-INET0---NAT-RI import-rib NAT-RI.inet.0
set routing-options rib-groups FROM-INET0---NAT-RI import-policy FROM-INET0---NAT-RI---BGP
Проверка - количество маршрутов в default routing-instance = количеству маршрутов в таблице в которую импортируем префиксы:
itbiz@border> show route summary | match "inet|BGP"
inet.0: 112 destinations, 112 routes (111 active, 0 holddown, 1 hidden)
BGP: 44 routes, 44 active
inet.1: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
NAT-RI.inet.0: 46 destinations, 46 routes (46 active, 0 holddown, 0 hidden)
BGP: 44 routes, 44 active
itbiz@border> show route table NAT-RI.inet.0
NAT-RI.inet.0: 46 destinations, 46 routes (46 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 02:41:30
> via ms-0/2/0.100
10.0.64.0/22 *[Static/5] 01:21:38
to table inet.0
10.10.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 42714 I, validation-state: unverified
> to 172.16.100.2 via irb.800
10.11.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 42714 I, validation-state: unverified
> to 172.16.100.2 via irb.800
10.12.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 42714 I, validation-state: unverified
> to 172.16.100.2 via irb.800
10.30.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 43633 I, validation-state: unverified
> to 172.16.100.3 via irb.800
Имеем BGP пира:
set protocols bgp local-as 49620
set protocols bgp group KICHKAS-NET type external
set protocols bgp group KICHKAS-NET peer-as 42714
set protocols bgp group KICHKAS-NET neighbor 172.16.100.2 import KICHKASNET-IN
set protocols bgp group KICHKAS-NET neighbor 172.16.100.2 export KICHKASNET-OUT
От пира получаем определенные подсети:
itbiz@border> show route receive-protocol bgp 172.16.100.2
inet.0: 112 destinations, 112 routes (111 active, 0 holddown, 1 hidden)
Prefix Nexthop MED Lclpref AS path
* 10.10.0.0/16 172.16.100.2 0 42714 I
* 10.11.0.0/16 172.16.100.2 0 42714 I
* 10.12.0.0/16 172.16.100.2 0 42714 I
...
Добавляем конфигурацию rib-groups:
set protocols bgp family inet unicast rib-group FROM-INET0---NAT-RI
set routing-instances NAT-RI instance-type virtual-router
set routing-instances NAT-RI interface ms-0/2/0.100
set routing-instances NAT-RI routing-options static route 0.0.0.0/0 next-hop ms-0/2/0.100
set routing-instances NAT-RI routing-options static route 10.0.64.0/22 next-table inet.0
set routing-options rib-groups FROM-INET0---NAT-RI export-rib inet.0
set routing-options rib-groups FROM-INET0---NAT-RI import-rib inet.0
set routing-options rib-groups FROM-INET0---NAT-RI import-rib NAT-RI.inet.0
set routing-options rib-groups FROM-INET0---NAT-RI import-policy FROM-INET0---NAT-RI---BGP
Проверка - количество маршрутов в default routing-instance = количеству маршрутов в таблице в которую импортируем префиксы:
itbiz@border> show route summary | match "inet|BGP"
inet.0: 112 destinations, 112 routes (111 active, 0 holddown, 1 hidden)
BGP: 44 routes, 44 active
inet.1: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
NAT-RI.inet.0: 46 destinations, 46 routes (46 active, 0 holddown, 0 hidden)
BGP: 44 routes, 44 active
itbiz@border> show route table NAT-RI.inet.0
NAT-RI.inet.0: 46 destinations, 46 routes (46 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 02:41:30
> via ms-0/2/0.100
10.0.64.0/22 *[Static/5] 01:21:38
to table inet.0
10.10.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 42714 I, validation-state: unverified
> to 172.16.100.2 via irb.800
10.11.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 42714 I, validation-state: unverified
> to 172.16.100.2 via irb.800
10.12.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 42714 I, validation-state: unverified
> to 172.16.100.2 via irb.800
10.30.0.0/16 *[BGP/170] 00:06:50, MED 0, localpref 500
AS path: 43633 I, validation-state: unverified
> to 172.16.100.3 via irb.800
Комментариев нет:
Отправить комментарий