1

任务2:实验拓扑

任务2:实验需求

  1. 根据实验拓扑图,完成设备的基本配置;
  2. 在R1和R3上分别创建Lo1、Lo2、Lo3,IP地址如图所示,并宣告进EIGRP;
  3. 在R1、R2、R3上配置EIGRP,打开自动汇总,保证全网路由可达。

任务2:实验步骤

步骤1:设备的基本配置

配置PC1:

VPCS> set pcname PC1 //设置主机名

PC1> ip 192.168.1.1/24 192.168.1.254 //设置IP地址与网关

配置PC2:

VPCS> set pcname PC2

PC2> ip 192.168.2.1/24 192.168.2.254

配置R1:

Router>enable

Router#configure terminal

Router(config)#hostname R1

R1(config)#no ip domain-lookup

R1(config)#line console 0

R1(config-line)#exec-timeout 0 0

R1(config-line)#logging synchronous

R1(config-line)#exit

R1(config)#interface loopback 1

R1(config-if)#ip address 172.16.1.1 255.255.255.0

R1(config-if)#exit

R1(config)#interface loopback 2

R1(config-if)#ip address 172.16.2.1 255.255.255.0

R1(config-if)#exit

R1(config)#interface loopback 3

R1(config-if)#ip address 172.16.3.1 255.255.255.0

R1(config-if)#exit

R1(config)#interface ethernet0/0

R1(config-if)#ip address 192.168.1.254 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#exit

R1(config)#interface serial1/0

R1(config-if)#ip address 192.168.12.1 255.255.255.0

R1(config-if)#no shutdown

R1(config-if)#end

R1#

配置R2:

Router>enable

Router#configure terminal

Router(config)#hostname R2

R2(config)#no ip domain-lookup

R2(config)#line console 0

R2(config-line)#exec-timeout 0 0

R2(config-line)#logging synchronous

R2(config-line)#exit

R2(config)#interface serial1/0

R2(config-if)#ip address 192.168.12.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#exit

R2(config)#interface serial1/1

R2(config-if)#ip address 192.168.23.2 255.255.255.0

R2(config-if)#no shutdown

R2(config-if)#end

R2#

配置R3:

Router>enable

Router#configure terminal

Router(config)#hostname R3

R3(config)#no ip domain-lookup

R3(config)#line console 0

R3(config-line)#exec-timeout 0 0

R3(config-line)#logging synchronous

R3(config-line)#exit

R3(config)#interface loopback 1

R3(config-if)#ip address 172.16.10.1 255.255.255.0

R3(config-if)#exit

R3(config)#interface loopback 2

R3(config-if)#ip address 172.16.20.1 255.255.255.0

R3(config-if)#exit

R3(config)#interface loopback 3

R3(config-if)#ip address 172.16.30.1 255.255.255.0

R3(config-if)#exit

R3(config)#interface ethernet0/0

R3(config-if)#ip address 192.168.2.254 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#exit

R3(config)#interface serial1/0

R3(config-if)#ip address 192.168.23.3 255.255.255.0

R3(config-if)#no shutdown

R3(config-if)#end

R3#

步骤2:检查设备接口状态

检查PC1:

PC1> show ip

NAME : PC1[1]

IP/MASK : 192.168.1.1/24

GATEWAY : 192.168.1.254

DNS :

MAC : 00:50:79:66:68:04

LPORT : 20000

RHOST:PORT : 127.0.0.1:30000

MTU : 1500

检查R1:

R1#show ip interface brief

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 192.168.1.254 YES manual up up

Ethernet0/1 unassigned YES unset administratively down down

Ethernet0/2 unassigned YES unset administratively down down

Ethernet0/3 unassigned YES unset administratively down down

Serial1/0 192.168.12.1 YES manual up up

Serial1/1 unassigned YES unset administratively down down

Serial1/2 unassigned YES unset administratively down down

Serial1/3 unassigned YES unset administratively down down

检查R2:

