在网络中的路由器上启用 OSPF
操作
要在 MPLS 网络中的路由器上启用 OSPF,请按照以下步骤操作:
在配置模式下,转至以下层次结构级别:
[edit]user@host# edit protocols ospf配置区域和接口:
[edit protocols ospf]user@host# set area area-id interface type-fpc/pic/port如果您已在上一步中包括interface all语句,请禁用管理接口:
[edit protocols ospf]user@host# set interface fxp0.0 disable包括回传(lo0)接口(如果您打算手动配置 RID):
[edit protocols ospf]user@host# set area 0.0.0.0 interface lo0设置回传接口(lo0)到被动:
[edit protocols ospf]user@host# set area 0.0.0.0 interface lo0 passive配置流量工程:
[edit protocols ospf]user@host# set traffic-engineering在 [路由选项] 层次结构级别:
[edit]user@host# edit routing-options[edit routing-options]user@host# set router-id router-id验证并提交整个配置:
user@host# showuser@host# commit
示例输出
user@R6> edit Entering configuration mode [edit] user@R6# edit protocols ospf [edit protocols ospf] user@R6# set area 0.0.0.0 interface so-0/0/0.0 [edit protocols ospf] user@R6# set area 0.0.0.0 interface lo0 [edit protocols ospf] user@R6# set area 0.0.0.0 interface lo0 passive [edit protocols ospf] user@R6# set traffic-engineering [edit protocols ospf] user@R6# show traffic-engineering; area 0.0.0.0 { interface so-0/0/0.0; interface so-0/0/1.0; interface so-0/0/2.0; interface so-0/0/3.0; interface lo0.0 { passive; } [edit protocols ospf] user@R6# commit commit complete [edit] user@R6# edit routing-options [edit routing-options] user@R6# set router-id 10.0.0.6 [edit routing-options] user@R6# show [...Output truncated...] router-id 10.0.0.6; autonomous-system 65432; [edit routing-options] user@R6# commit commit complete
含义
示例输出显示,与流量工程一起 OSPF 在出口路由器上的接口上启用 R6. 此外,还会手动配置 RID,以避免在 OSPF RID 发生变化时可能出现的问题;例如,当配置多个环回地址时。RID 在 OSPF 网络内唯一标识路由器。它在用于填充链路状态数据库和计算最短路径树的 Lsa 内传输。在链路状态网络中,重要的是两个路由器不共享相同的 RID 值,否则可能会出现 IP 路由问题。
示例输出还显示 passive包含在回传配置中的语句(lo0网卡. 包括该passive语句将被视为最佳实践并确保以下各项:
协议不会通过回传运行(lo0)接口
如果手动配置路由器 ID (RID),则可确保回送(lo0)接口被通告给其他网络。