CCNP Day7 EIGRP综合实验

1、网络拓扑

 2、基础IP配置

R1:
enable
config t
no ip domain lookup
line console 0
no exec-timeout
logging synchronous
exit


interface f0/0
no shutdown
ip add 1.1.123.1 255.255.255.224
exit

interface loopback 0
ip add 10.10.1.1 255.255.255.0
no shutdown
exit
end


R2:
enable
config t
no ip domain lookup
line console 0
no exec-timeout
logging synchronous
exit


interface f0/0
no shutdown
ip add 1.1.123.2 255.255.255.224
exit

interface s1/0
no shutdown
ip add 1.1.24.1 255.255.255.248
exit

interface loopback 0
ip add 10.10.2.2 255.255.255.0
no shutdown
exit
end


R3:
enable
config t
no ip domain lookup
line console 0
no exec-timeout
logging synchronous
exit


interface f0/0
no shutdown
ip add 1.1.123.3 255.255.255.224
exit


interface s1/1
no shutdown
ip add 1.1.34.2 255.255.255.248
exit

interface loopback 0
ip add 10.10.3.3 255.255.255.0
no shutdown
exit
end

R4 :
enable
config t
no ip domain lookup
line console 0
no exec-timeout
logging synchronous
exit


interface s1/0
no shutdown
ip add 1.1.24.2 255.255.255.248
exit

interface s1/1
no shutdown
ip add 1.1.34.2 255.255.255.248
exit

interface s1/2
no shutdown
ip add 1.1.45.2 255.255.255.0
exit

interface loopback 0
no shut
ip address 10.10.4.4 255.255.255.0
end


R5 :
enable
config t
no ip domain lookup
line console 0
no exec-timeout
logging synchronous
exit

interface s1/2
no shutdown
ip add 1.1.45.1 255.255.255.0
exit

interface loopback 0
no shut
ip add 10.10.5.5 255.255.255.0
end

 3、在R4与R5之间配置PPP封装

R5#show interfaces s1/2
Serial1/2 is up, line protocol is up 
  Hardware is M4T
  Internet address is 1.1.45.2/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, 
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, crc 16, loopback not set                     /××××思科交换机端口之间默认封装格式是HDLC*****/
  Keepalive set (10 sec)
  Restart-Delay is 0 secs
  Last input 00:00:08, output 00:00:07, output hang never
  Last clearing of "show interface" counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: weighted fair
  Output queue: 0/1000/64/0 (size/max total/threshold/drops) 
     Conversations  0/1/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     69 packets input, 5292 bytes, 0 no buffer
     Received 69 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     79 packets output, 6371 bytes, 0 underruns
     0 output errors, 0 collisions, 3 interface resets

R4

R4(config)#interface s1/2
R4(config-if)#encapsulation ppp
R4(config-if)#exit
R4(config)#
*Nov 29 08:19:08.775: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to down          /*****当两侧封装格式不一致时,端口Down***/
R4(config)#

R5

R5#config t
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)#interface s1/2
R5(config-if)#encapsulation ppp
R5(config-if)#
R5(config-if)#
R5(config-if)#
*Nov 29 08:21:32.191: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/2, changed state to up  /*****当两侧封装格式一致时,端口再次UP***/
R5(config-if)#

R4

R4#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 4 subnets, 3 masks
C 1.1.24.0/29 is directly connected, Serial1/0
C 1.1.34.0/29 is directly connected, Serial1/1
C 1.1.45.1/32 is directly connected, Serial1/2
C 1.1.45.0/24 is directly connected, Serial1/2
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.4.0 is directly connected, Loopback0
R4#

R5 

R5#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 2 subnets, 2 masks
C 1.1.45.0/24 is directly connected, Serial1/2
C 1.1.45.2/32 is directly connected, Serial1/2
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.5.0 is directly connected, Loopback0
R5#

测试结果: /**点到点的封装,会在路由表中生成一个/32位的路由,确保点到点的通讯可达,即使不再一个网段的地址也可以通讯**/
但在这个测试环境中,我们点到点的在一个网络,不需要/32位的路由,可以把/32位路由删除,删除方法如下:

R4# config t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#int
R4(config)#interface s1/2

R4(config-if)#no peer neighbor-route

R4(config-if)#end
R4#
R4#clear ip route *
R4#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 3 subnets, 2 masks
C 1.1.24.0/29 is directly connected, Serial1/0
C 1.1.34.0/29 is directly connected, Serial1/1
C 1.1.45.0/24 is directly connected, Serial1/2
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.4.0 is directly connected, Loopback0
R4#

R5#config t

.
R5(config)#int
R5(config)#interface s1/2
R5(config-if)#no peer neighbor-route
R5(config-if)#end
R5#clear ip route *
R5#
R5#
R5#
R5#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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.45.0 is directly connected, Serial1/2
10.0.0.0/24 is subnetted, 1 subnets
C 10.10.5.0 is directly connected, Loopback0
R5#

 3、R1、R2、R3上配置RIP路由

