|
|
Fastethernet0/0 |
Fastethernet1/0 |
Loopback 0 |
R1 |
192.168.12.1/24 |
N/A |
N/A |
R2 |
192.168.12.2/24 |
192.168.23.2/24 |
N/A |
R3 |
192.168.23.3/24 |
N/A |
3.3.3.3/24 |
l R1、R2、R3运行RIP协议,且R3中开启环回接口。
l 当只将R3的F0/0配置成passive-interface,查看效果
l 当只将R3的环回接口配置成passive-interface,查看效果
1) 配置R1、R2、R3接口IP,并开启R3的环回接口lp 0
(config)#interface fastEthernet x/x
(config-if)#ip address x.x.x.x x.x.x.x
(config)#interface loopback 0
(config-if)#ip address x.x.x.x x.x.x.x
2) 配置R1、R2、R3的RIP协议
(config)#router rip
(config-router)#no auto-summary
(config-router)#version 2
3) 当只将R3的F0/0配置成passive-interface
(config)#router rip
(config-router)#passive-interface fastEthernet 0/0
4) 当只将R3的环回接口配置成passive-interface,与上面同样的命令实现,接口换为loopback 0。
1) 当还没配置passive-interface时,查看下R3此时是否能发送更新包和接收更新包
R3#debug ip rip events
RIP event debugging is on
R3#
*Mar 1 00:44:50.171: RIP: sending v2 ** to 224.0.0.9 via Loopback0 (3.3.3.3)
*Mar 1 00:44:50.171: RIP: ** contains 2 routes
*Mar 1 00:44:50.171: RIP: ** queued
*Mar 1 00:44:50.175: RIP: ** sent via Loopback0
*Mar 1 00:44:50.179: RIP: ignored v2 packet from 3.3.3.3 (sourced from one of our addresses)
R3#
*Mar 1 00:44:59.727: RIP: received v2 ** from 192.168.23.2 on FastEthernet0/0
*Mar 1 00:44:59.731: RIP: ** contains 1 routes
R3#
*Mar 1 00:45:04.955: RIP: sending v2 ** to 224.0.0.9 via FastEthernet0/0 (192.168.23.3)
*Mar 1 00:45:04.955: RIP: ** contains 1 routes
*Mar 1 00:45:04.955: RIP: ** queued
*Mar 1 00:45:04.959: RIP: ** sent via FastEthernet0/0
/上面显示的是此时R3 Loopback 0和fastethernet0/0能发送更新包,且R3也接收到R2更新包/
2) 查看当还没配置passive-interface时,R1能否收到R3的路由条目
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/2] via 192.168.12.2, 00:00:02, FastEthernet0/0
R 192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:02, FastEthernet0/0
/上面显示的是R1能学习到R3的路由条目/
3)R1去ping下R3的环回地址
R1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 24/45/72 ms
/上面显示R1能与R3的环回地址通信/
4)当只将R3的F0/0配置成passive-interface,查看下R3此时是否能发送更新包和接收更新包
R3#debug ip rip events
RIP event debugging is on
R3#
*Mar 1 00:45:03.235: RIP: received v2 ** from 192.168.23.2 on FastEthernet0/0
*Mar 1 00:45:03.239: RIP: ** contains 1 routes
R3#
*Mar 1 00:45:13.399: RIP: sending v2 ** to 224.0.0.9 via Loopback0 (3.3.3.3)
*Mar 1 00:45:13.399: RIP: ** contains 2 routes
*Mar 1 00:45:13.399: RIP: ** queued
*Mar 1 00:45:13.403: RIP: ** sent via Loopback0
*Mar 1 00:45:13.407: RIP: ignored v2 packet from 3.3.3.3 (sourced from one of our addresses)
/上面显示的是能接收到R2的更新包,且只有环回接口地址发送更新包,而R3的F0/0接口没有发送
更新包/
5)当只将R3的F0/0配置成passive-interface,查看R1此时能否收到R3的路由条目
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
R 192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:07, FastEthernet0/0
/上面只显示的学习到R2的192.168.23.0路由,并没有学习到R3环回地址路由。因为此时R3的F0/0
接口配置成被动接口,不会发送更新包出来,导致R3和R2无法建立邻居关系,即R2不能学习到R3
路由条目/
6)当只将R3的环回接口配置成passive-interface,查看下R3此时是否能发送更新包和接收更新包
R3#debug ip rip events
RIP event debugging is on
R3#
*Mar 1 01:06:23.467: RIP: received v2 ** from 192.168.23.2 on FastEthernet0/0
*Mar 1 01:06:23.471: RIP: ** contains 1 routes
R3#
*Mar 1 01:06:29.187: RIP: sending v2 ** to 224.0.0.9 via FastEthernet0/0 (192.168.23.3)
*Mar 1 01:06:29.187: RIP: ** contains 1 routes
*Mar 1 01:06:29.187: RIP: ** queued
*Mar 1 01:06:29.191: RIP: ** sent via FastEthernet0/0
/上面显示的能接收到R2发送的更新包,且此时R3的环回接口地址不发送更新包,只有F0/0发送更
新包/
7)当只将R3的环回接口配置成passive-interface,查看R1此时能否收到R3的路由条目
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route
Gateway of last resort is not set
C 192.168.12.0/24 is directly connected, FastEthernet0/0
3.0.0.0/24 is subnetted, 1 subnets
R 3.3.3.0 [120/2] via 192.168.12.2, 00:00:27, FastEthernet0/0
R 192.168.23.0/24 [120/1] via 192.168.12.2, 00:00:27, FastEthernet0/0
/上面显示的是R1能学习到R3的环回地址路由条目。此时说明loopback0为被动接口时,虽然不能
发送更新包出去,但路由条目还是可以发送出去的/
8)验证此时R1能否与R3的环回地址通信
R1#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 60/75/96 ms
/上面显示R1与R3能相互通信/
R1:
enable
conf t
hostname R1
!
interface FastEthernet0/0
ip address 192.168.12.1 255.255.255.0
no shutdown
exit
!
router rip
version 2
network 192.168.12.0
no auto-summary
!
end
R2:
enable
conf t
hostname R2
!
interface FastEthernet0/0
ip address 192.168.12.2 255.255.255.0
no shutdown
exit
!
interface FastEthernet1/0
ip address 192.168.23.2 255.255.255.0
no shutdown
exit
!
router rip
version 2
network 192.168.12.0
network 192.168.23.0
no auto-summary
!
end
R3:
enable
conf t
hostname R:3
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.23.3 255.255.255.0
no shutdown
exit
router rip
version 2
passive-interface Loopback0
network 3.0.0.0
network 192.168.23.0
no auto-summary
!
end
1) 在RIP中,接口设为被动接口时,可以接收更新包,但不能发送更新包。
2) 当接口设为被动接口时,此时只是不能发送更新包,但仍能发送路由条目出去。
3) 注意:passive-interface default的意思是将所有的接口都设为被动接口。
4) 当配置除了F0/0外的所有接口都为被动接口:
router rip
passive-interface default
no passive-interface fastethernet 0/0
-----------------------------------------------------------------------------------------
SPOTO 我们共创未来
您的朋友 周俊杰(Jay)
Email:zhoujj@spoto.net
新浪微博:http://weibo.com/zhoujj0130
新浪博客:http://blog.sina.com.cn/zhoujj0130
持续付出不亚于任何人的努力
-----------------------------------------------------------------------------------------
|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )
GMT+8, 2024-5-2 17:48 , Processed in 0.059125 second(s), 18 queries , Gzip On.