I have the following topology
ISP1 ------- ME ---------ISP2
I do not ME to be a transit route. So I have the following configuration
set policy-options community ISP1111 members 9999:1111
set policy-options community ISP2222 members 9999:2222
set policy-options policy-statement FromISP1 term 1 then community set ISP1111
set policy-options policy-statement FromISP1 term 1 then accept
set policy-options policy-statement FromISP2 term 1 then community set ISP2222
set policy-options policy-statement FromISP2 term 1 then accept
set policy-options policy-statement ToISP term 1 from interface lo0.0
set policy-options policy-statement ToISP term 1 then accept
set policy-options policy-statement ToISP term 2 from community ISP1111
set policy-options policy-statement ToISP term 2 to neighbor 10.1.2.1
set policy-options policy-statement ToISP term 2 then reject
set policy-options policy-statement ToISP term 3 from community ISP2222
set policy-options policy-statement ToISP term 3 to neighbor 10.1.1.1
set policy-options policy-statement ToISP term 3 then reject
set policy-options policy-statement ToISP term last then next policy
set protocols bgp group ToISP1 type external
set protocols bgp group ToISP1 import FromISP1
set protocols bgp group ToISP1 export ToISP
set protocols bgp group ToISP1 neighbor 10.1.1.1 peer-as 1111
set protocols bgp group ToISP2 type external
set protocols bgp group ToISP2 import FromISP2
set protocols bgp group ToISP2 export ToISP
set protocols bgp group ToISP2 neighbor 10.1.2.1 peer-as 2222
I do not understand what is wrong with the following line
set policy-options policy-statement ToISP term 3 to neighbor 10.1.1.1
without this line, nothing filtered out
root@Bracnch1# run show route advertising-protocol bgp 10.1.1.1
inet.0: 20 destinations, 27 routes (20 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 10.100.0.0/16 Self 2222 10458 100001 I
* 10.150.0.99/32 Self I
* 10.200.0.0/16 Self 2222 10458 I
* 192.168.0.0/16 Self 2222 10458 {100001} I
without this line
[edit]
root@Bracnch1# run show route advertising-protocol bgp 10.1.1.1
inet.0: 20 destinations, 27 routes (20 active, 0 holddown, 0 hidden)
Prefix Nexthop MED Lclpref AS path
* 10.150.0.99/32 Self I
thanks in advance !!!