2、把R1、R2、R3配置RIPV2协议,并把以太及Loopback口宣告到RIP协议中(RIP路由只支持主类宣告)
R1
config t
router rip
no auto-summary
version 2
network 10.0.0.0
network 1.0.0.0

R2
config t
router rip
no auto-summary
version 2
network 10.0.0.0
network 1.0.0.0

R3
config t
router rip
no auto-summary
version 2
network 10.0.0.0
network 1.0.0.0

 4、R1添加8个地址,这8个地址作为外部路由地址

R1(config)#interface loopback 0
R1(config-if)#ip address 100.1.1.1 255.255.255.0 secondary 
R1(config-if)#ip address 100.1.2.1 255.255.255.0 secondary 
R1(config-if)#ip address 100.1.3.1 255.255.255.0 secondary 
R1(config-if)#ip address 100.1.4.1 255.255.255.0 secondary 
R1(config-if)#ip address 100.1.5.1 255.255.255.0 secondary 
R1(config-if)#ip address 100.1.6.1 255.255.255.0 secondary 
R1(config-if)#ip address 100.1.7.1 255.255.255.0 secondary 
R1(config-if)#ip address 100.1.8.1 255.255.255.0 secondary 
R1(config-if)#

R1#show run interface loopback 0
Building configuration...


Current configuration : 431 bytes
!
interface Loopback0
ip address 100.1.1.1 255.255.255.0 secondary
ip address 100.1.2.1 255.255.255.0 secondary
ip address 100.1.3.1 255.255.255.0 secondary
ip address 100.1.4.1 255.255.255.0 secondary
ip address 100.1.5.1 255.255.255.0 secondary
ip address 100.1.6.1 255.255.255.0 secondary
ip address 100.1.7.1 255.255.255.0 secondary
ip address 100.1.8.1 255.255.255.0 secondary
ip address 10.10.1.1 255.255.255.0
end


R1#

 

把外部路由重分布到RIP中

R1#config t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#redistribute connected
R1(config-router)#

R1#show ip rip data
R1#show ip rip database
1.0.0.0/8 auto-summary
1.1.24.0/29
[1] via 1.1.123.2, 00:00:07, FastEthernet0/0
1.1.34.0/29
[1] via 1.1.123.3, 00:00:02, FastEthernet0/0
1.1.123.0/27 directly connected, FastEthernet0/0
10.0.0.0/8 auto-summary
10.10.1.0/24 directly connected, Loopback0
10.10.2.0/24
[1] via 1.1.123.2, 00:00:07, FastEthernet0/0
10.10.3.0/24
[1] via 1.1.123.3, 00:00:02, FastEthernet0/0
100.0.0.0/8 auto-summary
100.1.1.0/24 redistributed
[1] via 0.0.0.0,
100.1.2.0/24 redistributed
[1] via 0.0.0.0,
100.1.3.0/24 redistributed
[1] via 0.0.0.0,
100.1.4.0/24 redistributed
[1] via 0.0.0.0,
100.1.5.0/24 redistributed
[1] via 0.0.0.0,
100.1.6.0/24 redistributed
[1] via 0.0.0.0,
100.1.7.0/24 redistributed
[1] via 0.0.0.0,
100.1.8.0/24 redistributed
[1] via 0.0.0.0,
R1#

要求在R2和R3中不要同步100.1.8.0的路由,这里要使用路由分发列表,在R1上阻止100.1.8.0这个网段进行分发:

R1上配置路由分发列表

config t
access-list 1 deny 100.1.8.0
access-list 1 permit any
router rip
version 2
distribute-list 1 out f0/0
end

R3#
R3#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 3 subnets, 2 masks
R 1.1.24.0/29 [120/1] via 1.1.123.2, 00:00:03, FastEthernet0/0
C 1.1.34.0/29 is directly connected, Serial1/1
C 1.1.123.0/27 is directly connected, FastEthernet0/0
100.0.0.0/24 is subnetted, 7 subnets
R 100.1.5.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.4.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.7.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.6.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.1.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.3.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.2.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
10.0.0.0/24 is subnetted, 3 subnets
R 10.10.1.0 [120/1] via 1.1.123.1, 00:00:05, FastEthernet0/0
R 10.10.2.0 [120/1] via 1.1.123.2, 00:00:05, FastEthernet0/0
C 10.10.3.0 is directly connected, Loopback0
R3#

R2#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 3 subnets, 2 masks
C 1.1.24.0/29 is directly connected, Serial1/0
R 1.1.34.0/29 [120/1] via 1.1.123.3, 00:00:03, FastEthernet0/0
C 1.1.123.0/27 is directly connected, FastEthernet0/0
100.0.0.0/24 is subnetted, 7 subnets
R 100.1.5.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.4.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.7.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.6.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.1.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.3.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.2.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
10.0.0.0/24 is subnetted, 3 subnets
R 10.10.1.0 [120/1] via 1.1.123.1, 00:00:04, FastEthernet0/0
C 10.10.2.0 is directly connected, Loopback0
R 10.10.3.0 [120/1] via 1.1.123.3, 00:00:04, FastEthernet0/0
R2#

 对R1设置策略,保证路由信息同步到R2、R3时,奇数路的Metric值为5:偶数路由Metric值为7

