1、拓扑
2、配置清单
R1#show run
Building configuration...
Current configuration : 590 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R1
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface FastEthernet0/0
ip address 12.12.12.1 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
router rip
version 2
network 1.0.0.0
network 12.0.0.0
no auto-summary
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
R1#
---------------------------------------------------
R2#show run
Building configuration...
Current configuration : 755 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R2
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
ip address 12.12.12.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 23.23.23.2 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
router ospf 10
log-adjacency-changes
redistribute rip subnets
network 2.2.2.0 0.0.0.255 area 0
network 23.23.23.0 0.0.0.255 area 0
!
router rip
version 2
redistribute ospf 10 metric 8
network 12.0.0.0
no auto-summary
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
R2#
-----------------------------------------------------------------------
R3#show run
Building configuration...
Current configuration : 771 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R3
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
ip address 34.34.34.3 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 23.23.23.3 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
router eigrp 10
redistribute ospf 10 metric 24 24 24 24 1500
network 3.3.3.0 0.0.0.255
network 34.34.34.0 0.0.0.255
auto-summary
!
router ospf 10
log-adjacency-changes
redistribute eigrp 10 subnets
network 23.23.23.0 0.0.0.255 area 0
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
R3#
--------------------------------------------------------------------------------
R4#show run
Building configuration...
Current configuration : 603 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R4
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface FastEthernet0/0
ip address 34.34.34.4 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
router eigrp 10
network 34.34.34.0 0.0.0.255
network 4.4.4.0 0.0.0.255
auto-summary
!
ip classless
!
!
!
!
!
!
!
line con 0
line vty 0 4
login
!
!
!
end
R4#
3、实验结果
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
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/8] via 12.12.12.2, 00:09:39, FastEthernet0/0
3.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R 3.0.0.0/8 [120/8] via 12.12.12.2, 00:09:39, FastEthernet0/0
R 3.3.3.0/24 [120/8] via 12.12.12.2, 00:09:39, FastEthernet0/0
R 4.0.0.0/8 [120/8] via 12.12.12.2, 00:09:39, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
R 23.23.23.0 [120/8] via 12.12.12.2, 00:09:39, FastEthernet0/0
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
R 34.0.0.0/8 [120/8] via 12.12.12.2, 00:09:39, FastEthernet0/0
R 34.34.34.0/24 [120/8] via 12.12.12.2, 00:09:39, FastEthernet0/0
R1#
-----------------------------------------------------------
R4#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
1.0.0.0/24 is subnetted, 1 subnets
D EX 1.1.1.0 [170/106675200] via 34.34.34.3, 00:19:49, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
D EX 2.2.2.2 [170/106675200] via 34.34.34.3, 00:19:49, FastEthernet0/0
D 3.0.0.0/8 [90/156160] via 34.34.34.3, 00:20:39, FastEthernet0/0
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 4.0.0.0/8 is a summary, 00:20:40, Null0
C 4.4.4.0/24 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
D EX 12.12.12.0 [170/106675200] via 34.34.34.3, 00:19:49, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
D EX 23.23.23.0 [170/106675200] via 34.34.34.3, 00:20:39, FastEthernet0/0
34.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D 34.0.0.0/8 is a summary, 00:20:40, Null0
C 34.34.34.0/24 is directly connected, FastEthernet0/0
R4#
本文出自 “ hongguang” 博客,请务必保留此出处 http://hongguang.blog.51cto.com/363382/449942