Configuring Default-network for EIGRP

简介:

Configuring Default-network for EIGRP

实验目的:

1、掌握通过ip default-network 命令配置EIGRP 默认网络。

实验拓扑图:

实验步骤及要求:

1、配置各台路由器的IP 地址,并且使用Ping 命令确认各路由器的直连口的互

通性。

2、配置R3 路由器用于模拟外部网络,也可以把其假想为Internet 网络,并且

R3 上配置一条默认用于,以便路由来自于EIGRP 内部网络的数据包。

R3(config)#

R3(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.1

R3(config)#

3、配置R1R2 R5 路由器的EIGRP 路由协议,配置如下所示:

R1(config)#router eigrp 50

R1(config-router)#network 172.16.0.0

R1(config-router)#exit

R5(config)#router eigrp 50

R5(config-router)#network 172.16.0.0

R5(config-router)#exit

R2(config)#router eigrp 50

R2(config-router)#network 172.16.0.0

R2(config-router)#exit

4、在R2 上查看EIGRP 的邻居,确认EIGRP 正常运行:

R2#show ip eigrp neighbors

IP-EIGRP neighbors for process 50

H Address Interface Hold Uptime SRTT RTO Q Seq Type

(sec) (ms) Cnt Num

1 172.16.1.6 Et1/2 11 00:00:54 1 3000 0 2

0 172.16.1.1 Et1/0 12 00:00:54 1 3000 0 2

5、在R2 上配置静态默认路由,用于到达外部网络,配置如下:

R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.10.2

R2(config)#

R2#ping 192.168.1.1

Type escape sequence to abort.

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

.!!!!

Success rate is 80 percent (4/5), round-trip min/avg/max = 4/43/92 ms

R2#

6、路由器R2 作为企业的出口路由器,由于其配置了静态路由,因此其可以直接

批注 [stanley11]: 配置此

条路由到达EIGRP 内部网络。

批注 [stanley12]: R2 通过

此路由可以访问到外部网

络。

批注 [stanley13]: 测试静

态默认路由的有效性。

10

访问外部,但是内部的R1 R5 路由器由于缺少路由,因此无法访问外网。下面

显示了R1 路由器的路由表和其向外部发起ping 的访问结果:

R1#show ip route

Gateway of last resort is not set

172.16.0.0/30 is subnetted, 2 subnets

D 172.16.1.4 [90/284160] via 172.16.1.2, 00:06:40, FastEthernet0/1

C 172.16.1.0 is directly connected, FastEthernet0/1

R1#

R1#ping 192.168.1.1

Type escape sequence to abort.

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

.....

Success rate is 0 percent (0/5)

R1#

R5#show ip route

Gateway of last resort is not set

172.16.0.0/30 is subnetted, 2 subnets

C 172.16.1.4 is directly connected, Ethernet1/1

D 172.16.1.0 [90/307200] via 172.16.1.5, 00:12:15, Ethernet1/1

R5#

R5#ping 192.168.1.1

Type escape sequence to abort.

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

.....

Success rate is 0 percent (0/5)

R5#

7、为了解决问题,只需要在R1 R5 路由器上配置一条指向R2 路由器的静态默

认路由即可,如下所示:

R1(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.2

R1(config)#exit

R1#show ip route

Gateway of last resort is 172.16.1.2 to network 0.0.0.0

批注 [stanley14]: 路由表

中显示出R1 没有外部网络路

由。

批注 [stanley15]: 由于R1

缺少到达外部网络路由,因

R1 无法访问外部网络。

批注 [stanley16]: 内部路

由器R5 也遇到了相同的问

题。

11

172.16.0.0/30 is subnetted, 2 subnets

D 172.16.1.4 [90/284160] via 172.16.1.2, 00:09:19, FastEthernet0/1

C 172.16.1.0 is directly connected, FastEthernet0/1

S* 0.0.0.0/0 [1/0] via 172.16.1.2

R1#

R1#ping 192.168.1.1

Type escape sequence to abort.

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

!!!!!

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

R1#

R5(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.5

R5(config)#exit

R5#

R5#show ip route

Gateway of last resort is 172.16.1.5 to network 0.0.0.0

172.16.0.0/30 is subnetted, 2 subnets

C 172.16.1.4 is directly connected, Ethernet1/1

D 172.16.1.0 [90/307200] via 172.16.1.5, 00:13:57, Ethernet1/1

S* 0.0.0.0/0 [1/0] via 172.16.1.5

R5#

R5#ping 192.168.1.1

Type escape sequence to abort.

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

!!!!!

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

R5#

8、根据上面配置,其实只需要给内部路由器配置默认路由指向出口路由器R2 

可解决外部网络无法访问的问题。但是如果内部网络路由器数量较多时,采用手

工配置静态默认路由,则会显得非常繁锁。因此,建议采用默认网络命令,让

R2 路由器自动的向内部通告默认路由。

9、将R1 R5 的静态默认路由删除后,查看R1 R5 的路由表。如下所示:

R1(config)#no ip route 0.0.0.0 0.0.0.0 172.16.1.2

R1(config)#exit

R1#

批注 [stanley17]: R1 

加一条到达外网静态默认路

由。

批注 [stanley18]: 由于已

经此时配置了默认路由,所

以此时R1 可以访问到外部网

络。

12

R1#show ip route

Gateway of last resort is not set

172.16.0.0/30 is subnetted, 2 subnets

D 172.16.1.4 [90/284160] via 172.16.1.2, 00:19:02, FastEthernet0/1

C 172.16.1.0 is directly connected, FastEthernet0/1

R1#

R1#ping 192.168.1.1

Type escape sequence to abort.

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

.....

Success rate is 0 percent (0/5)

R1#

R5(config)#no ip route 0.0.0.0 0.0.0.0 172.16.1.5

R5(config)#exit

R5#

R5#show ip route

Gateway of last resort is not set

172.16.0.0/30 is subnetted, 2 subnets

C 172.16.1.4 is directly connected, Ethernet1/1

D 172.16.1.0 [90/307200] via 172.16.1.5, 00:19:42, Ethernet1/1

R5#

R5#ping 192.168.1.1

Type escape sequence to abort.

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

.....

Success rate is 0 percent (0/5)

R5#

10、在R2 上配置默认网络,配置如下所示:

R2(config)#router eigrp 50

R2(config-router)#network 192.168.10.0

R2(config-router)#exit

R2(config)#ip default-network 192.168.10.0

R2(config)#exit

R2#show ip route

13

Gateway of last resort is 192.168.10.2 to network 0.0.0.0

* 192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks

D* 192.168.10.0/24 is a summary, 00:00:53, Null0

C 192.168.10.0/30 is directly connected, Ethernet1/1

172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks

C 172.16.1.4/30 is directly connected, Ethernet1/2

D 172.16.0.0/16 is a summary, 00:22:22, Null0

C 172.16.1.0/30 is directly connected, Ethernet1/0

S* 0.0.0.0/0 [1/0] via 192.168.10.2

R2#

11、查看R1 R5 路由器的路由表,并且尝试访问外部网络:

R1#show ip route

Gateway of last resort is 172.16.1.2 to network 192.168.10.0

D* 192.168.10.0/24 [90/284160] via 172.16.1.2, 00:02:03, FastEthernet0/1

172.16.0.0/30 is subnetted, 2 subnets

D 172.16.1.4 [90/284160] via 172.16.1.2, 00:02:04, FastEthernet0/1

C 172.16.1.0 is directly connected, FastEthernet0/1

R1#

R1#ping 192.168.1.1

Type escape sequence to abort.

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

!!!!!

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

R1#

R5#show ip route

Gateway of last resort is 172.16.1.5 to network 192.168.10.0

D* 192.168.10.0/24 [90/307200] via 172.16.1.5, 00:04:15, Ethernet1/1

172.16.0.0/30 is subnetted, 2 subnets

C 172.16.1.4 is directly connected, Ethernet1/1

D 172.16.1.0 [90/307200] via 172.16.1.5, 00:04:19, Ethernet1/1

R5#

R5#ping 192.168.1.1

Type escape sequence to abort.

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

批注 [stanley19]: ip

default-network 命令标识

的默认网络。

批注 [stanley20]: 手工配

置的静态默认路由。

批注 [stanley21]: 由于R2

上配置的默认网络,EIGRP

路由器会将其通告给R1 路由

器。

14

!!!!!

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

R5#

12、使用ip default-network 命令可以有效减少内部网络配置任务。不过需要

注意的是ip default-network 其指出默认网络,建议采用主类网络。如果使用

无类网络,则可能会出现无法解释的问题。

38、实验完成


本文转自  还不算晕  51CTO博客,原文链接:http://blog.51cto.com/haibusuanyun/524299


相关文章
|
8月前
成功解决hostname ‘xxx‘ doesn‘t uniquely match the interface ‘ens33‘ selected for the management bridge
成功解决hostname ‘xxx‘ doesn‘t uniquely match the interface ‘ens33‘ selected for the management bridge
|
JavaScript
How to monitor your mobile application network traffic in your own LAPTOP
How to monitor your mobile application network traffic in your own LAPTOP
103 0
How to monitor your mobile application network traffic in your own LAPTOP
|
网络安全 网络性能优化 Linux
|
网络协议 网络架构