Ip-default network实验目的:验证ip-default network 的工作原理及实验过程 实验拓扑:实验过程:R1 R2R3 Lo:2.2.2.2/24 S2/0 S1/0S2/0 S1/0 网络边界 Lo:1.1.1.1/24 12.1.1.0/2423.1.1.0/24 Lo:3.3.3.3/24实验结论:1.实验详细说明:此实验是用R1模拟内网,R2和R3模拟网络边界,把R1和R2运行在EIGRP 100内,R2和R3之间的通信是通过设置静态默认路由实现,R1与外网通信是通过R2通告的EIGRP 默认路由完成的,R1与所有未知目的网段的通信都会通过R2实现,即R1要实现与外界的通信,若路由表中没有目的网段的路由,则会把包掷给R2。
2.以上实验配置得出的实验信息:R1#sh ip routeGateway of last resort is 12.1.1.2 to network 23.0.0.01.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 1.1.1.0/24 is directly connected, Loopback0D 1.0.0.0/8 is a summary, 00:07:54, Null0D* 23.0.0.0/8 [90/2681856] via 12.1.1.2, 00:06:48, Serial1/012.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 12.1.1.0/24 is directly connected, Serial1/0D 12.0.0.0/8 is a summary, 00:07:54, Null0R2#sh ip routeGateway of last resort is 23.1.1.3 to network 0.0.0.0D 1.0.0.0/8 [90/2297856] via 12.1.1.1, 00:09:12, Serial2/02.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback0* 23.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 23.1.1.0/24 is directly connected, Serial1/0D* 23.0.0.0/8 is a summary, 00:09:01, Null012.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 12.1.1.0/24 is directly connected, Serial2/0D 12.0.0.0/8 is a summary, 00:09:01, Null0S* 0.0.0.0/0 [1/0] via 23.1.1.3R3#sh ip routeGateway of last resort is 23.1.1.2 to network 0.0.0.03.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback023.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, Serial2/0S* 0.0.0.0/0 [1/0] via 23.1.1.2R1#ping 3.3.3.3 sou 1.1.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:Packet sent with a source address of 1.1.1.1!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 40/40/40 msR1#ping 2.2.2.2 sou 1.1.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 2.2.2.2, timeout is 2 seconds:Packet sent with a source address of 1.1.1.1!!!!!Success rate is 100 percent (5/5), round-trip min/avg/max = 20/20/20 ms3.以上仅是做出想得到正确的实验结果的配置及实验信息,可能会很容易发现实验配置和相应实验信息的一些条目被高亮显示,下面将针对这些被标注部分及可能存在的一些疑问进行具体分析:疑问一:R2中的一条配置:network 23.1.1.0 0.0.0.255对于这条配置可以与RIP默认路由实验中的相应配置作比较:在RIP的默认路由实验中,与外界路由器相连的那个网段23.1.1.0/24是不需要通告的,但是在EIGRP中是必须通告的。
如果不通告这个网段,会出现下面的不同现象:R1#sh ip routeGateway of last resort is not set1.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 1.1.1.0/24 is directly connected, Loopback0D 1.0.0.0/8 is a summary, 00:07:12, Null012.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 12.1.1.0/24 is directly connected, Serial1/0D 12.0.0.0/8 is a summary, 00:07:12, Null0R2#sh ip routeGateway of last resort is 23.1.1.3 to network 0.0.0.0D 1.0.0.0/8 [90/2297856] via 12.1.1.1, 00:08:11, Serial2/02.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback0* 23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, Serial1/012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial2/0S* 0.0.0.0/0 [1/0] via 23.1.1.3可以发现与2中显示的路由条目相比,绿色条目消失了,橙色部分也有不同,默认路由设置不成功,当然R1与R3是不通的:R1#ping 3.3.3.3Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:.....Success rate is 0 percent (0/5)那么为什么R3必须要通告23.1.1.0/24这个网段而RIP不需要呢?我认为可以从EIGRP的三张表想一下,具体细节请读者自行研究。
疑问二:实验配置中R1和R2中的蓝色条目:auto summary此实验是在没有关闭R1和R2的自动汇总前提下进行的,那若关闭自动汇总呢?会一切照常,还是会出现一些其他现象呢?在关闭R1和R2的EIGRP自动汇总后(其余配置不变,仅在原实验配置基础上关闭auto summary),R1和R2路由表显示路由信息如下:R1#sh ip routeGateway of last resort is 12.1.1.2 to network 0.0.0.01.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback023.0.0.0/24 is subnetted, 1 subnetsD 23.1.1.0 [90/2681856] via 12.1.1.2, 00:05:08, Serial1/012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0R2# sh ip routeGateway of last resort is 23.1.1.3 to network 0.0.0.01.0.0.0/24 is subnetted, 1 subnetsD 1.1.1.0 [90/2297856] via 12.1.1.1, 00:06:18, Serial2/02.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback0* 23.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, Serial1/012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial2/0S* 0.0.0.0/0 [1/0] via 23.1.1.3可以发现与原实验显示的不同之处了,当然R1去ping 3.3.3.3是不通的。
可以发现R2路由表中缺少了这个条目:D* 23.0.0.0/8 is a summary, 00:09:01, Null0这是关闭自动汇总后导致结果不同的直接原因,那么从这点可以看出R2必须开启auto summary,下面是关闭R1 auto summary、开启R2 auto summary下R1和R2的路由表中的信息:R1#sh ip routeGateway of last resort is 12.1.1.2 to network 23.0.0.01.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback0D* 23.0.0.0/8 [90/2681856] via 12.1.1.2, 00:01:41, Serial1/012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0R2#sh ip routeGateway of last resort is 23.1.1.3 to network 0.0.0.01.0.0.0/24 is subnetted, 1 subnetsD 1.1.1.0 [90/2297856] via 12.1.1.1, 00:02:32, Serial2/02.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback0* 23.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 23.1.1.0/24 is directly connected, Serial1/0D* 23.0.0.0/8 is a summary, 00:02:37, Null012.0.0.0/8 is variably subnetted, 2 subnets, 2 masksC 12.1.1.0/24 is directly connected, Serial2/0D 12.0.0.0/8 is a summary, 00:02:37, Null0S* 0.0.0.0/0 [1/0] via 23.1.1.3疑问三:上面疑问二中说明R2必须开始auto summary,那么若R2必须关闭auto summary 呢?应该如何在这种情况下做配置呢?以下提供一种解决方法:R1实验配置:router eigrp 100network 1.1.1.0 0.0.0.255network 12.1.1.0 0.0.0.255no auto-summaryR2实验配置:router eigrp 100redistribute staticnetwork 12.1.1.0 0.0.0.255network 23.1.1.0 0.0.0.255 //注意:这条配置可以取消,再次引发思考:这里与疑问一中问题的不同之处no auto-summary!ip classlessip route 0.0.0.0 0.0.0.0 23.1.1.3 //注意,没有了ip-default network 23.0.0.0的配置no ip http serverno ip http secure-server!R3实验配置不变R1#sh ip routeGateway of last resort is 12.1.1.2 to network 0.0.0.01.0.0.0/24 is subnetted, 1 subnetsC 1.1.1.0 is directly connected, Loopback023.0.0.0/24 is subnetted, 1 subnetsD 23.1.1.0 [90/2681856] via 12.1.1.2, 00:02:14, Serial1/012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial1/0D*EX 0.0.0.0/0 [170/2681856] via 12.1.1.2, 00:01:00, Serial1/0R2#sh ip routeGateway of last resort is 23.1.1.3 to network 0.0.0.01.0.0.0/24 is subnetted, 1 subnetsD 1.1.1.0 [90/2297856] via 12.1.1.1, 00:01:52, Serial2/02.0.0.0/24 is subnetted, 1 subnetsC 2.2.2.0 is directly connected, Loopback023.0.0.0/24 is subnetted, 1 subnetsC 23.1.1.0 is directly connected, Serial1/012.0.0.0/24 is subnetted, 1 subnetsC 12.1.1.0 is directly connected, Serial2/0S* 0.0.0.0/0 [1/0] via 23.1.1.3用R1去ping 3.3.3.3 也是可以通的。