简介
本文档介绍 passive-interface
命令,可用于控制路由信息的通告。
背景信息
此命令可抑制某些接口上的路由更新,同时允许在其他接口上正常交换更新。
对于某些路由协议,特别是路由信息协议第2版(RIPv2),passive-interface命令仅限制传出通告。但是,当与增强型内部网关路由协议(EIGRP)一起使用时,效果稍有不同。本文档演示了如何使用 passive-interface
eigrp中的命令会抑制两台路由器之间的hello数据包交换,从而导致路由器失去邻居关系。这不仅会停止正在广播的路由更新,还会抑制传入的路由更新。本文档还讨论了允许抑制传出路由更新且同时还允许从邻居获知传入路由更新所需的配置。
先决条件
要求
本文档没有任何特定的要求。
使用的组件
本文档中的信息基于以下软件和硬件版本:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
passive interface 命令

EIGRP在网络上运行时, passive-interface
命令会停止传出和传入的路由更新,因为命令的作用会导致路由器停止通过接口发送和接收hello数据包。
以下是的示例输出 debug eigrp packet hello
使用 passive-interface
命令not configured for Serial0:
R1#debug eigrp packet hello
EIGRP Packets debugging is on
(HELLO)
R1#
Nov 20 08:07:33.131: EIGRP: Sending HELLO on Serial0
Nov 20 08:07:33.135: AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0
Nov 20 08:07:35.327: EIGRP: Received HELLO on Serial0 nbr 192.168.1.1
Nov 20 08:07:35.331: AS 1, Flags 0x0, Seq 0/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
您可以看到hello数据包在两个方向上都进行了交换。这是 show ip eigrp neighbor
命令。
R1#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq Type
(sec) (ms) Cnt Num
0 192.168.1.1 Se0 13 00:24:47 1 3000 0 1
注意:接口发送和接收hello数据包,并且两台路由器是邻居。
这是一个示例 debug
输出后 passive-interface
命令。
R1(config)#router eigrp 1
R1(config-router)#passive-interface serial 0
R1# debug eigrp packet hello
EIGRP Packets debugging is on
(HELLO)
注意:由于未显示任何输出,因此EIGRP不仅会抑制出站hello,还会忽略入站呼叫。两个路由器不再是邻居。以下是 show ip eigrp neighbors
命令。 passive-interface
命令。
R1#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
当 passive-interface
命令用于EIGRP,路由器不能在接口上形成邻居邻接关系,或发送或接收路由更新。但是,如果您希望单独抑制传出路由更新,但是继续收到入站更新(并且路由器仍然保持邻居),则使用 distribute-list
指令:
R1(config)#access-list 20 deny any
R1(config)#router eigrp 1
R1(config-router)#no passive-interface serial 0
R1(config-router)#distribute-list 20 out serial 0
以下是 show ip eigrp neighbors
命令。 distribute-list
指令:
R1#show ip eigrp neighbors
IP-EIGRP neighbors for process 1
H Address Interface Hold Uptime SRTT RTO Q Seq Type
(sec) (ms) Cnt Num
0 192.168.1.1 Se0 14 00:01:31 1 3000 0 3R1#
可以看到,路由器现在是邻居了。此示例允许串行端口0上的R1及其相邻之间形成邻接。R1继续从其邻居接收路由更新,但 distribute-list
命令可防止将路由通告到serial 0之外。
相关信息