本帖最后由 当年的美好 于 2011-9-20 21:38 编辑
经实验证明,2楼的说法是正确的
如果地址分派是按照 A类 B类 A类 这样分,那才会出现不连续子网
或者使用不同的掩码也会出现不连续子网
而我使用的是 A类 C类 C类
THE END
***********************************************************
先说说我个人以为的不连续子网的定义
首先要确认的是,IP私有地址分三类:
A类:10.0.0.0 - 10.255.255.255
B类:172.16.0.0 - 172.31.255.255
C类:192.168.0.0 - 192.168.255.255
不连续子网的定义就是两个同一主类的IP地址之间出现了一个不是该主类的IP地址
比如 10.0.0.0 - 172.16.0.0 - 10.1.1.0
我做了几个实验, 简单的做了一个拓扑:
R1 - R2 - R3 - R4
分别配置IP地址 10.0.0.0 - 172.0.0.0 - 10.1.1.0 掩码均为/8
这样的网络地址,结果 R1 就 PING 不通 R4
以下是路由表:
R1 R4
C 10.0.0.0/8 is directly connected, FastEthernet0/0
D 172.0.0.0/8 [90/30720] via 10.0.0.2, 00:00:04, FastEthernet0/0
R2 R3
C 10.0.0.0/8 is directly connected, FastEthernet0/0
C 172.0.0.0/8 is directly connected, FastEthernet1/0
这应该是正常的吧,因为子网不连续
后来做了第二个实验
实验过程:
分别配置地址,掩码均使用 /8:
10.0.0.0
15.0.0.0
12.0.0.0
宣告地址:
net 10.0.0.0
net 15.0.0.0
net 12.0.0.0
实验结果:
每台路由器均能学习到三个网段的地址,掩码均为/8
C 10.0.0.0/8 is directly connected, FastEthernet0/0
D 12.0.0.0/8 [90/33280] via 10.0.0.2, 00:00:21, FastEthernet0/0
D 15.0.0.0/8 [90/30720] via 10.0.0.2, 00:00:46, FastEthernet0/0
这个结果也是正常的,事先也已经猜到了这个结果
继续做了第3.4.5个实验,使用相同的IP,不同的掩码,宣告不同的网络号,结果都大同小异,不出所料
以上这些只是为了证明掩码对最终产生路由表的结果影响不是太大
当然,如果使用不同的子网掩码就另说了
接下来,又因为好奇,做了第6个实验
这时候就碰到一件很奇怪的事情
实验过程:
配置IP地址
12.12.12.0 255.255.255.0
189.23.23.0 255.255.255.0
200.34.34.0 255.255.255.0
宣告地址:
network 12.12.12.0 0.0.0.255
network 189.23.23.0 0.0.0.255
network 200.34.34.0 0.0.0.255
这样的三个地址,按理来说应该也算是不连续子网吧
在实验前本以为这个实验的结果应该与之前无异
但最终的路由表很让人意外,每台路由器竟然都能学到所有的路由条目
实验结果:
R1
D 200.34.34.0/24 [90/33280] via 12.12.12.2, 00:00:33, FastEthernet0/0
189.23.0.0/24 is subnetted, 1 subnets
D 189.23.23.0 [90/30720] via 12.12.12.2, 00:02:03, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, FastEthernet0/0
R2
D 200.34.34.0/24 [90/30720] via 189.23.23.3, 00:00:33, FastEthernet1/0
189.23.0.0/24 is subnetted, 1 subnets
C 189.23.23.0 is directly connected, FastEthernet1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, FastEthernet0/0
R3
C 200.34.34.0/24 is directly connected, FastEthernet1/0
189.23.0.0/24 is subnetted, 1 subnets
C 189.23.23.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
D 12.12.12.0 [90/30720] via 189.23.23.2, 00:00:38, FastEthernet0/0
R4
C 200.34.34.0/24 is directly connected, FastEthernet0/0
189.23.0.0/24 is subnetted, 1 subnets
D 189.23.23.0 [90/30720] via 200.34.34.3, 00:00:03, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
D 12.12.12.0 [90/33280] via 200.34.34.3, 00:00:03, FastEthernet0/0
为什么会出现这样的路由表呢??
虽然感觉不是什么大问题,但总觉的很奇怪
各位走过路过不要错过,还请路过的TS、CS 和 CLASS 们 不吝指点
|