您的位置:首页 > 其它

OSPF中stub area配置实例

2012-11-14 22:59 423 查看




拓扑图如上所示,配置如下

r1 {
interfaces {
em1 {
unit 12 {
vlan-id 12;
family inet {
address 10.0.4.5/30;
}
}
}
lo0 {
unit 1 {
family inet {
address 10.0.0.1/32;
}
}
}
}
protocols {
ospf {
area 0.0.0.1 {
stub//area 1配置为末节区域
interface em1.12;
}
}
}
}
r2 {
interfaces {
em2 {
unit 21 {
vlan-id 12;
family inet {
address 10.0.4.6/30;
}
}
unit 23 {
vlan-id 23;
family inet {
address 10.0.4.2/30;
}
}
}
lo0 {
unit 2 {
family inet {
address 10.0.0.2/32;
}
}
}
}
protocols {
ospf {
area 0.0.0.1 {
stub default-metric 15 no-summaries;//area1配置了no-summaries为完全末节区域,juniper默认不会像stub区域通告一条默认路由,所以只有配上default-metric才能会向末节区域通告一条默认路由
interface em2.21;
}
area 0.0.0.0 {
interface em2.23;
}
}
}
}
r3 {
interfaces {
unit 32 {
vlan-id 23;
family inet {
address 10.0.4.1/30;
}
}
unit 34 {
vlan-id 34;
family inet {
address 10.0.2.5/30;
}
}
}
lo0 {
unit 3 {
family inet {
address 10.0.0.3/32;
}
}
}
}
protocols {
ospf {
export rip-to-ospf;
area 0.0.0.0 {
interface em3.32;
}
}
rip {
group RIP {
export [ rip-to-rip ospf-to-rip ];
neighbor em3.34;
}
}
}
policy-options {
policy-statement ospf-to-rip {
term 1 {
from protocol ospf;
then accept;
}
term 2 {
from interface em3.32;//将接口em3.32所在的网段宣告出去
then accept;
}
}
policy-statement rip-to-ospf {
term 1 {
from {
route-filter 10.0.2.4/30 exact;//只有在路由表中的路由条目才能被宣告
}
then accept;
}
}
policy-statement rip-to-rip {
term 1 {
from interface em3.34;
then accept;
}
}
}
}
r4 {
interfaces {
unit 43 {
vlan-id 34;
family inet {
address 10.0.2.6/30;
}
}
}
lo0 {
unit 4 {
family inet {
address 10.0.0.4/32;
}
}
}
}
protocols {
rip {
group RIP {
export rip-to-rip;
neighbor em4.43;
}
}
}
policy-options {
policy-statement rip-to-rip {
term 1 {
from interface em4.43;
then accept;
}
}
}
}olive# run show route logical-system r1 protocol ospf

inet.0: 7 destinations, 7 routes (7 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

0.0.0.0/0 *[OSPF/10] 00:07:11, metric 16
> to 10.0.4.6 via em1.12
224.0.0.5/32 *[OSPF/10] 03:47:21, metric 1
MultiRecv
此时我们看到r1有一条默认路由,且汇总路由也被屏蔽了

本文出自 “Rista” 博客,转载请与作者联系!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: