Lab EIGRP Passive Interface

被动接口 passive-interface
——————————————————————————————————
要想正确的配置路由协议,passive-interface命令绝对不可不知。不过,如果你不是在使用动态路由协议(比如OSPF,EIGRP,或者RIP)的话,那你倒也用不到这个命令。 
  passive-interface命令仅仅工作于路由器配置模式(Router Configuration Mode)。当你看到如下所示的命令行提示符时,那你就知道自己已经进入该模式了:Router(config-router)

  你可以使用passive-interface命令告知动态路由协议不要通过该接口发送网络广播。这个命令可以对所有的IP路由协议生效,仅BGP除外。

  不过,该命令在OSPF上工作,和在IS-IS上有点不同。用OSPF,被动指定的网络接口作为stub(末节区域)出现,并不发送和接收任何路由更新。使用RIP,IGRP,以及EIGRP时,它不发送任何路由,但是它能接收它们。同样,它也将对网络上所有非被动的接口发送广播。

  使用passive-interface命令有两种方式。

  指定某个接口成为被动模式,这意味着它将不会发出路由更新。

  首先将所有接口设为被动模式。然后在那些你打算发送路由更新的接口上,使用no passive-interface命令。

  让我们来对两种方式各看一个示例。注:两个事例都假定你已经预先添加了对路由协议是被动接口的网络(使用网络命令)。

  让一个接口变成被动模式,只需要对接口进行指定。这里是一个示例:

  Router(config)# router rip Router(config-router)# passive-interface Ethernet 0/0

  要将所有接口设为被动,然后单独打开某个接口,仅需使用passive-interface default和no passive-interface命令(在IOS 12.0中介绍)。下面是个示例:

  Router(config)# router rip Router(config-router)# passive-interface default Router(config-router)# no passive-interface Serial 0/0
————————————————————————————————————————————————————
被动接口可以完全阻止接口发送路由更新。此命令适用于所有的IGP协议。
————————————————————————————————————————————————————
总结:RIP和IGRP不用和邻接路由器建立邻接关系,当配置了'passive interface'后,该路由器仅从相应的接口收听相应的路由协议包,而不发送路由协议包。 'passive interface'对OSPF,EIGRP则意义不大,因为这两种路由协议都要建立邻接关系。路由包不容许发送,邻接关系就建立不起来。因此在OSPF,EIGRP中,这条命令很少用到。 

而分布列表对于任何网络协议都是一个比较好的解决显示问题的方法。它可以“伪被动”端口但是同时保持邻居信息。
————————————————————————————————————————————————————
1:分布列表同样也可以控制OSPF的路由更新,但是只会过滤路由更新,不会过滤hello包的发送。所以在使用分布列表的情况下OSPF仍然可以保持邻居状态。
2:OSPF和EIGRP的hello包是组播包。如果使用了被动接口,OSPF和EIGRP的所有更新和数据包都无法发送。所以无法维持邻居状态。
————————————————————————————————————————————————————

Step 1 :
R2#debug eigrp packets update 
EIGRP Packets debugging is on
    (UPDATE)
*Mar  1 00:36:42.807: EIGRP: Received UPDATE on FastEthernet0/0.12 nbr 12.1.1.1
*Mar  1 00:36:42.811:   AS 100, Flags 0x0, Seq 18/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0
*Mar  1 00:36:42.827: EIGRP: Enqueueing UPDATE on FastEthernet0/0.12 iidbQ un/rely 0/1 serno 22-22
*Mar  1 00:36:42.831: EIGRP: Sending UPDATE on FastEthernet0/0.12
*Mar  1 00:36:42.835:   AS 100, Flags 0x0, Seq 30/0 idbQ 0/0 iidbQ un/rely 0/0 serno 22-22
*Mar  1 00:36:42.839: EIGRP: Enqueueing UPDATE on FastEthernet0/0.23 iidbQ un/rely 0/1 serno 22-22
*Mar  1 00:36:42.843: EIGRP: Sending UPDATE on FastEthernet0/0.23
*Mar  1 00:36:42.843:   AS 100, Flags 0x0, Seq 31/0 idbQ 0/0 iidbQ un/rely 0/0
R2# serno 22-22
*Mar  1 00:36:42.903: EIGRP: Received UPDATE on FastEthernet0/0.23 nbr 23.1.1.3
*Mar  1 00:36:42.903:   AS 100, Flags 0x0, Seq 15/0 idbQ 0/0 iidbQ un/rely 0/0 peerQ un/rely 0/0


R2(config)#router eigrp 100
R2(config-router)#
R2(config-router)#
R2(config-router)#pas
R2(config-router)#passive-interface in
R2(config-router)#passive-interface f 
R2(config-router)#passive-interface fastEthernet ?
  <0-6>  FastEthernet interface number

R2(config-router)#passive-interface fastEthernet 0/0.12
R2(config-router)#
R2(config-router)#
*Mar  1 00:39:17.347: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 12.1.1.1 (FastEthernet0/0.12) is down: interface passive
R2(config-router)#end
R2#sh ip p
*Mar  1 00:39:19.227: %SYS-5-CONFIG_I: Configured from console by console
R2#sh ip pro
R2#sh ip protocols 
Routing Protocol is "eigrp 100"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Default networks flagged in outgoing updates
  Default networks accepted from incoming updates
  EIGRP metric weight K1=1, K2=0, K3=1, K4=0, K5=0
  EIGRP maximum hopcount 100
  EIGRP maximum metric variance 1
  Redistributing: eigrp 100
  EIGRP NSF-aware route hold timer is 240s
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    12.0.0.0
    23.0.0.0
    24.0.0.0
  Passive Interface(s):
    FastEthernet0/0.12
  Routing Information Sources:
    Gateway         Distance      Last Update
    12.1.1.1              90      00:02:37
    23.1.1.3              90      00:00:03
    24.1.1.4              90      00:08:37


 

原文地址:https://www.cnblogs.com/cyrusxx/p/12615697.html