OSPF、EIGRP、RIP、静态路由的重分布实验

快毕业了,该复习了。今天没事无聊,开了这个博客,写点东西吧。

网路拓扑图如下:



因为是用工大瑞普模拟器做的CCNA路由版,就这么多路由器。主要是熟悉命令。

路由器配置如下(为了空间问题,显示主要的):
R1:

interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface Ethernet1/0
ip address 192.168.1.1 255.255.255.0
!
interface Ethernet1/1
no ip address
shutdown
!
interface Ethernet1/2
no ip address
shutdown
!
interface Ethernet1/3
no ip address
shutdown
!
router rip
network 1.0.0.0
network 192.168.1.0
!

R2:

interface FastEthernet0/0
ip address 192.168.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.2.1 255.255.255.0
duplex auto
speed auto
!
router ospf 1
log-adjacency-changes
redistribute rip subnets
network 192.168.2.0 0.0.0.255 area 0
!
router rip
redistribute ospf 1
network 192.168.1.0
default-metric 2
!

R3:

interface Ethernet1/0
ip address 192.168.2.2 255.255.255.0
!
interface Ethernet1/1
ip address 192.168.3.1 255.255.255.0
!
interface Ethernet1/2
no ip address
shutdown
!
interface Ethernet1/3
no ip address
shutdown
!
router eigrp 1
redistribute ospf 1
network 192.168.3.0
default-metric 1000 10 1 255 1500
no eigrp log-neighbor-changes
!
router ospf 1
log-adjacency-changes
redistribute eigrp 1 subnets
network 192.168.2.0 0.0.0.255 area 0
!

R4:

interface Ethernet1/0
ip address 192.168.3.2 255.255.255.0
!
interface Ethernet1/1
ip address 192.168.4.1 255.255.255.0
!
interface Ethernet1/2
no ip address
shutdown
!
interface Ethernet1/3
no ip address
shutdown
!
router eigrp 1
redistribute static
network 192.168.3.0
network 192.168.4.0
default-metric 1000 10 1 255 1500
no eigrp log-neighbor-changes
!
ip classless
ip route 2.2.2.0 255.255.255.0 192.168.4.2
no ip http server
!

R5:

interface Loopback0
ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
ip address 192.168.4.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
ip classless
ip route 1.1.1.0 255.255.255.0 192.168.4.1
ip route 192.168.1.0 255.255.255.0 192.168.4.1
ip route 192.168.2.0 255.255.255.0 192.168.4.1
ip route 192.168.3.0 255.255.255.0 192.168.4.1
no ip http server
!

路由表情况。

R1:
R1#SH 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
R    2.0.0.0/8 [120/2] via 192.168.1.2, 00:00:15, Ethernet1/0
R    192.168.4.0/24 [120/2] via 192.168.1.2, 00:00:15, Ethernet1/0
C    192.168.1.0/24 is directly connected, Ethernet1/0
R    192.168.2.0/24 [120/2] via 192.168.1.2, 00:00:15, Ethernet1/0
R    192.168.3.0/24 [120/2] via 192.168.1.2, 00:00:15, Ethernet1/0

R2:

R2#sh 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

R    1.0.0.0/8 [120/1] via 192.168.1.1, 00:00:15, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
O E2    2.2.2.0 [110/20] via 192.168.2.2, 00:22:20, FastEthernet0/1
O E2 192.168.4.0/24 [110/20] via 192.168.2.2, 00:22:20, FastEthernet0/1
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
O E2 192.168.3.0/24 [110/20] via 192.168.2.2, 00:22:20, FastEthernet0/1

R3:


R3#SH 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

O E2 1.0.0.0/8 [110/20] via 192.168.2.1, 00:21:47, Ethernet1/0
2.0.0.0/24 is subnetted, 1 subnets
D EX    2.2.2.0 [170/2588160] via 192.168.3.2, 00:32:31, Ethernet1/1
D    192.168.4.0/24 [90/307200] via 192.168.3.2, 00:32:31, Ethernet1/1
O E2 192.168.1.0/24 [110/20] via 192.168.2.1, 00:21:47, Ethernet1/0
C    192.168.2.0/24 is directly connected, Ethernet1/0
C    192.168.3.0/24 is directly connected, Ethernet1/1


R4:

R4#SH 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

D EX 1.0.0.0/8 [170/2588160] via 192.168.3.1, 00:17:03, Ethernet1/0
2.0.0.0/24 is subnetted, 1 subnets
S       2.2.2.0 [1/0] via 192.168.4.2
C    192.168.4.0/24 is directly connected, Ethernet1/1
D EX 192.168.1.0/24 [170/2588160] via 192.168.3.1, 00:17:03, Ethernet1/0
D EX 192.168.2.0/24 [170/2588160] via 192.168.3.1, 00:17:03, Ethernet1/0
C    192.168.3.0/24 is directly connected, Ethernet1/0


R5:

R5#SH 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
S       1.1.1.0 [1/0] via 192.168.4.1
2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Lo
opback0
C    192.168.4.0/24 is directly connected, FastEthernet0/0
S    192.168.1.0/24 [1/0] via 192.168.4.1
S    192.168.2.0/24 [1/0] via 192.168.4.1
S    192.168.3.0/24 [1/0] via 192.168.4.1




测试结果:


R1#ping 2.2.2.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/36/64 ms
R1#ping 192.168.2.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/20/32 ms
R1#ping 192.168.3.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/32/60 ms
R1#ping 192.168.4.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/38/64 ms

成功!!!!