R1
config t
router rip
version 2
no redistribute connected 
end


config t
access-list 2 permit 100.1.1.0 0.0.6.0
access-list 3 permit 100.1.0.0 0.0.6.0
end

config t
route-map A permit 10
match ip address 2
set metric 5
end

config t
route-map A permit 20
match ip address 3
set metric 7
end

config t
router rip
version 2
redistribute connected route-map A
end


R3#show ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 3 subnets, 2 masks
R       1.1.24.0/29 [120/1] via 1.1.123.2, 00:00:03, FastEthernet0/0
C       1.1.34.0/29 is directly connected, Serial1/1
C       1.1.123.0/27 is directly connected, FastEthernet0/0
     100.0.0.0/24 is subnetted, 7 subnets
R       100.1.5.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.4.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.7.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.6.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.1.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.3.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.2.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
     10.0.0.0/24 is subnetted, 3 subnets
R       10.10.1.0 [120/1] via 1.1.123.1, 00:00:05, FastEthernet0/0
R       10.10.2.0 [120/1] via 1.1.123.2, 00:00:05, FastEthernet0/0
C       10.10.3.0 is directly connected, Loopback0
R3#
R3#clear ip route *
R3#
R3#show ip route
Codes: C - connected, S - static, 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
       i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 3 subnets, 2 masks
R       1.1.24.0/29 [120/1] via 1.1.123.2, 00:00:03, FastEthernet0/0
C       1.1.34.0/29 is directly connected, Serial1/1
C       1.1.123.0/27 is directly connected, FastEthernet0/0
     100.0.0.0/24 is subnetted, 7 subnets
R       100.1.5.0 [120/5] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.4.0 [120/7] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.7.0 [120/5] via 1.1.123.1, 00:00:03, FastEthernet0/0
R       100.1.6.0 [120/7] via 1.1.123.1, 00:00:00, FastEthernet0/0
R       100.1.1.0 [120/5] via 1.1.123.1, 00:00:00, FastEthernet0/0
R       100.1.3.0 [120/5] via 1.1.123.1, 00:00:00, FastEthernet0/0
R       100.1.2.0 [120/7] via 1.1.123.1, 00:00:00, FastEthernet0/0
     10.0.0.0/24 is subnetted, 3 subnets
R       10.10.1.0 [120/1] via 1.1.123.1, 00:00:01, FastEthernet0/0
R       10.10.2.0 [120/1] via 1.1.123.2, 00:00:06, FastEthernet0/0
C       10.10.3.0 is directly connected, Loopback0
R3#

R2#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 3 subnets, 2 masks
C 1.1.24.0/29 is directly connected, Serial1/0
R 1.1.34.0/29 [120/1] via 1.1.123.3, 00:00:03, FastEthernet0/0
C 1.1.123.0/27 is directly connected, FastEthernet0/0
100.0.0.0/24 is subnetted, 7 subnets
R 100.1.5.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.4.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.7.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.6.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.1.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.3.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
R 100.1.2.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
10.0.0.0/24 is subnetted, 3 subnets
R 10.10.1.0 [120/1] via 1.1.123.1, 00:00:04, FastEthernet0/0
C 10.10.2.0 is directly connected, Loopback0
R 10.10.3.0 [120/1] via 1.1.123.3, 00:00:04, FastEthernet0/0
R2#
R2#clear ip route *
R2#show ip route
Codes: C - connected, S - static, 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
i - IS-IS, su - IS-IS summary, 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/8 is variably subnetted, 3 subnets, 2 masks
C 1.1.24.0/29 is directly connected, Serial1/0
R 1.1.34.0/29 [120/1] via 1.1.123.3, 00:00:02, FastEthernet0/0
C 1.1.123.0/27 is directly connected, FastEthernet0/0
100.0.0.0/24 is subnetted, 7 subnets
R 100.1.5.0 [120/5] via 1.1.123.1, 00:00:02, FastEthernet0/0
R 100.1.4.0 [120/7] via 1.1.123.1, 00:00:02, FastEthernet0/0
R 100.1.7.0 [120/5] via 1.1.123.1, 00:00:02, FastEthernet0/0
R 100.1.6.0 [120/7] via 1.1.123.1, 00:00:02, FastEthernet0/0
R 100.1.1.0 [120/5] via 1.1.123.1, 00:00:02, FastEthernet0/0
R 100.1.3.0 [120/5] via 1.1.123.1, 00:00:02, FastEthernet0/0
R 100.1.2.0 [120/7] via 1.1.123.1, 00:00:02, FastEthernet0/0
10.0.0.0/24 is subnetted, 3 subnets
R 10.10.1.0 [120/1] via 1.1.123.1, 00:00:03, FastEthernet0/0
C 10.10.2.0 is directly connected, Loopback0
R 10.10.3.0 [120/1] via 1.1.123.3, 00:00:03, FastEthernet0/0
R2#

 

posted @ 2022-11-29 07:57  倔犟的石头  阅读(55)  评论(0)    收藏  举报