加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

【CCNA】RIP的被动接口配置案例

(2012-12-12 00:04:12)
标签:

杂谈

CCNARIP的被动接口配置案例 

1     案例配置拓扑

                http://s12/mw690/91681a34gd095e9c55dcb&690

 

 

2     IP地址规划

 

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

3     案例配置需求

l  R1R2R3运行RIP协议,且R3中开启环回接口。

l  当只将R3F0/0配置成passive-interface,查看效果

l  当只将R3的环回接口配置成passive-interface,查看效果

4     案例配置思路

1) 配置R1R2R3接口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) 配置R1R2R3RIP协议

(config)#router rip

(config-router)#no auto-summary

(config-router)#version 2

3)当只将R3F0/0配置成passive-interface

(config)#router rip

(config-router)#passive-interface fastEthernet 0/0

    4)当只将R3的环回接口配置成passive-interface,与上面同样的命令实现,接口换为loopback 0

5     案例检验结果

1) 当还没配置passive-interface时,查看下R3此时是否能发送更新包和接收更新包

R3#debug ip rip events

RIP event debugging is on

R3#

*Mar  1 00:44:50.171: RIP: sending v2 update to 224.0.0.9 via Loopback0 (3.3.3.3)

*Mar  1 00:44:50.171: RIP: Update contains 2 routes

*Mar  1 00:44:50.171: RIP: Update queued

*Mar  1 00:44:50.175: RIP: Update 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 update from 192.168.23.2 on FastEthernet0/0

*Mar  1 00:44:59.731: RIP: Update contains 1 routes

R3#

*Mar  1 00:45:04.955: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (192.168.23.3)

*Mar  1 00:45:04.955: RIP: Update contains 1 routes

*Mar  1 00:45:04.955: RIP: Update queued

*Mar  1 00:45:04.959: RIP: Update sent via FastEthernet0/0

上面显示的是此时R3Loopback 0fastethernet0/0能发送更新包,且R3也接收到R2更新包。

2) 查看当还没配置passive-interface时,R1能否收到R3的路由条目

R1#sh 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的路由条目。

 3R1pingR3的环回地址

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)当只将R3F0/0配置成passive-interface,查看下R3此时是否能发送更新包和接收更新包

R3#debug ip rip events

RIP event debugging is on

R3#

*Mar  1 00:45:03.235: RIP: received v2 update from 192.168.23.2 on FastEthernet0/0

*Mar  1 00:45:03.239: RIP: Update contains 1 routes

R3#

*Mar  1 00:45:13.399: RIP: sending v2 update to 224.0.0.9 via Loopback0 (3.3.3.3)

*Mar  1 00:45:13.399: RIP: Update contains 2 routes

*Mar  1 00:45:13.399: RIP: Update queued

*Mar  1 00:45:13.403: RIP: Update 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的更新包,且只有环回接口地址发送更新包,而R3F0/0接口没有发送

更新包了。

 

 5)当只将R3F0/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

上面只显示的学习到R2192.168.23.0路由,并没有学习到R3环回地址路由。因为此时R3F0/0

接口配置成被动接口,不会发送更新包出来,导致R3R2无法建立邻居关系,即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 update from 192.168.23.2 on FastEthernet0/0

*Mar  1 01:06:23.471: RIP: Update contains 1 routes

R3#

*Mar  1 01:06:29.187: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (192.168.23.3)

*Mar  1 01:06:29.187: RIP: Update contains 1 routes

*Mar  1 01:06:29.187: RIP: Update queued

*Mar  1 01:06:29.191: RIP: Update 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

    上面显示R1R3能相互通信。

6    案例配置文件

R1:


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:


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:


hostname R3
!
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

7 案例总结及其他

1) 在RIP中,接口设为被动接口时,可以接收更新包,但不能发送更新包。

2) 当接口设为被动接口时,此时只是不能发送更新包,但仍能发送路由条目出去。

3) 注意:passive-interface default的意思是将所有的接口都设为被动接口。

4) 当配置除了F0/0外的所有接口都为被动接口:

router rip

passive-interface default

no passive-interface fastethernet 0/0

 

 

新浪微博:http://weibo.com/zhoujj0130
新浪博客:http://blog.sina.com.cn/zhoujj0130

网 站: http://www.SPOTO.net

雏鹰部落:http://bbs.SPOTO.net

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有