点对多点 RIP 网络
配置点对多点 RIP 网络概述
点对多点 RIP 网络由单个接口上具有两个或多个对等方的设备组成。形成点到多点连接的所有设备都放置在一个广播域中。
在 RIP 网络中,设备接口可以有一个或多个对等方。但是,RIP 网络中的需求电路功能实施需要使用单个 RIP 对等方。配置以下语句时,带需求电路的 RIP 网络也可配置为一个接口上有多个对等方:
使用
interface-type (Protocols RIP) p2mp
语句将接口类型配置为多点接口。通过使用
dynamic-peers
语句启用动态对等方发现(仅限 SRX 系列设备)。注意:配置
dynamic-peers
语句之前,必须通过配置 IPsec 参数来配置 IPsec 隧道,并设置 IPsec 隧道。如果没有 IPsec 配置,必须使用语句在 RIP 协议级别peer address
显式配置远程对等方。有关详细信息,请参阅 在 ES PIC 上为 IPsec 配置安全关联 。使用
peer address
语句配置对等方。[edit] protocols { rip { group red { neighbor fe-0/1/3 { interface-type (Protocols RIP) p2mp; peer address; (or use dynamic-peers;) } } } }
命令 show rip statistics peer address
可用于在对等级别显示 RIP 统计信息。命令 clear rip statistics peer address
可用于清除对等方的 RIP 统计信息。或者,您可以使用 show rip statistics peer all 和 clear rip statistics peer all
命令来显示和清除所有对等方的 RIP 统计信息。
示例:配置点对多点 RIP 网络
此示例说明如何配置点到多点 RIP 网络。
要求
此示例使用以下硬件和软件组件:
M 系列路由器、MX 系列路由器、T 系列路由器或 SRX 系列设备
Junos OS 12.1 或更高版本
概述
在 RIP 网络中,设备接口可以有一个或多个对等方。但是,RIP 网络中的需求电路功能实施需要使用单个 RIP 对等方。
在包括以下语句时,对于给定 RIP 邻接方,需求电路实现可以具有多个对等方。
使用
interface-type (Protocols RIP) p2mp
语句将接口类型配置为多点接口。通过使用动态对等方语句启用 动态对等方 发现(仅限 SRX 系列设备)。
注意:要配置语句
dynamic-peers
,必须通过配置 IPsec 参数来设置 IPsec 隧道。有关详细信息,请参阅 在 ES PIC 上为 IPsec 配置安全关联 。使用
peer address
语句配置对等方。[edit] protocols { rip { group red { neighbor fe-0/1/3 { interface-type (Protocols RIP) p2mp; peer address; (or use dynamic-peers;) } } } }
命令 show rip statistics peer
可用于在对等级别显示 RIP 统计信息。
拓扑
在此示例中,设备 R1、R2 和 R3 构成点对多点网络。R1 通过将所有设备置于同一广播域中的交换机,作为点对多点连接连接到 R2 和 R3。所有三个设备上均配置 RIP 需求电路。R1 的两个对等方使用 peer address
语句静态配置。 dynamic-peers
此处不使用该语句。
图 1 显示了此示例中使用的拓扑。
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
设备 R1
set interfaces fe-0/1/3 unit 0 family inet address 23.1.1.1/24 set policy-options policy-statement accept-rip-routes term from-direct from protocol direct set policy-options policy-statement accept-rip-routes term from-direct then accept set policy-options policy-statement accept-rip-routes term from-rip from protocol rip set policy-options policy-statement accept-rip-routes term from-rip then accept set protocols rip traceoptions file R1.log size 4m world-readable set protocols rip traceoptions flag all detail set protocols rip group red export accept-rip-routes set protocols rip group red neighbor fe-0/1/3.0 interface-type p2mp set protocols rip group red neighbor fe-0/1/3.0 peer 23.1.1.2 set protocols rip group red neighbor fe-0/1/3.0 peer 23.1.1.3 set protocols rip group red neighbor fe-0/1/3.0 demand-circuit set protocols rip group red neighbor fe-0/1/3.0 max-retrans-time 10
同样,配置设备 R2 和 R3,省略 对等配置 address 语句。
配置点对多点 RIP 网络(带需求电路)
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
要跨 RIP 网络配置点到多点功能,
配置设备接口。
[edit interfaces fe-0/1/3 unit 0] user@R1# set family inet address 23.1.1.1/24
定义用于将 RIP 路由从路由表导出到通过网络传输的协议的策略。
[edit policy-options policy-statement accept-rip-routes] user@R1# set term from-direct from protocol direct user@R1# set term from-direct then accept user@R1# set term from-rip from protocol rip user@R1# set term from-rip then accept
使用定义的导出策略和点到多点配置语句配置 RIP 和 RIP 组。
[edit protocols rip] user@R1# set traceoptions file R1.log size 4m world-readable user@R1# set traceoptions flag all detail user@R1# set group red export accept-rip-routes user@R1# set group red neighbor fe-0/1/3.0 interface-type p2mp user@R1# set group red neighbor fe-0/1/3.0 peer 23.1.1.2 user@R1# set group red neighbor fe-0/1/3.0 peer 23.1.1.3 user@R1# set group red neighbor fe-0/1/3.0 demand-circuit user@R1# set group red neighbor fe-0/1/3.0 max-retrans-time 10
同样,配置设备 R2 和 R3,省略 对等配置 address 语句。
注意:配置 最大重新传输时间 是可选的。如果没有此配置语句,则配置默认重新传输时间 180 秒。
此示例中使用的配置适用于具有需求电路的 RIP 网络。要为无需求电路的网络配置 RIP,请从配置中排除 需求电路 和
max-retrans-time
语句,并检查生成的输出。有关配置 RIP 需求电路的更多信息,请参阅 示例:配置 RIP 需求电路。
结果
在配置模式下,输入 、 show policy-options
和show protocols rip
命令,show interfaces
以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
[edit] user@R1# show interfaces fe-0/1/3 { unit 0 { family inet { address 23.1.1.1/24; } } }
user@R1# show protocols rip traceoptions { file R1.log size 4m world-readable; flag all detail; } group red { export accept-rip-routes; neighbor fe-0/1/3.0 { interface-type p2mp; peer 23.1.1.2; peer 23.1.1.3; demand-circuit; max-retrans-time 10; } }
user@R1# show policy-options policy-statement accept-rip-routes { term from-direct { from protocol direct; then accept; } term from-rip { from protocol rip; then accept; } }
完成设备配置后,请在配置模式下输入 提交 。
验证
确认配置工作正常。
验证点对多点 RIP 网络
目的
验证 RIP 网络在配置的点到多点功能时是否正常运行。
行动
在操作模式下,运行 show rip neighbor
命令。
user@R1> show rip neighbor Local Source Destination Send Receive In Neighbor State Address Address Mode Mode Met -------- ----- ------- ----------- ---- ------- --- fe-0/1/3.0(DC) Up 23.1.1.1 23.1.1.2 unicast unicast 1 fe-0/1/3.0(DC) Up 23.1.1.1 23.1.1.3 unicast unicast 1
在操作模式下,运行 show rip statistics peer address
命令。
user@R1> show rip statistics peer 23.1.1.2 RIPv2 info: port 520; holddown 120s. rts learned rts held down rqsts dropped resps dropped 3 0 0 0 fe-0/1/3.0 Peer-Ip 23.1.1.2: 2 routes learned; 3 routes advertised; timeout 180s; update interval 0s Counter Total Last 5 min Last minute ------- ----------- ----------- ----------- Updates Sent 0 0 0 Triggered Updates Sent 3 0 0 Responses Sent 0 0 0 Bad Messages 0 0 0 RIPv1 Updates Received 0 0 0 RIPv1 Bad Route Entries 0 0 0 RIPv1 Updates Ignored 0 0 0 RIPv2 Updates Received 2 0 0 RIPv2 Bad Route Entries 0 0 0 RIPv2 Updates Ignored 0 0 0 Authentication Failures 0 0 0 RIP Requests Received 0 0 0 RIP Requests Ignored 0 0 0 none 3 0 0
user@R1> show rip statistics peer 23.1.1.3 RIPv2 info: port 520; holddown 120s. rts learned rts held down rqsts dropped resps dropped 3 0 0 0 fe-0/1/3.0 Peer-Ip 23.1.1.3: 2 routes learned; 3 routes advertised; timeout 180s; update interval 0s Counter Total Last 5 min Last minute ------- ----------- ----------- ----------- Updates Sent 0 0 0 Triggered Updates Sent 3 0 0 Responses Sent 0 0 0 Bad Messages 0 0 0 RIPv1 Updates Received 0 0 0 RIPv1 Bad Route Entries 0 0 0 RIPv1 Updates Ignored 0 0 0 RIPv2 Updates Received 2 0 0 RIPv2 Bad Route Entries 0 0 0 RIPv2 Updates Ignored 0 0 0 Authentication Failures 0 0 0 RIP Requests Received 0 0 0 RIP Requests Ignored 0 0 0 none 3 0 0
意义
RIP 网络已启动并运行,配置了点对多点功能。