求助:JNCIP p512 bogon策略问题
按studyguide中写策略
[email=lab@r1]lab@r1[/email]# show policy-options policy-statement bogons
term 1 {
from {
route-filter 0.0.0.0/0 through 0.0.0.0/7 reject;
route-filter 0.0.0.0/1 prefix-length-range /1-/7 reject;
}
}
term 2 {
from {
route-filter 0.0.0.0/0 prefix-length-range /25-/32 reject;
route-filter 172.16.0.0/12 orlonger reject;
route-filter 192.168.0.0/16 orlonger reject;
route-filter 10.0.0.0/8 orlonger reject;
}
}
所有策略均生效
但是如果全部放到一个term中
[edit logical-routers r1 policy-options policy-statement bogons term 1]
[email=root@JNCIP]root@JNCIP[/email]# show
from {
route-filter 0.0.0.0/0 through 0.0.0.0/7;
route-filter 0.0.0.0/1 prefix-length-range /1-/7;
route-filter 172.16.0.0/12 orlonger;
route-filter 192.168.0.0/16 orlonger;
route-filter 10.0.0.0/8 orlonger;
route-filter 0.0.0.0/0 prefix-length-range /25-/32 ;
}
then reject;
[email=root@JNCIP]root@JNCIP[/email]# run show route logical-router r1 120/8
inet.0: 47 destinations, 55 routes (42 active, 0 holddown, 6 hidden)
+ = Active Route, - = Last Active, * = Both
120.120.0.0/24 *[BGP/170] 01:13:33, localpref 100
AS path: 65050 I
> to 10.0.5.254 via fxp1.12
120.120.1.0/24 *[BGP/170] 01:13:33, localpref 100
AS path: 65050 I
> to 10.0.5.254 via fxp1.12
。。。。。。。。。。。
120.120.7.0/24 *[BGP/170] 01:13:33, localpref 100
AS path: 65050 I
> to 10.0.5.254 via fxp1.12
120.120.69.128/25 *[BGP/170] 01:13:33, localpref 100
AS path: 65050 I
> to 10.0.5.254 via fxp1.12
可见 route-filter 0.0.0.0/0 prefix-length-range /25-/32这条策略没有匹配上。
将此策略移入新建的term 2
term 1 {
from {
route-filter 0.0.0.0/0 through 0.0.0.0/7;
route-filter 0.0.0.0/1 prefix-length-range /1-/7;
route-filter 172.16.0.0/12 orlonger;
route-filter 192.168.0.0/16 orlonger;
route-filter 10.0.0.0/8 orlonger;
}
then reject;
}
term 2 {
from {
route-filter 0.0.0.0/0 prefix-length-range /25-/32
}
then reject;
}
[email=root@JNCIP]root@JNCIP[/email]# run show route hidden logical-router r1 120/8
inet.0: 47 destinations, 55 routes (41 active, 0 holddown, 7 hidden)
+ = Active Route, - = Last Active, * = Both
120.120.69.128/25 [BGP ] 00:15:56, localpref 100
AS path: 65050 I
> to 10.0.5.254 via fxp1.12
可见策略立即重新生效。 疑惑不解 期待解答