R2#show ip interface brief

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 unassigned YES unset administratively down down

Ethernet0/1 unassigned YES unset administratively down down

Ethernet0/2 unassigned YES unset administratively down down

Ethernet0/3 unassigned YES unset administratively down down

Serial1/0 192.168.12.2 YES manual up up

Serial1/1 192.168.23.2 YES manual up up

Serial1/2 unassigned YES unset administratively down down

Serial1/3 unassigned YES unset administratively down down

检查R3:

R3#show ip interface brief

Interface IP-Address OK? Method Status Protocol

Ethernet0/0 192.168.2.254 YES manual up up

Ethernet0/1 unassigned YES unset administratively down down

Ethernet0/2 unassigned YES unset administratively down down

Ethernet0/3 unassigned YES unset administratively down down

Serial1/0 192.168.23.3 YES manual up up

Serial1/1 unassigned YES unset administratively down down

Serial1/2 unassigned YES unset administratively down down

Serial1/3 unassigned YES unset administratively down down

检查PC2:

PC2> show ip

NAME : PC2[1]

IP/MASK : 192.168.2.1/24

GATEWAY : 192.168.2.254

DNS :

MAC : 00:50:79:66:68:05

LPORT : 20000

RHOST:PORT : 127.0.0.1:30000

MTU : 1500

步骤3:测试直连网络的连通性

测试PC1跟网关的网络连通性:

PC1> ping 192.168.1.254

84 bytes from 192.168.1.254 icmp_seq=1 ttl=255 time=0.359 ms

84 bytes from 192.168.1.254 icmp_seq=2 ttl=255 time=0.459 ms

84 bytes from 192.168.1.254 icmp_seq=3 ttl=255 time=0.463 ms

84 bytes from 192.168.1.254 icmp_seq=4 ttl=255 time=0.403 ms

84 bytes from 192.168.1.254 icmp_seq=5 ttl=255 time=0.417 ms

测试R1跟R2之间的网络连通性:

R1#ping 192.168.12.2

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/10 ms

测试R2跟R3之间的网络连通性:

R2#ping 192.168.23.3

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/11 ms

测试PC2跟网关的网络连通性:

PC2> ping 192.168.2.254

84 bytes from 192.168.2.254 icmp_seq=1 ttl=255 time=0.469 ms

84 bytes from 192.168.2.254 icmp_seq=2 ttl=255 time=0.484 ms

84 bytes from 192.168.2.254 icmp_seq=3 ttl=255 time=0.518 ms

84 bytes from 192.168.2.254 icmp_seq=4 ttl=255 time=0.400 ms

84 bytes from 192.168.2.254 icmp_seq=5 ttl=255 time=0.405 ms

步骤4:打开EIGRP自动汇总

配置R1:

R1(config)#router eigrp 100

R1(config-router)#auto-summary

R1(config-router)#network 172.16.1.0 0.0.0.255

R1(config-router)#network 172.16.2.0 0.0.0.255

R1(config-router)#network 172.16.3.0 0.0.0.255

R1(config-router)#network 192.168.1.0 0.0.0.255

R1(config-router)#network 192.168.12.0 0.0.0.255

R1(config-router)#end

R1#

配置R2:

R2(config)#router eigrp 100

R2(config-router)#auto-summary

R2(config-router)#network 192.168.12.0 0.0.0.255

R2(config-router)#network 192.168.23.0 0.0.0.255

R2(config-router)#end

R2#

配置R3:

R3(config)#router eigrp 100

R3(config-router)#auto-summary

R3(config-router)#network 172.16.10.0 0.0.0.255

R3(config-router)#network 172.16.20.0 0.0.0.255

R3(config-router)#network 172.16.30.0 0.0.0.255

R3(config-router)#network 192.168.23.0 0.0.0.255

R3(config-router)#network 192.168.2.0 0.0.0.255

R3(config-router)#end

R3#

步骤5:检查EIGRP路由

检查R2:

R2#show ip route

