本文共 1808 字,大约阅读时间需要 6 分钟。
一、基本实验配置
R1 参考配置配置接口地址interface Loopback0ip address 172.16.1.1 255.255.255.0interface Loopback1ip address 172.16.2.1 255.255.255.0interface Loopback2
ip address 10.1.1.1 255.255.255.0interface FastEthernet0/0
ip address 200.1.1.1 255.255.255.0no shutdown配置RIP路由:
router ripversion 2timers basic 5 10 10 15 修改计时器network 10.0.0.0network 172.16.0.0network 200.1.1.0no auto-summaryR2参考配置
接口地址配置interface FastEthernet0/0ip address 200.1.1.2 255.255.255.0no shutdowninterface FastEthernet1/0
ip address 200.1.2.1 255.255.255.0no shutdownRIP路由配置
router ripversion 2timers basic 5 10 10 15 修改计时器network 200.1.1.0network 200.1.2.0no auto-summaryR3 参考配置
interface Loopback0ip address 192.168.1.1 255.255.255.0interface FastEthernet0/0
ip address 200.1.2.2 255.255.255.0no shutdownrouter rip
version 2timers basic 5 10 10 15network 192.168.1.0network 200.1.2.0no auto-summary配置完成后在R2上查看路由
R 172.16.1.0/24 is possibly down,routing via 200.1.1.1, FastEthernet0/0R 172.16.2.0/24 is possibly down,routing via 200.1.1.1, FastEthernet0/010.0.0.0/24 is subnetted, 1 subnetsR 10.1.1.0 [120/1] via 200.1.1.1, 00:00:01, FastEthernet0/0R 192.168.1.0/24 [120/1] via 200.1.2.2, 00:00:01, FastEthernet1/0在R2过滤掉172.16.0.0 的路由
第一步创建列表
access-list 10 deny 172.16.0.0 0.0.255.255access-list 10 permit any第二步确定方向和接口,并应用分发列表R2(config)#router rip R2(config-router)#distribute-list 10 in FastEthernet0/0 在f0/0口的in方向应用分发列表调用10号访问控制列表查看路由,172.16.0.0的路由已经消失,但10.1.1.0的路由依然可以看到,说明实验成功
C 200.1.1.0/24 is directly connected, FastEthernet0/0C 200.1.2.0/24 is directly connected, FastEthernet1/010.0.0.0/24 is subnetted, 1 subnetsR 10.1.1.0 [120/1] via 200.1.1.1, 00:00:00, FastEthernet0/0R 192.168.1.0/24 [120/1] via 200.1.2.2, 00:00:01, FastEthernet1/0转载于:https://blog.51cto.com/ronning/2325786