资源描述
Ip—default network
实验目的:验证ip—default network的工作原理及实验过程
实验拓扑:
Lo:3.3.3.3/24
23.1.1.0/24
12.1.1.0/24
Lo:1.1.1.1/24
R1
R2
R3
Lo:2.2.2.2/24
S2/0
S1/0
S2/0
S1/0
网络边界
实验过程:
基本配置
R1:
hostname R1
!
interface Loopback0
ip address 1.1.1。1 255.255.255。0
!
interface Serial1/0
ip address 12.1。1。1 255。255。255。0
serial restart—delay 0
!
R2:
hostname R2
!
interface Loopback0
ip address 2.2.2。2 255。255.255。0
!
interface Serial1/0
ip address 23。1。1。2 255.255.255。0
serial restart—delay 0
!
interface Serial2/0
ip address 12。1。1.2 255。255。255。0
serial restart-delay 0
!
R3:
hostname R3
!
interface Loopback0
ip address 3.3.3。3 255。255。255。0
!
interface Serial2/0
ip address 23.1。1。3 255.255。255.0
serial restart-delay 0
!
实验配置
R1:
router eigrp 100
network 1。1。1。0 0.0。0.255
network 12.1.1.0 0.0.0.255
auto-summary
!
R2:
router eigrp 100
network 12。1。1。0 0.0.0.255
network 23.1。1。0 0。0。0.255 //想想其特别之处
auto-summary
!
ip classless
ip default—network 23。0.0.0 //通告默认路由配置
ip route 0.0。0。0 0.0.0。0 23。1。1。3 //与外网通信的静态默认路由配置
no ip http server
no ip http secure—server
!
R3:
ip classless
ip route 0。0。0。0 0。0.0.0 23.1。1。2 //与内网通信的静态路由配置(通信是双向的)
no ip http server
no ip http secure—server
!
实验结论:
1. 实验详细说明:
此实验是用R1模拟内网,R2和R3模拟网络边界,把R1和R2运行在EIGRP 100内,R2和R3之间的通信是通过设置静态默认路由实现,R1与外网通信是通过R2通告的EIGRP默认路由完成的,R1与所有未知目的网段的通信都会通过R2实现,即R1要实现与外界的通信,若路由表中没有目的网段的路由,则会把包掷给R2.
2. 以上实验配置得出的实验信息:
R1#sh ip route
Gateway of last resort is 12.1。1。2 to network 23。0.0。0
1.0。0。0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1。1。0/24 is directly connected, Loopback0
D 1。0.0.0/8 is a summary, 00:07:54, Null0
D* 23。0.0。0/8 [90/2681856] via 12。1.1。2, 00:06:48, Serial1/0
12.0。0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1。0/24 is directly connected, Serial1/0
D 12.0。0。0/8 is a summary, 00:07:54, Null0
R2#sh ip route
Gateway of last resort is 23.1.1。3 to network 0.0.0。0
D 1。0.0.0/8 [90/2297856] via 12.1.1.1, 00:09:12, Serial2/0
2.0.0。0/24 is subnetted, 1 subnets
C 2.2.2。0 is directly connected, Loopback0
* 23.0。0。0/8 is variably subnetted, 2 subnets, 2 masks
C 23.1。1。0/24 is directly connected, Serial1/0
D* 23.0.0.0/8 is a summary, 00:09:01, Null0
12.0.0。0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1.1。0/24 is directly connected, Serial2/0
D 12.0.0。0/8 is a summary, 00:09:01, Null0
S* 0。0。0。0/0 [1/0] via 23.1。1.3
R3#sh ip route
Gateway of last resort is 23。1.1.2 to network 0.0。0。0
3。0。0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
23。0。0。0/24 is subnetted, 1 subnets
C 23。1.1。0 is directly connected, Serial2/0
S* 0。0。0.0/0 [1/0] via 23。1.1.2
R1#ping 3.3.3。3 sou 1。1。1.1
Type 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 ms
R1#ping 2。2.2.2 sou 1。1。1.1
Type 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 ms
3. 以上仅是做出想得到正确的实验结果的配置及实验信息,可能会很容易发现实验配置和相应实验信息的一些条目被高亮显示,下面将针对这些被标注部分及可能存在的一些疑问进行具体分析:
疑问一:R2中的一条配置:network 23.1.1。0 0。0。0.255
对于这条配置可以与RIP默认路由实验中的相应配置作比较:在RIP的默认路由实验中,与外界路由器相连的那个网段23。1。1。0/24是不需要通告的,但是在EIGRP中是必须通告的。如果不通告这个网段,会出现下面的不同现象:
R1#sh ip route
Gateway of last resort is not set
1.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 1.1。1.0/24 is directly connected, Loopback0
D 1。0.0.0/8 is a summary, 00:07:12, Null0
12。0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1。1。0/24 is directly connected, Serial1/0
D 12。0。0.0/8 is a summary, 00:07:12, Null0
R2#sh ip route
Gateway of last resort is 23。1。1.3 to network 0。0。0.0
D 1.0.0.0/8 [90/2297856] via 12.1。1.1, 00:08:11, Serial2/0
2。0。0.0/24 is subnetted, 1 subnets
C 2。2。2。0 is directly connected, Loopback0
* 23。0。0。0/24 is subnetted, 1 subnets
C 23.1.1。0 is directly connected, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1。1。0 is directly connected, Serial2/0
S* 0.0。0.0/0 [1/0] via 23.1.1.3
可以发现与2中显示的路由条目相比,绿色条目消失了,橙色部分也有不同,默认路由设置不成功,当然R1与R3是不通的:
R1#ping 3。3。3.3
Type 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 route
Gateway of last resort is 12.1.1。2 to network 0。0。0。0
1。0.0。0/24 is subnetted, 1 subnets
C 1.1.1。0 is directly connected, Loopback0
23.0。0.0/24 is subnetted, 1 subnets
D 23.1。1。0 [90/2681856] via 12。1.1。2, 00:05:08, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1.1。0 is directly connected, Serial1/0
R2# sh ip route
Gateway of last resort is 23.1.1.3 to network 0。0.0。0
1。0。0.0/24 is subnetted, 1 subnets
D 1。1。1。0 [90/2297856] via 12.1.1.1, 00:06:18, Serial2/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2。2。0 is directly connected, Loopback0
* 23。0.0.0/24 is subnetted, 1 subnets
C 23.1。1.0 is directly connected, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1。1。0 is directly connected, Serial2/0
S* 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 route
Gateway of last resort is 12。1.1.2 to network 23。0.0.0
1.0。0。0/24 is subnetted, 1 subnets
C 1。1.1。0 is directly connected, Loopback0
D* 23.0。0.0/8 [90/2681856] via 12。1。1.2, 00:01:41, Serial1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.1。1.0 is directly connected, Serial1/0
R2#sh ip route
Gateway of last resort is 23。1.1。3 to network 0.0.0.0
1。0。0.0/24 is subnetted, 1 subnets
D 1。1.1.0 [90/2297856] via 12.1。1。1, 00:02:32, Serial2/0
2.0.0。0/24 is subnetted, 1 subnets
C 2.2.2。0 is directly connected, Loopback0
* 23.0。0。0/8 is variably subnetted, 2 subnets, 2 masks
C 23。1.1。0/24 is directly connected, Serial1/0
D* 23.0。0.0/8 is a summary, 00:02:37, Null0
12。0。0。0/8 is variably subnetted, 2 subnets, 2 masks
C 12.1。1。0/24 is directly connected, Serial2/0
D 12.0.0。0/8 is a summary, 00:02:37, Null0
S* 0。0.0。0/0 [1/0] via 23.1.1。3
疑问三:上面疑问二中说明R2必须开始auto summary,那么若R2必须关闭auto summary呢?应该如何在这种情况下做配置呢?以下提供一种解决方法:
R1实验配置:
router eigrp 100
network 1.1。1.0 0。0。0。255
network 12。1.1。0 0。0.0.255
no auto—summary
R2实验配置:
router eigrp 100
redistribute static
network 12.1.1。0 0。0.0.255
network 23。1。1.0 0.0。0.255 //注意:这条配置可以取消,再次引发思考:这里与疑问一中问题的不同之处
no auto—summary
!
ip classless
ip route 0.0.0.0 0。0。0.0 23。1。1.3 //注意,没有了ip—default network 23.0.0.0的配置
no ip http server
no ip http secure-server
!
R3实验配置不变
R1#sh ip route
Gateway of last resort is 12.1。1.2 to network 0.0.0.0
1.0。0.0/24 is subnetted, 1 subnets
C 1。1.1.0 is directly connected, Loopback0
23。0。0。0/24 is subnetted, 1 subnets
D 23。1。1。0 [90/2681856] via 12。1。1.2, 00:02:14, Serial1/0
12。0.0.0/24 is subnetted, 1 subnets
C 12.1.1。0 is directly connected, Serial1/0
D*EX 0。0。0。0/0 [170/2681856] via 12。1.1.2, 00:01:00, Serial1/0
R2#sh ip route
Gateway of last resort is 23。1.1。3 to network 0。0。0。0
1.0。0.0/24 is subnetted, 1 subnets
D 1。1。1。0 [90/2297856] via 12.1.1。1, 00:01:52, Serial2/0
2.0.0。0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
23。0。0。0/24 is subnetted, 1 subnets
C 23。1。1。0 is directly connected, Serial1/0
12。0。0.0/24 is subnetted, 1 subnets
C 12。1.1。0 is directly connected, Serial2/0
S* 0。0。0。0/0 [1/0] via 23。1。1.3
用R1去ping 3.3.3。3 也是可以通的。
最后给大家留几个问题思考一下:
1. R2配置默认路由时这样配置:ip-default network 23。1。1。0会出现怎样的现象?
2.回归原始问题:R1路由表中仅有这样一条路由
D* 23.0。0。0/8 [90/2681856] via 12。1.1.2, 00:06:48, Serial1/0,那怎样会在ping 3.3.3.3或其他未知网段时去找R2呢,这一条并没有明确说明。
展开阅读全文