Codes: L - local, 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, H - NHRP, l - LISP

a - application route

    • replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

D 172.16.0.0/16 [90/2297856] via 192.168.23.3, 00:02:53, Serial1/1

[90/2297856] via 192.168.12.1, 00:02:53, Serial1/0

D 192.168.1.0/24 [90/2195456] via 192.168.12.1, 00:19:55, Serial1/0

D 192.168.2.0/24 [90/2195456] via 192.168.23.3, 00:18:53, Serial1/1

192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.12.0/24 is directly connected, Serial1/0

L 192.168.12.2/32 is directly connected, Serial1/0

192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.23.0/24 is directly connected, Serial1/1

L 192.168.23.2/32 is directly connected, Serial1/1

R2的路由表去往172.16.0.0/16是等价负载的,为什么?

EIGRP在自动汇总打开的情况下,在主类网络边界会执行自动汇总,将路由汇总成主类网络;

R1和R3的Lo1、Lo2、Lo3接口地址都是B类地址,所以R1和R3把它们汇总了B类网络,即,172.16.0.0/16。

假设这个时候R2有数据包要去往172.16.1.0/24或其它网络,那么有可能会出现以下情况:

R2#ping 172.16.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:

U.U.U

Success rate is 0 percent (0/5)

R2#ping 172.16.2.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 7/9/11 ms

因为路由是负载的,所以有可能有的网络通,有的网络不通。

怎么解决?关闭自动汇总!

步骤6:关闭EIGRP自动汇总

注意,12.X版本的IOS自动汇总默认打开,15.X版本的IOS自动汇总默认关闭。

配置R1:

R1(config)#router eigrp 100

R1(config-router)#no auto-summary

R1(config-router)#end

R1#

配置R2:

R2(config)#router eigrp 100

R2(config-router)#no auto-summary

R2(config-router)#end

R2#

配置R3:

R3(config)#router eigrp 100

R3(config-router)#no auto-summary

R3(config-router)#end

R3#

关闭自动汇总之后,R2的路由表看到的就是Loopback口的明细路由而不是汇总路由了。

检查R2:

R2#show ip route

Codes: L - local, 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, H - NHRP, l - LISP

a - application route

    • replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 6 subnets

D 172.16.1.0 [90/2297856] via 192.168.12.1, 00:01:01, Serial1/0

D 172.16.2.0 [90/2297856] via 192.168.12.1, 00:01:01, Serial1/0

D 172.16.3.0 [90/2297856] via 192.168.12.1, 00:01:01, Serial1/0

D 172.16.10.0 [90/2297856] via 192.168.23.3, 00:00:07, Serial1/1

D 172.16.20.0 [90/2297856] via 192.168.23.3, 00:00:07, Serial1/1

D 172.16.30.0 [90/2297856] via 192.168.23.3, 00:00:07, Serial1/1

D 192.168.1.0/24 [90/2195456] via 192.168.12.1, 00:34:55, Serial1/0

D 192.168.2.0/24 [90/2195456] via 192.168.23.3, 00:33:53, Serial1/1

192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.12.0/24 is directly connected, Serial1/0

L 192.168.12.2/32 is directly connected, Serial1/0

192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks

C 192.168.23.0/24 is directly connected, Serial1/1

L 192.168.23.2/32 is directly connected, Serial1/1

当然,也不会出现有的网络通,有的网络不通的情况了。

R2#ping 172.16.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/10 ms

R2#ping 172.16.2.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.2.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/10 ms

R2#ping 172.16.3.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.3.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms

R2#ping 172.16.10.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.10.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms

R2#ping 172.16.20.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.20.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 10/10/10 ms

R2#ping 172.16.30.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 172.16.30.1, timeout is 2 seconds:

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/10 ms


微思郭仔
31 声望2 粉丝

微思IT认证培训-思科、华为、红帽、oracle、VMware、PMP、CISP等,一切为了成为更好的自己,加油!!!