Ad Home

Juniper BGP Communities

Share:

show route protocol bgp 16.16.16.16/32 detail | match Communities
Standard 

### no export - no eBGP

configure
set interfaces lo0 unit 0 family inet address 1.1.1.2/32
set interfaces lo0 unit 0 family inet address 1.1.1.3/32
set policy-options policy-statement ADVERTISE_ROUTES term 2 from protocol direct
set policy-options policy-statement ADVERTISE_ROUTES term 2 from route-filter 1.1.1.2/32 exact
set policy-options policy-statement ADVERTISE_ROUTES term 2 from route-filter 1.1.1.3/32 exact
set policy-options policy-statement ADVERTISE_ROUTES term 2 then accept
set policy-options policy-statement ADVERTISE_ROUTES term 2 then community add TAG-NO-EXPORT
set policy-options community TAG-NO-EXPORT members no-export
commit

### No-advertise - a Nadie
## Se puede aplicar de salida "OUTound" --> o de entrada "INbound"
## Outbound
vMXvCP-1:
cli
configure
set interfaces lo0 unit 0 family inet address 1.1.1.2/32
set interfaces lo0 unit 0 family inet address 1.1.1.3/32
set policy-options policy-statement ADVERTISE_ROUTES term 2 from protocol direct
set policy-options policy-statement ADVERTISE_ROUTES term 2 from route-filter 1.1.1.2/32 exact
set policy-options policy-statement ADVERTISE_ROUTES term 2 from route-filter 1.1.1.3/32 exact
set policy-options policy-statement ADVERTISE_ROUTES term 2 then accept
set policy-options policy-statement ADVERTISE_ROUTES term 2 then community add TAG-NO-ADV
set policy-options community TAG-NO-ADV members no-advertise
commit


#INbound
vMXvCP-5:
cli
configure
set policy-options policy-statement TAG_ROUTES term 2 from protocol bgp
set policy-options policy-statement TAG_ROUTES term 2 from route-filter 6.6.6.7/32 exact
set policy-options policy-statement TAG_ROUTES term 2 from route-filter 6.6.6.8/32 exact
set policy-options policy-statement TAG_ROUTES term 2 then accept
set policy-options policy-statement TAG_ROUTES term 2 then community add TAG-NO-ADV
set policy-options community TAG-NO-ADV members no-advertise
set protocol bgp group eBGP import TAG_ROUTES
commit

### Custom_TAG
### PARA TAGEAR
set protocols bgp export ADVERTISE_ROUTES

set policy-options policy-statement ADVERTISE_ROUTES from protocol direct    
set policy-options policy-statement ADVERTISE_ROUTES from route-filter 8.8.8.8/32 exact
set policy-options policy-statement ADVERTISE_ROUTES then accept
set policy-options policy-statement ADVERTISE_ROUTES then community add MY_TAGGED_ROUTES

set policy-options  community MY_TAGGED_ROUTES members 8:8


### Match the TAG

#Create policy
set policy-options policy-statement MATCH_ROUTES term 1 from protocol bgp
set policy-options policy-statement MATCH_ROUTES term 1 from community MATCH_TAG_8:8
set policy-options policy-statement MATCH_ROUTES term 1 then local-preference 200
set policy-options policy-statement MATCH_ROUTES term 1 then accept
set policy-options community MATCH_TAG_8:8 members 8:8

set protocols bgp group eBGP neighbor 192.168.56.5 import MATCH_ROUTES

-------------------- // -------------------- // -------------------- 

### LAB FINAL CUSTOM TAGS
1:2 NO-ADV
1:3 NO-EXPORT


vMXvCP-1:
cli
configure
set interfaces lo0 unit 0 family inet address 1.1.1.2/32
set interfaces lo0 unit 0 family inet address 1.1.1.3/32
set policy-options policy-statement ADVERTISE_ROUTES term 2 from protocol direct
set policy-options policy-statement ADVERTISE_ROUTES term 2 from route-filter 1.1.1.2/32 exact
set policy-options policy-statement ADVERTISE_ROUTES term 2 then accept
set policy-options policy-statement ADVERTISE_ROUTES term 2 then community add TAG-1:2
set policy-options policy-statement ADVERTISE_ROUTES term 3 from protocol direct
set policy-options policy-statement ADVERTISE_ROUTES term 3 from route-filter 1.1.1.3/32 exact
set policy-options policy-statement ADVERTISE_ROUTES term 3 then accept
set policy-options policy-statement ADVERTISE_ROUTES term 3 then community add TAG-1:3
set policy-options community TAG-1:2 members 1:2
set policy-options community TAG-1:3 members 1:3
commit
vMXvCP-2:
cli
configure
set policy-options policy-statement MATCH_ROUTES term 1 from protocol bgp
set policy-options policy-statement MATCH_ROUTES term 1 from community MATCH_TAG_1:2
set policy-options policy-statement MATCH_ROUTES term 1 then accept
set policy-options policy-statement MATCH_ROUTES term 1 then community add TAG-NO-ADV
set policy-options policy-statement MATCH_ROUTES term 2 from protocol bgp
set policy-options policy-statement MATCH_ROUTES term 2 from community MATCH_TAG_1:3
set policy-options policy-statement MATCH_ROUTES term 2 then accept
set policy-options policy-statement MATCH_ROUTES term 2 then community add TAG-NO-EXPORT
set policy-options community TAG-NO-EXPORT members no-export
set policy-options community TAG-NO-ADV members no-advertise
set policy-options community MATCH_TAG_1:2 members 1:2
set policy-options community MATCH_TAG_1:3 members 1:3
set protocol bgp group eBGP import MATCH_ROUTES
commit
 


No hay comentarios

COMENTA CON TU PERFIL DEFACEBOK

Ad Home