环境:两台2500系列路由器,由串口相连。
要求:在RIPv1和EIGRP中将两个相同主类网络的不同子网由另一个主类网络分割,如何能学到对端网络。
RIP配置:
步骤一、基本配置
Router>
Router>enable
Router#config terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#line console 0
R1(config-line)#logging synchronous
R1(config-line)#exec-timeout 0 0
R1(config-line)#exit
步骤二、接口配置
R1的配置:
R1(config)#interface s0
R1(config-if)#ip address 172.16.1.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config-if)#interface loopback 0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#
R2的配置:
R2(config)#interface s1
R2(config-if)#ip add 172.16.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#interface loopback 0
R2(config-if)#ip address 10.1.2.1 255.255.255.0
R2(config-if)#exit
R2(config)#
步骤三、启用RIP路由选择协议
R1的配置:
R1(config)#router rip à启用RIP
R1(config-router)#network 10.0.0.0 à发布直连网段
R1(config-router)#network 172.16.0.0
R1(config-router)#exit
R1(config)#
R2的配置:
R2(config)#router rip à启用RIP
R2(config-router)#network 10.0.0.0 à发布直连网段
R2(config-router)#network 172.16.0.0
R2(config-router)#exit
R2(config)#end
显示路由信息
R1#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
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial0 à没有学习到任何路由条目
10.0.0.0/24 is subnetted, 4 subnets
C 10.1.3.0 is directly connected, Serial0
C 10.1.1.0 is directly connected, Loopback0
步骤四、配置辅助IP
R1(config)#interface s0
R1(config-if)#ip address 10.1.3.1 255.255.255.0 secondaryà配置辅助IP
R2(config)#interface s1
R2(config-if)#ip address 10.1.3.2 255.255.255.0 secondaryà配置辅助IP
步骤四、显示路由信息
R1#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
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial0
10.0.0.0/24 is subnetted, 4 subnets
C 10.1.3.0 is directly connected, Serial0
R 10.1.2.0 [120/1] via 10.1.3.2, 00:00:14, Serial0 à已经学习到了路由
R 10.0.0.0 [120/1] via 172.16.1.2, 00:00:14, Serial0
C 10.1.1.0 is directly connected, Loopback0
步骤五、显示当前配置信息
R1的当前配置:
R1#show running-config
hostname R1
!
no ip domain-lookup
!
interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface Serial0
ip address 10.1.3.1 255.255.255.0 secondary
ip address 172.16.1.1 255.255.255.0
clockrate 64000
!
router rip
network 10.0.0.0
network 172.16.0.0
!
End
R2的当前配置:
R2#show running-config
!
hostname R2
no ip domain-lookup
!
interface Loopback0
ip address 10.1.2.1 255.255.255.0
!
interface Serial1
ip address 10.1.3.2 255.255.255.0 secondary
ip address 172.16.1.2 255.255.255.0
!
router rip
network 10.0.0.0
network 172.16.0.0
!
End
步骤八、启用EIGRP
R1的配置:
R1(config)#no router rip à关闭IGRP
R1(config)#router eigrp 100 à启用EIGRP
R1(config-router)#network 10.1.1.0 0.0.0.255
R1(config-router)#network 172.16.1.0 0.0.0.255
R1(config-router)#no auto-summary
R2的配置:
R2(config)#no router rip
R2(config)#router eigrp 100
R2(config-router)#network 10.1.2.0 0.0.0.255
R2(config-router)#network 172.16.1.0 0.0.0.255
R2(config-router)#no auto-summary
测试:
R1#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
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial0
10.0.0.0/24 is subnetted, 2 subnets
D 10.1.2.0 [90/2297856] via 172.16.1.2, 00:00:20, Serial0
C 10.1.1.0 is directly connected, Loopback0
R2#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
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, Serial1
10.0.0.0/24 is subnetted, 2 subnets
C 10.1.2.0 is directly connected, Loopback0
D 10.1.1.0 [90/2297856] via 172.16.1.1, 00:03:45, Serial1
步骤九、显示当前配置
R1的配置:
R1#show running-config
hostname R1
no ip domain-lookup
!
interface Loopback0
ip address 10.1.1.1 255.255.255.0
!
interface Serial0
ip address 10.1.3.1 255.255.255.0 secondary
ip address 172.16.1.1 255.255.255.0
clockrate 64000
!
router eigrp 100
network 10.1.1.0 0.0.0.255
network 172.16.1.0 0.0.0.255
no auto-summary
!
end
R2的配置:
R2#show running-config
hostname R2
no ip domain-lookup
!
interface Loopback0
ip address 10.1.2.1 255.255.255.0
!
interface Serial1
ip address 10.1.3.2 255.255.255.0 secondary
ip address 172.16.1.2 255.255.255.0
!
router eigrp 100
network 10.1.2.0 0.0.0.255
network 172.16.1.0 0.0.0.255
no auto-summary
!
end