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

标签:
杂谈 |
【CCNA】RIP的被动接口配置案例
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
l
l
4
案例配置思路
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
5
案例检验结果
1) 当还没配置passive-interface时,查看下R3此时是否能发送更新包和接收更新包
R3#debug ip rip events
RIP event debugging is on
R3#
*Mar
*Mar
*Mar
*Mar
*Mar
R3#
*Mar
*Mar
R3#
*Mar
*Mar
*Mar
*Mar
上面显示的是此时R3的Loopback 0和fastethernet0/0能发送更新包,且R3也接收到R2更新包。
2) 查看当还没配置passive-interface时,R1能否收到R3的路由条目
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
Gateway of last resort is not set
C
R
R
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的环回地址通信。
R3#debug ip rip events
RIP event debugging is on
R3#
*Mar
*Mar
R3#
*Mar
*Mar
*Mar
*Mar
*Mar
上面显示的是能接收到R2的更新包,且只有环回接口地址发送更新包,而R3的F0/0接口没有发送
更新包了。
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
Gateway of last resort is not set
C
R
上面只显示的学习到R2的192.168.23.0路由,并没有学习到R3环回地址路由。因为此时R3的F0/0
接口配置成被动接口,不会发送更新包出来,导致R3和R2无法建立邻居关系,即R2不能学习到R3
路由条目。
R3#debug ip rip events
RIP event debugging is on
R3#
*Mar
*Mar
R3#
*Mar
*Mar
*Mar
*Mar
上面显示的能接收到R2发送的更新包,且此时R3的环回接口地址不发送更新包,只有F0/0发送更
新包。
R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
Gateway of last resort is not set
C
R
R
上面显示的是R1能学习到R3的环回地址路由条目。此时说明loopback0为被动接口时,虽然不能
发送更新包出去,但路由条目还是可以发送出去的。
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
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:
!
router rip
!
end
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:
!
interface FastEthernet1/0
!
router rip
!
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
!
interface FastEthernet0/0
!
router rip
!
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