Juniper中要实现像cisco那样的重分布功能就要通过policy来实现,下面就是我的一个实例:其功能就是把static路由重分布到ospf中,下面是拓扑图
export default-static;//输出policy-options中的策略 default-static
route-filter 0.0.0.0/0 exact;//0.0.0.0/0是要过滤的静态路由条目,exact表示精确匹配
路由表如下:olive> show route logical-system all
logical-system: r5
inet.0: 2 destinations, 3 routes (2 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
172.30.25.0/30 *[Direct/0] 00:10:57
> via em5.51
[Static/5] 00:10:57
> to 172.30.25.1 via em5.51
172.30.25.2/32 *[Local/0] 00:10:57
Local via em5.51
-----
logical-system: r1
inet.0: 11 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[Static/5] 00:10:57//静态路由默认管理距离为5
> to 172.30.25.2 via em1.15
10.0.0.1/32 *[Direct/0] 11:02:30
> via lo0.1
10.0.2.4/30 *[OSPF/10] 00:10:13, metric 2
> to 10.0.4.13 via em1.13
10.0.4.4/30 *[Direct/0] 00:10:57
> via em1.12
10.0.4.5/32 *[Local/0] 00:10:57
Local via em1.12
10.0.4.8/30 *[OSPF/10] 00:10:07, metric 2
> to 10.0.4.6 via em1.12
10.0.4.12/30 *[Direct/0] 00:10:57
> via em1.13
10.0.4.14/32 *[Local/0] 00:10:57
Local via em1.13
172.30.25.0/30 *[Direct/0] 00:10:57
> via em1.15
172.30.25.1/32 *[Local/0] 00:10:57
Local via em1.15
224.0.0.5/32 *[OSPF/10] 11:02:43, metric 1
MultiRecv
-----
logical-system: r3
inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[OSPF/150] 00:10:13, metric 0, tag 0
> to 10.0.4.14 via em3.31//OSPF外部路由默认管理距离为 150
10.0.0.3/32 *[Direct/0] 11:02:25
> via lo0.3
10.0.2.4/30 *[Direct/0] 00:10:57
> via em3.34
10.0.2.5/32 *[Local/0] 00:10:57
Local via em3.34
10.0.4.4/30 *[OSPF/10] 00:10:13, metric 2
> to 10.0.4.14 via em3.31
10.0.4.8/30 *[OSPF/10] 00:10:12, metric 2
> to 10.0.2.6 via em3.34
10.0.4.12/30 *[Direct/0] 00:10:57
> via em3.31
10.0.4.13/32 *[Local/0] 00:10:57
Local via em3.31
224.0.0.5/32 *[OSPF/10] 11:02:43, metric 1
MultiRecv
-----
logical-system: r2
inet.0: 9 destinations, 9 routes (9 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[OSPF/150] 00:10:07, metric 0, tag 0
> to 10.0.4.5 via em2.21
10.0.0.2/32 *[Direct/0] 11:02:31
> via lo0.2
10.0.2.4/30 *[OSPF/10] 00:10:17, metric 2
> to 10.0.4.9 via em2.24
10.0.4.4/30 *[Direct/0] 00:10:57
> via em2.21
10.0.4.6/32 *[Local/0] 00:10:57
Local via em2.21
10.0.4.8/30 *[Direct/0] 00:10:57
> via em2.24
10.0.4.10/32 *[Local/0] 00:10:57
Local via em2.24
10.0.4.12/30 *[OSPF/10] 00:10:07, metric 2
> to 10.0.4.5 via em2.21
224.0.0.5/32 *[OSPF/10] 11:02:43, metric 1
MultiRecv
-----
logical-system: r4
inet.0: 10 destinations, 10 routes (10 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
0.0.0.0/0 *[OSPF/150] 00:10:07, metric 0, tag 0
to 10.0.4.10 via em4.42
> to 10.0.2.5 via em4.43
10.0.0.0/24 *[Direct/0] 00:54:19
> via lo0.4
10.0.0.4/32 *[Local/0] 00:54:19
Local via lo0.4
10.0.2.4/30 *[Direct/0] 00:10:57
> via em4.43
10.0.2.6/32 *[Local/0] 00:10:57
Local via em4.43
10.0.4.4/30 *[OSPF/10] 00:10:17, metric 2
> to 10.0.4.10 via em4.42
10.0.4.8/30 *[Direct/0] 00:10:57
> via em4.42
10.0.4.9/32 *[Local/0] 00:10:57
Local via em4.42
10.0.4.12/30 *[OSPF/10] 00:10:12, metric 2
> to 10.0.2.5 via em4.43
224.0.0.5/32 *[OSPF/10] 00:55:31, metric 1
MultiRecv