雏鹰部落

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1383|回复: 2

[讨论/求助] 调整路由的AD值

[复制链接]
发表于 2013-11-18 11:43:55 | 显示全部楼层 |阅读模式
实验:调整路由的AD值
【实验名称】调整路由的AD(备注:此实验环境最好用GNS3或者小凡来做,PT不支持“distance 99 192.168.1.2 0.0.0.0”这条命令)
【实验目的】通过调整路由的管理距离值,实现路由的管理和控制
【实验背景】
某企业的3台路由器(RARBRC)运行了RIP路由协议,RA分别与RBRC连接
【需求分析】
通过配置RA的管理距离,使RA只能学到RB的通告路由,并忽略所有路由器的路由,且从RB学到路由的管理距离为99.
【实验拓扑】
【实验设备】路由器3
【预备知识】路由器基本配置知识、IP路由知识、RIP
【实验原理】修改管理距离来过滤和控制路由
【实验步骤】
步骤1:在路由器上配置IP路由选择和IP地址
Router>enable
Router#conf t
Enter configuration commands, one perline.  End with CNTL/Z.
Router(config)#no ip domain lookup
Router(config)#hostname RzA
RzA(config)#int fa0/0
RzA(config-if)#ip address 192.168.1.1255.255.255.0
RzA(config-if)#no shut
RzA(config-if)#exit
RzA(config)#int fa0/1
RzA(config-if)#ip address 192.168.2.1255.255.255.0
RzA(config-if)#no shut
RzA(config-if)#exit
RzA(config)#int lo0
RzA(config-if)#ip address 10.1.1.1255.255.255.0
RzA(config-if)#no shut
RzA(config-if)#
Router>enable
Router#conf t
Enter configuration commands, one perline.  End with CNTL/Z.
Router(config)#no ip domain lookup
Router(config)#hostname RzB
RzB(config)#int fa0/0
RzB(config-if)#ip address 192.168.1.2255.255.255.0
RzB(config-if)#no shut
RzB(config-if)#exit
RzB(config)#int lo0
RzB(config-if)#ip address 192.168.10.1255.255.255.0
RzB(config-if)#no shut
RzB(config-if)#
Router>enable
Router#conf t
Enter configuration commands, one perline.  End with CNTL/Z.
Router(config)#no ip domain lookup
Router(config)#hostname RzC
RzC(config)#int fa0/0
RzC(config-if)#ip address 192.168.2.2255.255.255.0
RzC(config-if)#no shut
RzC(config-if)#exit
RzC(config)#int lo0
RzC(config-if)#ip address 192.168.20.1255.255.255.0
RzC(config-if)#no shut
RzC(config-if)#
步骤2:配置RIP协议
RzA(config-if)#exit
RzA(config)#router rip
RzA(config-router)#version 2
RzA(config-router)#network 192.168.1.0
RzA(config-router)#network 192.168.2.0
RzA(config-router)#network 10.1.1.0
RzA(config-router)#no auto-summary
RzA(config-router)#end
RzA#write
Building configuration...
[OK]
RzA#
RzB(config-if)#exit
RzB(config)#router rip
RzB(config-router)#version 2
RzB(config-router)#network 192.168.1.0
RzB(config-router)#network 192.168.10.0
RzB(config-router)#no auto-summary
RzB(config-router)#end
RzB#write
Building configuration...
[OK]
RzB#
RzC(config-if)#exit
RzC(config)#router rip
RzC(config-router)#version 2
RzC(config-router)#network 192.168.2.0
RzC(config-router)#network 192.168.20.0
RzC(config-router)#no auto-summary
RzC(config-router)#end
%SYS-5-CONFIG_I: Configured from console byconsole
RzC#write
Building configuration...
[OK]
RzC#
步骤3:修改管理距离
RzA(config)#router rip
RzA(config-router)#distance 255
RzA(config-router)#distance 99 192.168.1.20.0.0.0
步骤4:验证测试
在路由器A上用命令show ip route show ip route rip来验证配置
RzA#show ip route
Codes: C - connected, S - static, I - IGRP,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, E - EGP
      i - IS-IS, 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
    10.0.0.0/24 is subnetted, 1 subnets
C      10.1.1.0 is directly connected, Loopback0
C   192.168.1.0/24 is directly connected, FastEthernet0/0
C   192.168.2.0/24 is directly connected, FastEthernet0/1
R   192.168.10.0/24 [99/1] via 192.168.1.2, 00:00:14, FastEthernet0/0
R   192.168.20.0/24 [99/1] via 192.168.2.2, 00:00:13, FastEthernet0/1
RzA#
RzA#ping 192.168.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5),round-trip min/avg/max = 31/31/32 ms
RzA#
RzB#ping 10.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.1.1.1,timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5),round-trip min/avg/max = 15/28/32 ms
RzB#
RzC>ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5),round-trip min/avg/max = 62/62/63 ms
RzC>
参考配置:
RzA#show running-config
Building configuration...
Current configuration : 664 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname RzA
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain-lookup
!
!
!
!
!
!
interface Loopback0
ipaddress 10.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ipaddress 192.168.1.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ipaddress 192.168.2.1 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
noip address
shutdown
!
router rip
version 2
network 10.0.0.0
network 192.168.1.0
network 192.168.2.0
distance 255
distance 99 192.168.1.2 0.0.0.0
noauto-summary
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
RzA#
RzB#show running-config
Building configuration...
Current configuration : 625 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname RzB
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain-lookup
!
!
!
!
!
!
interface Loopback0
ipaddress 192.168.10.1 255.255.255.0
!
interface FastEthernet0/0
ipaddress 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
noip address
duplex auto
speed auto
shutdown
!
interface Vlan1
noip address
shutdown
!
router rip
version 2
network 192.168.1.0
network 192.168.10.0
no auto-summary
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
RzB#
RzC#show running-config
Building configuration...
Current configuration : 625 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname RzC
!
!
!
!
!
!
!
!
!
!
!
!
no ip domain-lookup
!
!
!
!
!
!
interface Loopback0
ipaddress 192.168.20.1 255.255.255.0
!
interface FastEthernet0/0
ipaddress 192.168.2.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
noip address
duplex auto
speed auto
shutdown
!
interface Vlan1
noip address
shutdown
!
router rip
version 2
network 192.168.2.0
network 192.168.20.0
noauto-summary
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
RzC#
【实验总结】
通过本节课的学习,通过调整路由的管理距离,实现路由的过滤和控制。


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
发表于 2013-11-19 13:02:05 | 显示全部楼层
回复

使用道具 举报

发表于 2014-5-23 15:45:47 | 显示全部楼层
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|熊猫同学技术论坛|小黑屋| 网络工程师论坛 ( 沪ICP备09076391 )

GMT+8, 2024-4-19 15:35 , Processed in 0.080143 second(s), 20 queries , Gzip On.

快速回复 返回顶部 返回列表