文档名称 :NBMA 中的 OSPF 网络类型 文档分类 : 路由技术 撰 写 :Magic 收档日期 :2008-05-01-1 -
OSPF 在 NBMA 中的五种运行模式 : OSPF 模式 首选 NBMA 子网地址 Hello 定时器 广播 全互联或部分互联 相同 10s 非广播 全互联或部分互联 相同 30s 点到多点 部分互联或星型 相同 30s 点到多点 非广播 部分互联或星型 相同 30s 点到点 部分互联或星型拓每个子接口扑, 使用子接口各不相同 10s 邻接关系自动发现选举 DR/DR 手工指定选举 DR/DR 自动发现不需要 DR/DR 手工指定不需要 DR/DR 自动发现 RFC/ 示例 Cisco Cisco LAN 接口, 如以太网接口 RFC 配置了帧中继的串行接口 RFC 无需 DR 的帧中继 OSPF 模式, 在 VC 支持组播广播时使用 Cisco 无需 DR 的帧中继 OSPF 模式, 在 VC 不支持组播广播时使用 不需要 DR/DR Cisco 包含点到点子接的串行接口 如 RFC2328 所描述的那样, 在 NBMA 拓扑中,OSPF 以下列两种正式模式之一运行 : NBMA 一个 IP 子网 必须手工指定邻居 选举 DR 和 BDR,DR 和 BDR 必须与其它所有路由器都直接相连 全互联或部分互联拓补 P2MP 一个 IP 子网 使用 OSPF 组播 Hello 分组来自动发现邻居 不选举 DR 和 BDR, 路由器发送的 LSA 中包含更多有关邻接路由器的信息 通常用于部分互联或星联拓扑中 选择 NBMA 模式还是点到多点模式决定于 NBMA 网络中 Hello 协议和扩散的运行方 式 点到多点模式的主要优点是, 需要进行的手工配置更少 ; 而 NBMA 的主要优点是, 相 比于点到多点模式, 其开销数据流较少 - 2 -
另外,Cisco 还支持如下模式 : P2MP - nonbroadcast 如果没有在 VC 上启用组播和广播, 则不能使用遵循 RFC 的点到多点模式, 因为路由器无法使用组播 Hello 分组动态的发现邻接路由器, 此时就使用 Cisco 模式 一个 IP 子网 必须手工指定邻居 不选举 DR 和 BDR 部分互联或星型拓扑 Broadcast 让 WAN 接口就像是 LAN 接口 一个 IP 子网 使用 OSPF 组播 Hello 分组来自动发现邻居 选举 DR 和 BDR 全互联或部分互联拓扑 P2P 每个接口属于不同的子网 使用 OSPF 组播 Hello 分组来自动发现邻居 用于两台路由器需要在一对接口上建立邻接关系时, 接口可以是 LAN 接口, 也可以是 WAN 接口 不选举 DR 和 BDR 部分互联或星型拓扑 - 3 -
重点默认的 OSPF 模式在帧中继点到点子接口上, 默认的 OSPF 模式为 point-to-point 在帧中继多点子接口上, 默认的 OSPF 模式为 nonbroadcast 在帧中继主接口上, 默认的 OSPF 模式为 nonbroadcast 注意 : 选择 NBMA 中接口的 OSPF 运行模式跟接口的实际工作模式无关 最初创建子接口旨在解决在 NBMA 网络上使用基于距离矢量的路由选择协议时, 水平分割引发的问题 点到点子接口具有点到点物理接口的所有特征 要定义子接口, 可使用全局配置命令 :Router ( config ) # interface serial number.subinterface-number { multipoint point-to-point } 指点关键字 point-to-point 还是 multipoint 将影响 OSPF 的运行方式 选择接口的 OSPF 运行模式, 可以用接口配置命令 :Router(Config-if)# ip ospf network { broadcast non-broadcast point-to-multipoint [ non-broadcast ] point-to-point } 实 验 配置验证 OSPF 的五种运行模式, 拓扑如下所示 : 说明 : 本实验基于 Dynamips, 实验结果全部验证通过 在帧中继网络云中,R2 与 R3 之间是以太网链路, 为了能承载帧中继帧, 在 R2 与 R3 之间做了一条虚拟隧道 (Tunnel) - 4 -
R2 和 R3 的部分配置如下 : R2 no ip routing frame-relay switching interface Tunnel2 tunnel source 23.0.0.2 tunnel destination 23.0.0.3 interface FastEthernet0/0 ip address 23.0.0.2 255.255.255.0 interface Serial1/0 encapsulation frame-relay clock rate 64000 frame-relay intf-type dce frame-relay route 104 interface Serial1/1 401 frame-relay route 105 interface Tunnel2 1000 interface Serial1/1 encapsulation frame-relay clock rate 64000 frame-relay intf-type dce frame-relay route 401 interface Serial1/0 104 frame-relay route 405 interface Tunnel2 1001 R3 no ip routing frame-relay switching interface Tunnel3 tunnel source 23.0.0.3 tunnel destination 23.0.0.2-5 -
interface FastEthernet0/0 ip address 23.0.0.3 255.255.255.0 interface Serial1/1 encapsulation frame-relay clock rate 64000 frame-relay intf-type dce frame-relay route 501 interface Tunnel3 1000 fame-relay route 504 interface Tunnel3 1001 测试 - 确保二层链路层没有问题 在 R1 R4 和 R5 配置如下命令, 然后用 Exec 命令 Show frame-relay pvc 检查 PVC 线路, 全部 Active 即表示二层链路层正常 Router(Config)# interface Serial1/0 Router(Config)# encapsulation frame-relay Router(Config)# no shutdown 实验配置 : LAB1: 全互联拓扑, 运行 Broadcast 模式 ( 遵循 Cisco), 构建 OSPF 网络 L4:OSPF(Mode:Broadcast) L3:IP(MC Hello) L2:FR(Must Support Broadcast traffic) L1:V.35-6 -
Step1: 配置中心点 R4, 分支点 R1 和 R5 R1: R1(Config)# interface serial 1/0.100 multipoint R1(Config)# ip address 100.0.0.1 255.255.255.248 R1(Config)# frame-relay map ip 100.0.0.4 104 broadcast R1(Config)# frame-relay map ip 100.0.0.5 105 broadcast R4: 批注 [M1]: 静态指定映射关系, 基于 Broadcast 模式的帧中继网络, 使用参数 broadcast 来支持二层链路层的组广播 R4(Config)# interface serial 1/0.100 multipoint R4(Config)# ip address 100.0.0.4 255.255.255.248 R4(Config)# frame-relay map ip 100.0.0.1 401 broadcast R4(Config)# frame-relay map ip 100.0.0.5 405 broadcast R5: R5(Config)# interface serial 1/0.100 multipoint R5(Config)# ip address 100.0.0.4 255.255.255.248 R5(Config)# frame-relay map ip 100.0.0.1 501 broadcast R5(Config)# frame-relay map ip 100.0.0.4 504 broadcast Step2: 选定 OSPF 的运行模式 帧中继点到多点子接口, 默认的 OSPF 模式为 non-broadcast, 将 R1 R4 和 R5 子接口的 OSPF 运行模式更改成遵循 Cisco 的广播模式 Router(config)# interface s1/0.100 multipoint Router(config-if)# ip ospf network broadcast 批注 [M2]: 定义子接口的工作模式 批注 [M3]: 定义子接口的 OSPF 运行模式, 多点子接口默认为非广播模式 - 7 -
Step3: 分析 OSPF 帧中继网络 问题 1: 领居能否建立? 组播 Hello 分组正常发送, 形成邻居关系,DROTHER 同 DR 和 BDR 建立邻 接关系 DROTHER 之间只建立邻居关系 问题 2:DR 和 BDR 是否选举? 选举一致的 DR 和 BDR 问题 3: 路由不一跳 ( 可达性 )? 全互联, 各自做了邻居的映射, 路由下一跳可达 但是你会发现 Ping 自己 的 100 网段地址不通, 原因没有到自己的映射, 封装失败 解决办法 : 配置一条指向自己的静态映射 R1(config)# frame-relay map ip 100.0.0.1 104 或 frame-relay map ip 100.0.0.1 105 broadcast R4(config)# frame-relay map ip 100.0.0.4 401 或 frame-relay map ip 100.0.0.4 405 R5(config)# frame-relay map ip 100.0.0.1 501 或 frame-relay map ip 100.0.0.1 504 批注 [M4]: 参数 broadcast 可加可不加, 不影响 - 8 -
LAB2: 星型 (Hub & Spoke) 拓扑, 运行 non-broadcast 模式 ( 遵循 RFC), 构建 OSPF 网络 L4:OSPF(Mode:noo-broadcast) L3:IP(MC Hello) L2:FR(Don t need Support Broadcast traffic) L1:V.35 Step1: 配置中心点 R1 分支点 R4 和 R5: R1: R1(Config)# interface serial 1/0.100 multipoint R1(Config)# ip address 100.0.0.1 255.255.255.248 R1(Config)# frame-relay map ip 100.0.0.4 104 R4: R4(Config)# interface serial 1/0.100 multipoint R4(Config)# ip address 100.0.0.4 255.255.255.248 R4(Config)# frame-relay map ip 100.0.0.1 401 R4(Config)# frame-relay map ip 100.0.0.5 405 批注 [M5]: OSPF 运行模式采用 non-broadcast 模式, 因此帧中继网络无需在二层上支持组广播, 不需要参数 broadcast R5: R5(Config)# interface serial 1/0.100 multipoint R5(Config)# ip address 100.0.0.4 255.255.255.248 R5(Config)# frame-relay map ip 100.0.0.4 504-9 -
Step2: 选定 OSPF 的运行模式 默认情况下, 帧中继多点子接口 OSPF 的运作模式为 non-broadcast Step3: 分析 OSPF 帧中继网络 问题 1: 邻居能否建立? non-broadcast 模式, 不支持组广播, 组播 Hello 分组无法发送, 邻居无法 形成 解决方法 : 手工指定邻居, 只需在中心点 (R4) 配置即可, 分支无需配置 R4(config)# router ospf 100 R4(config-router)# neighbor 100.0.0.1 R4(config-router)# neighbor 100.0.0.5 问题 2:DR 和 BDR 是否选举? 选举 DR 和 BDR, 但在这个网络中存在着一个很严重的问题, 无法形成一致 批注 [M6]: 指定邻居, 可选参数 priority number, 指定邻接路由器的优先级, 默认为 0 该优先级次于接口优先级 的 DR 和 BDR, 网络不稳定 解决方法 : 让中心点 (R4) 成为 DR( 加大子接口的优先级 ), 或者将 R1 和 R5 子接口的优先级设为 0( 不参与 DR 和 BDR 的选举 ) R4(Config)# int s1/0.100 R4(Config-if)# ip ospf priority 255 R1(Config)# int s1/0.100 R5(config)#int s1/0.100 R1(Config-if)# ip ospf priority 0 R5(Config-if)# ip ospf priority 0 注意 : 在路由进程配置命令下, 用命令 neighbor 手工配置邻居时, 可以为邻接路由器指定优先级, 默认时为 0 但是, 默认情况下, 接口的优先级为 1, 用 Show ip ospf neighbor 看到的邻接路由器优先级也为 1, 而不是 0 这是因为接口的优先级优于 neighbor 指定的优先级的 问题 3: 路由的下一跳 ( 可达性 )? 1. R4 可以 ping 通 R1 和 R5,ping 自己的 100 网段地址不通, 原因没有到 - 10 -
自己, 封装失败 解决方法 : 配置一条指向自己的静态映射 R4(config)# frame-relay map ip 100.0.0.1 401 2. R1 和 R5 各自只能通 ping 通中心点 R4, 无法 ping 通分支点及自己的 100 网段地址 而且, 到达远程网络下一跳地址不一致 以 R1 为例 解决方法 : 配置 ip<->dlci 映射关系 R1(config)# frame-relay map ip 100.0.0.5 104 R1(config)# frame-relay map ip 100.0.0.1 104 R5(config)# frame-relay map ip 100.0.0.1 504 R5(config)# frame-relay map ip 100.0.0.5 504-11 -
LAB3: 星型 (Hub & Spoke) 拓扑, 运行 P2MP 模式 ( 遵循 RFC), 构建 OSPF 网络 L4:OSPF(Mode:point-to-multipoint) L3:IP(MC Hello) L2:FR(Must Support Broadcast traffic) L1:V.35 Step1: 配置中心点 R1 分支点 R4 和 R5: R1: R1(Config)# interface serial 1/0.100 multipoint R1(Config)# ip address 100.0.0.1 255.255.255.248 R1(Config)# frame-relay map ip 100.0.0.4 104 broadcast R4: R4(Config)# interface serial 1/0.100 multipoint R4(Config)# ip address 100.0.0.4 255.255.255.248 R4(Config)# frame-relay map ip 100.0.0.1 401 broadcast R4(Config)# frame-relay map ip 100.0.0.5 405 broadcast 批注 [M7]: OSPF 运行模式采用遵循 RFC 的点到多点模式 ( 支持组广播 ), 因此需要二层支持组广播的帧中继网络, 需要参数 broadcast R5: R5(Config)# interface serial 1/0.100 multipoint R5(Config)# ip address 100.0.0.4 255.255.255.248 R5(Config)# frame-relay map ip 100.0.0.4 504 broadcast - 12 -
Step2: 选定 OSPF 运行模式 默认情况下, 帧中继多点子接口 OSPF 的运作模式为 non-broadcast 将 R1 R4 和 R5 子接口的 OSPF 运行模式更改成遵循 RFC 的点到多点模式 Router(config)# interface s1/0.100 multipoint Router(config-if)# ip ospf network point-to-multipoint Setp3: 分析 OSPF 帧中继网络 问题 1: 邻居能否建立? 组播 Hello 分组正常发送, 可以形成邻居 ( 完全邻接 ) 关系 问题 2:DR 和 BDR 是否选举? 不选举 DR 和 BDR 问题 3: 路由的下一跳 ( 可达性 )? 到分支的下一跳地址都在中心点 R4 上 除了自己的 100 网段地址以外, 其余 全部 ping 通 解决方法 : 配置一条指向自己的静态映射 - 13 -
LAB4: 星型 (Hub & Spoke) 拓扑, 运行 P2MP 非广播模式 ( 遵循 Cisco), 构建 OSPF 网络 Step1: 配置中心点 R1 分支点 R4 和 R5: R1: R1(Config)# interface serial 1/0.100 multipoint R1(Config)# ip address 100.0.0.1 255.255.255.248 R1(Config)# frame-relay map ip 100.0.0.4 104 R4: R4(Config)# interface serial 1/0.100 multipoint R4(Config)# ip address 100.0.0.4 255.255.255.248 R4(Config)# frame-relay map ip 100.0.0.1 401 R4(Config)# frame-relay map ip 100.0.0.5 405 批注 [M8]: OSPF 运行模式采用遵循 Cisco 的点到多点模式 无需帧中继网络在二层上支持组广播, 不需要 Broadcast 参数 R5: R5(Config)# interface serial 1/0.100 multipoint R5(Config)# ip address 100.0.0.4 255.255.255.248 R5(Config)# frame-relay map ip 100.0.0.4 504-14 -
Step2: 选定 OSPF 运行模式 默认情况下, 帧中继多点子接口 OSPF 的运作模式为 non-broadcast 将 R1 R4 和 R5 子接口的 OSPF 运行模式更改成遵循 Cisco 的点到多点模式 Router(config)# interface s1/0.100 multipoint Router(config-if)# ip ospf network point-to-multipoint non-broadcast Setp3: 分析 OSPF 帧中继网络 问题 1: 邻居能否建立? Point-to-multipoint non-broadcast 模式, 不支持组广播, 组播 Hello 分组 无法发送, 邻居无法形成 解决方法 : 手工指定邻居, 只需在中心点 (R4) 配置即可, 分支无需配置 R4(config)# router ospf 100 R4(config-router)# neighbor 100.0.0.1 R4(config-router)# neighbor 100.0.0.5 问题 2:DR 和 BDR 是否选举? 不选举 DR 和 BDR 问题 3: 路由下一跳 ( 可达性 )? 到分支的下一跳地址都在中心点 R4 上 除了 ping 自己的 100 网段地址不通, 其余全通 解决方法 : 配置一条指向自己的静态映射 - 15 -
LAB5: 星型 (Hub & Spoke) 拓扑, 运行 P2P 模式 ( 遵循 Cisco), 构建 OSPF 网络 Step1: 配置中心点 R1 分支点 R4 和 R5: R1(Config)# interface serial 1/0.104 point-to-point R1(Config)# ip address 100.0.0.1 255.255.255.248 R1(Config)# frame-relay interface-dlci 104 R4: 批注 [M9]: 定义本地路由器到帧中继交换机的 DLCI 号, 启用动态映射 R4(Config)# interface serial 1/0.401 point-to-point R4(Config)# ip address 100.0.0.2 255.255.255.248 R4(Config)# frame-relay interface-dlci 401 R4(Config)# interface serial 1/0.405 point-to-point R4(Config)# ip address 100.0.0.6 255.255.255.248 R4(Config)# frame-relay interface-dlci 405 R5: R5(Config)# interface serial 1/0.504 point-to-point R5(Config)# ip address 100.0.0.5 255.255.255.248 R5(Config)# frame-relay interface-dlci 504-16 -
Step2: 选定 OSPF 运行模式 默认情况下, 帧中继点到点子接口 OSPF 的运作模式为 point-to-point Setp3: 分析 OSPF 帧中继网络 问题 1: 邻居能否建立? Point-to-point 模式, 支持组广播, 组播 Hello 分组正常发送, 形成邻居 ( 完 全邻接 ) 关系 问题 2:DR 和 BDR 是否选举? 不选举 DR 和 BDR 问题 3: 路由下一跳 ( 可达性 )? 能 ping 通所有地址 原因, 动态映射 - 17 -