Neste artigo será demonstrado como criar sessões BGP nos equipamentos Ufispace, além de alguns exemplos de filtros, prefix-list e aplicação de community.

Para elaborar as configurações, será utilizado o cenário abaixo:

BGP Ufispace: 10.0.0.1 
Neighbor BGP: 10.0.0.2 
AS Local: 65000 
AS Remoto: 65010 
Prefixo BGP local: 200.0.0.0/22 
Prefixo BGP remoto: 210.0.0.0/22 

Política BGP: Anúncio de rota Default + prefixo local
Recebimento apenas do prefixo 210.0.0.0/22 com marcação de community 65000:1000
Ambos utilizando Route-map

Configuração de Prefix-list de Rota Default:

ip prefix-list DEFAULT-ROUTE 
permit 0.0.0.0/0 

Configuração de Prefix-List com prefixos 200.0.0.0/22 e 210.0.0.0/22, permitindo até /24:

ip prefix-list LAB_NETWORK 
permit 200.0.0.0/22 le 24 
 
ip prefix-list CUSTOMER-AS-65010 
permit 210.0.0.0/22 le 24 

Configuração de Route-Map permitindo o prefixo do ASN 65010 e marcando community 65000:1000 :

route-map CUSTOMER-AS-65010-IN permit 10 
match ip address prefix-list CUSTOMER-AS-65010 
set community 65000:1000 
 
route-map CUSTOMER-AS-65010-IN deny 5000 

Configuração de Route-Map para anunciar rota default e prefixo 200.0.0.0/22:

route-map CUSTOMER-AS-65010-OUT permit 10 
match ip address prefix-list DEFAULT-ROUTE 
 
route-map CUSTOMER-AS-65010-OUT permit 20 
match ip address prefix-list LAB_NETWORK 
 
route-map CUSTOMER-AS-65010-OUT deny 5000 

Configuração das rotas de blackhole (para evitar loop estático e criar rotas na tabela de rotas):

ip route 200.0.0.0/22 null 
ip route 200.0.0.0/23 null 
ip route 200.0.2.0/23 null 

Acessar configuração BGP, colocando o AS Local:

router bgp 65000 

Configurar Router-ID

bgp router-id 10.99.99.1 

Configuração de Network IPv4:

address-family ipv4 
network 200.0.0.0/22 
network 200.0.0.0/23 
network 200.0.2.0/23 
exit 

Configuração do neighbor BGP:

neighbor 10.0.0.2 remote-as 65010 
neighbor 10.0.0.2 description CUSTOMER-AS-65010 

Configuração dos filtros BGP:

address-family ipv4 
neighbor 10.0.0.2 activate 
neighbor 10.0.0.2 route-map CUSTOMER-AS-65010-OUT out 
neighbor 10.0.0.2 route-map CUSTOMER-AS-65010-IN in 
exit 

Conferir configuração e aplicar:

exit 
show transaction current 
commit 
exit 

Para verificar estado da sessão BGP:

OcNOS#show ip bgp summary 
BGP router identifier 10.99.99.1, local AS number 65000 
BGP table version is 2 
2 BGP AS-PATH entries 
1 BGP community entries 
 
Neighbor                 V   AS   MsgRcv    MsgSen TblVer   InQ   OutQ    Up/Down   State/PfxRcd 
10.0.0.2                 4 65010  611        619       2      0      0  00:06:21               3 

Verificar o que está sendo anunciado na sessão BGP:

OcNOS#show ip bgp neighbors 10.0.0.2 advertised-routes 
 
Address family: IPv4 Unicast 
BGP table version is 2, local router ID is 10.99.99.1 
Status codes: s suppressed, d damped, a add-path, h history, * valid, > best, i - internal 
Origin codes: i - IGP, e - EGP, ? - incomplete 
 
    Network          Next Hop            Metric    LocPrf   Weight Path 
*>   200.0.0.0/22     10.0.0.1             0        100       32768  i 
*>   200.0.0.0/23     10.0.0.1             0        100       32768  i 
*>   200.0.2.0/23     10.0.0.1             0        100       32768  i 

Verificar o que recebemos de prefixo:

OcNOS#show ip bgp neighbors 10.0.0.2 routes 
BGP table version is 2, local router ID is 10.99.99.1 
Status codes: s suppressed, d damped, h history, a add-path, * valid, > best, i - internal, 
              l - labeled, S Stale 
Origin codes: i - IGP, e - EGP, ? - incomplete 
 
    Network          Next Hop            Metric    LocPrf   Weight Path 
*>   210.0.0.0/22     10.0.0.2             0        100       0   65010 i 
*>   210.0.0.0/23     10.0.0.2             0        100       0   65010 i 
*>   210.0.2.0/23     10.0.0.2             0        100       0   65010 i 

Resumo de todas configurações aplicadas

! 
ip prefix-list CUSTOMER-AS-65010 
 seq 5 permit 210.0.0.0/22 le 24 
! 
ip prefix-list DEFAULT-ROUTE 
 seq 5 permit 0.0.0.0/0 
! 
ip prefix-list LAB_NETWORK 
 seq 5 permit 200.0.0.0/22 le 24 
! 
route-map CUSTOMER-AS-65010-IN permit 10 
 match ip address prefix-list CUSTOMER-AS-65010 
 set community 65000:1000 
! 
route-map CUSTOMER-AS-65010-IN deny 5000 
! 
route-map CUSTOMER-AS-65010-OUT permit 10 
 match ip address prefix-list DEFAULT-ROUTE 
! 
route-map CUSTOMER-AS-65010-OUT permit 20 
 match ip address prefix-list LAB_NETWORK 
! 
route-map CUSTOMER-AS-65010-OUT deny 5000 
! 
router bgp 65000 
 bgp router-id 10.99.99.1 
 neighbor 10.0.0.2 remote-as 65010 
 neighbor 10.0.0.2 description CUSTOMER-AS-65010 
 ! 
 address-family ipv4 unicast 
 network 200.0.0.0/22 
 network 200.0.0.0/23 
 network 200.0.2.0/23 
 neighbor 10.0.0.2 activate 
 neighbor 10.0.0.2 route-map CUSTOMER-AS-65010-IN in 
 neighbor 10.0.0.2 route-map CUSTOMER-AS-65010-OUT out 
 exit-address-family 
!