Passive-interface is not a RIP-specific command; it may be configured under any IP routing protocol.
Using the passive-interface command essentially makes a router a silent host on the data link specified.
Like other silent hosts, it still listens to RIP broadcasts on the link and updates its routing table
accordingly. If the desired result is to prevent the router from learning routes on the link, it must be
achieved by more intricate control of routing updates, namely by filtering out updates. (Route filters are
discussed in Chapter 13, "Route Filtering." ) Unlike a silent host, the router does not respond to a RIP
Request received on a passive interface.
This router command disables sending routing updates on the specified interface. In
the example, when used with RIP, this command prevents RIP updates from being
sent on interface S2/1. This is in case RTF has multiple customers connected that do
not need to see each other's networks.
When used with OSPF, this command disables hello packets from being sent on the
specified interface, which therefore prevents link state information from being
exchanged on that interface
被动接口不是一个RIP协议专有的命令,这个命令可以配置于任何IP路由协议下。使用这个命令就好像把路由器弄成一个链路上制定的“安静的”主机(终端)。和其他“安静的”主机(终端)一样,这个路由器仍然listen 链路上的RIP广播并且以此来更新自己的路由表。如果想要让路由不再listen,需要配置诸如路由过滤这样的路由控制策略。 和“安静的”主机(终端)不同的是,路由器不会对在被动接口上收到的任何RIP请求作出响应。
这个路由命令式的一个指定/特定的接口不能在发送路由条目更新包。
而当在OSPF中使用此命令时,这个命令使得OSPF Hello包不能在此接口上发送出去。也因此防止了链路状态信息在这个接口上被交换。
引用自一位高人(忘记名字了,可能是我没有记性吧):
之前有提到过passive-interface这个命令.这是属于router mode的command,也是所有CCIE一定要知道的东西,所以,如果你碰到一个家伙自称是CCIE,可以请他解释一下这个指令.从他的解释,你差不 多可以了解一下对方的程度.完全说不上来的,那可能连CCNP都没有,如果解释的还可以,那至少也该有个CCNP的Level了,当然,如果可以详细说明 的,就算没有考上CCIE(也许是对方不削于考),程度应该不会太离谱了...
用最简单的话来说,passive-interface的作用,就是让某些在routing protocol作用范围内的interface光吃饭不做事.(这真是让人既羨慕又忌妒…)
不过,使用passive-interface可以根据routing protocol分三种情况.
第一种是RIP和IGRP.这一种routing protcol的特点是不会与对方router建立关系(你要说发生关系我也不反对...).所以,router是每隔一段时间就会发生只听不送的状况. 换句话说,只要routing protocol的process还在运行,routing update还是可以接收信息,只不过因为passive-interface指令的关系,update会送不出去,所以如果要阻止update送进 router中,还要加上distribute-list平当incoming update.这是第一路情况.
第二种是像OSPF,EIGRP之类的routing protocol.这一种路由协议的特点是会与对方router建立关系,也就是说router之间会建neighbor,所以,一旦用了passive -interface之后,你就断开了router之间的关系(heihei...这是破坏人家的姻缘,小心被众routers怨恨...).因为no relationship, no update.因此,所有的update送不出去,介是也收不进来.这是第二种情况.
第三种是ISIS.这是最奇怪的一种.有玩过的就知道,ISIS的routing command是下在interface mode而不在routing mode.所以如果把一个网段加入,就用ip router isis命令.好了,问题是,如果我不要这个interface收送isis routing update,但是又要这个interface所属的网段要加入ISIS的routing之中,那要怎么做??答案就是用passive- interface.当然你也可以用redistribute connected的方式来做.但就是不如passive-interface的方式 来的简洁,或者,你也可以笨笨的在interface下ip router isis,然后用distribute-list来阻止.不过,玩routing protocol玩到这个程度,你还是不要去考CCIE比较好.那个考试费用省下来可以多吃见顿好的了.
4.启用passive-interface命令可以禁用一些不需要接收和转发路由信息的端口。建议对于不需要路由的端口,启用passive-interface。但是,在RIP协议是只是禁止转发路由信息,并没有禁止接收。在OSPF协议中是禁止转发和接收路由信息。 PASSIVE-INTERFACE主要作用是接收路由信息但是不发送,这在一个多动态路由协议的广播网络中及特殊应用中比较多.
! Rip中,禁止端口0/3转发路由信息
Router(Config)# router Rip
Router(Config-router)# passive-interface eth0/3
!OSPF中,禁止端口0/3接收和转发路由信息
Router(Config)# router ospf 100