我很少写博文,今天就随便的写点自己的心得与体悟,虽谈不上深度,但是有自己的理解,也别出新意。下面我就分层次的逐步的讲讲学习网络的一点体会
一说“网络”这词,大伙应该知道是与硬件打交道的吧,路由器、交换机、防火墙、集线器、网桥及无线路由器吧。互联网络呢,也无非就是通过这些设备的通过网线的连接在一起,这就形成了网络。它可以提供上网、教学、视频、语音等等。网络这门课说真的是一门很枯燥的课,如果不感兴趣,想学得很精,很透彻有点难度。为什么呢?现在我就来说说,网络都是通过一系列的协议的规定,然后通过这些网络设备实现这些功能,路由器实现路由的转发、交换机实现传输交换。简而言之,学习网络就是学习一大堆人为制定的协议,只要把这些协议弄明白了(或者原理吧),那么你的网络这块也就不会有太大的问题。
各类厂商网络这块基本上原来相通,就是命令稍有不同而已,会了某一块学习另一块很容易。举个例吧,如果你会思科的话,那么华为的当然就没有问题。
下面讲讲自己学习的过程吧,首先主要自己喜欢网络这块,原来就是整体把握很壮观,细节值得思忖。就是构想一幅状况的场面,然后呢你自己去细心的组建与规划。有图有题,有点像学习地理的感觉,一定要有宏观的把握。我们老师再将网络时,也把这们学科描述的非常的生动,描述出一门非常有前途的专业,但是也给我们泼很大的冷水。学门学习很难学,越往后就越难,首先基础一定要打扎实,不然后面就会云里雾里的。也确实如此,原来不通后面很多的协议无法通。再则又是英文的,本来大多数人就讨厌英语,看到英语就脑大,你想让他花时间去对他感兴趣真是门都没有。假如说这东西是我们发明的话,让那些老外来学,我想也会有像我们学习它的同感。一提及国人,我高兴不起来,不是说我是一个怀着消极情绪的态度看,主要是一个原因,那就是我们太爱吹了,不会的吹,会的吹到天上去了,根本没有半点的含蓄,不会就不会,会就会,很简单,能够知道不足才有进步,不再去深究了,没意思。
我学习网络呢,接触到的是思科(cisco)的设备,正宗的发源地。刚学习网络时必须要掌握的就是思科提出的OSI七层模型,而且这七层必须要死记硬刻的也要掌握,原因有二:一便于学习与研究,二便于排错。有优点必有缺点,这个定义非常的好,如果统一按照它的这套标准走,那么现在网络可想而知是多么的好。思想虽好,但是你一家不能代表所有的人啊,各行各业都有竞争,绝对不能让它垄断,有鱼大家吃哈,每个人都有所图那个才够味啊。后来一起研究就提出了TCP/IP四层协议,就是今天的互联网络。
我所学的就是OSI七层模型中的数据链路层与网络层及传输层,OSI七层模型是哪七层呢?
第一层:物理层 两个设备之间位的运行,规定电压、线速、线缆的针输出等
第二层:数据链路层 组合位到字节并把字节组合成帧,使用MAC地址访问物理介质,错误检查和纠错
第三层:网络层 提供逻辑寻址,使路由器用来路径确定
第四层:传输层: 可靠或不可靠数据传输,重传以前进行纠错
第五层:会话层 协调不同应用层数据
第六层:表示层 数据如何表示,象加密这样的数据处理
第七层:应用层 用户接口
下面就从简单的路由开始吧,1.直连路由,就是用一根线把两个设备连接起来,窜口(serial)或者以太网线(Ethernet/FastEthernet),这就是最简单的网络。这里就要谈谈线序的问题,我这里要说的是RJ45水晶头的线序:
EIA/TIA 568A线序:绿 白绿 橙白 蓝 蓝白 橙 棕 白棕
EIA/TIA 568B线序:橙 白橙 绿白 蓝 蓝白 绿 棕 白棕
同用设备用交叉,异种设备用直通
例如:
交叉组合(交换机-----交换机 路由器-----路由器 主机----主机 集线器-----集线器 集线器----交换机 路由器-----主机)
直通组合(主机-----交换机/集线器 路由器----交换机/集线器
下面附带几个简单的实验演示
实验一:直连路由&静态路由
实验拓扑如下:
实验步骤:
R1:
enable
configure terminal
interface serial0/0
ip address 12.12.12.1 255.255.255.0
no shutdown
exit
interface loopback0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
exit
R2:
enable
configure terminal
interface serial0/0
ip address 12.12.12.2 255.255.255.0
no shutdown
exit
interface loopback0
ip address 192.168.2.2 255.255.255.0
no shutdown
exit
exit
查看路由表
R1:
R2:
ping测试
R1:
配置静态路由
R1:
ip route 192.168.2.0 255.255.255.0 12.12.12.2
ping 192.168.2.2
R2:
ping 192.168.1.1
配置一条静态路由
ip route 192.168.1.0 255.255.255.0 12.12.12.1
下面在R1与R2上面再添加一条静态路由
OK,实验演示效果达到
实验演示二:RIPv2
实验拓扑
实验过程:
R1:
enable
conf ter
inter s0/0
ip address 12.12.12.1 255.255.255.0
no shut
exit
inter loop0
ip address 1.1.1.1 255.255.255.0
no shut
exit
exit
R2:
enable
conf ter
inter s0/0
ip address 12.12.12.2 255.255.255.0
no shut
exit
inter s0/1
ip address 23.23.23.2 255.255.255.0
no shut
exit
inter loop0
ip address 2.2.2.2 255.255.255.0
no shut
exit
exit
R3:
enable
conf ter
inter s0/1
ip address 23.23.23.3 255.255.255.0
no shut
exit
inter loop0
ip address 3.3.3.3 255.255.255.0
no shut
exit
exit
查看路由表
R1:
show ip route
R2:
show ip route
R3:
show ip route
配置RIPv2
R1:
router rip
version 2
no auto-summary
network 12.12.12.0
network 1.1.1.0
exit
R2:
router rip
version 2
no auto-summary
network 12.12.12.0
network 23.23.23.0
network 2.2.2.0
exit
R3:
router rip
version 2
no auto-summary
network 23.23.23.0
network 3.3.3.0
exit
查看路由表
R1:
show ip route
R2:
show ip route
R3:
show ip route
ping测试
R1:
ping 23.23.23.3
ping 3.3.3.3
实验结果:实现了全网联通的效果
实验演示3:浮动路由
实验拓扑:
实验过程:
R1:
en
conf t
inter s0/0
ip addre 12.12.12.1 255.255.255.0
no shut
inter loop0
ip address 1.1.1.1 255.255.255.0
no shut
exit
R2:
en
conf t
inter s0/0
ip addre 12.12.12.2 255.255.255.0
no shut
inter s0/1
ip addre 23.23.23.2 255.255.255.0
no shut
inter loop0
ip address 2.2.2.2 255.255.255.0
no shut
exit
R3:
en
conf t
inter s0/1
ip addre 23.23.23.3 255.255.255.0
no shut
inter loop0
ip addre 3.3.3.3 255.255.255.0
no shut
exit
配置RIPv2
R1:
router rip
ver 2
no auto-sum
network 12.12.12.0
network 1.1.1.0
exit
R2:
router rip
ver 2
no auto-sum
network 12.12.12.0
network 23.23.23.0
network 2.2.2.0
exit
R3:
router rip
ver 2
no auto-sum
network 23.23.23.0
network 3.3.3.0
exit
查看路由表
R1:
show ip route
R2:
show ip route
R3:
show ip route
ping测试
R1:
ping 3.3.3.3
配置静态路由
R1:
ip route 23.23.23.0 255.255.255.0 12.12.12.2
ip route 2.2.2.0 255.255.255.0 12.12.12.2
ip route 3.3.3.0 255.255.255.0 12.12.12.2
R2:
ip route 1.1.1.0 255.255.255.0 12.12.12.1
ip route 3.3.3.0 255.255.255.0 23.23.23.3
R3:
ip route 12.12.12.0 255.255.255.0 23.23.23.2
ip route 2.2.2.0 255.255.255.0 23.23.23.2
ip route 1.1.1.0 255.255.255.0 23.23.23.2
查看路由表
R1:
show ip route
R2:
show ip route
R3:
show ip route
现在发现在路由表里面带r的路由条目没有了,这是因为被隐藏起来了。原因是因为metric的距离,静态的metric是1,rip路由协议的metric是120,所以静态的距离小,所以rip的就被隐藏起来了。
我现在想要在把静态的路由隐藏起来怎么办呢?这时候就要修改静态路由的metic的距离了,只有metric大于120就可以了。
修改静态路由的度量值
R1:
ip route 23.23.23.0 255.255.255.0 12.12.12.2 125
ip route 2.2.2.0 255.255.255.0 12.12.12.2 125
ip route 3.3.3.0 255.255.255.0 12.12.12.2 125
R2:
ip route 1.1.1.0 255.255.255.0 12.12.12.1 125
ip route 3.3.3.0 255.255.255.0 23.23.23.3 125
R3:
ip route 12.12.12.0 255.255.255.0 23.23.23.2 125
ip route 2.2.2.0 255.255.255.0 23.23.23.2 125
ip route 1.1.1.0 255.255.255.0 23.23.23.2 125
查看路由表
R1:
show ip route
R2:
show ip route
R3:
show ip route
现在再查看路由表的时候发现带s的路由条目被隐藏了
下面在R1上面做扩展ping,然后在R2/R3上面把rip协议no掉,模拟rip协议出现了故障
no掉R2上面的router rip协议
no掉R3上面的router rip协议
查看ping包的结果
结果:发现ping包没有丢包的现象,说明在rip协议挂掉的时候并不影响网络间的通讯
在R2/R3上面把rip路由协议配置上,发现立马静态路由被隐藏了,这样就对网络非常的安全
OK,实验结果:基本的效果达到
实验演示4:单区域的ospf
实验拓扑:
实验过程:
R1:
en
conf t
inter s0/0
ip addr 12.12.12.1 255.255.255.0
no shut
inter loop0
ip address 1.1.1.1 255.255.255.0
no shut
exit
R2:
en
conf t
inter s0/0
ip addr 12.12.12.2 255.255.255.0
no shut
inter s0/1
ip addr 23.23.23.2 255.255.255.0
no shut
inter loop0
ip address 2.2.2.2 255.255.255.0
no shut
exit
R3:
en
conf t
inter s0/1
ip addr 23.23.23.3 255.255.255.0
no shut
inter s0/0
ip address 34.34.34.3 255.255.255.0
no shut
inter loop0
ip address 3.3.3.3 255.255.255.0
no shut
exit
R4:
en
conf t
inter s0/0
ip addr 34.34.34.4 255.255.255.0
no shut
inter loop0
ip address 4.4.4.4 255.255.255.0
no shut
exit
查看路由表
R1:
show ip route
R2:
show ip route
R3:
show ip route
R4:
show ip route
配置ospf
R1:
router ospf 110
router-id 1.1.1.1
network 12.12.12.0 0.0.0.255 area 0
network 1.1.1.0 0.0.0.255 area 0
R2:
router ospf 110
router-id 2.2.2.2
network 12.12.12.0 0.0.0.255 area 0
network 23.23.23.0 0.0.0.255 area 0
network 2.2.2.0 0.0.0.255 area 0
R3:
router ospf 110
router-id 3.3.3.3
network 23.23.23.0 0.0.0.255 area 0
network 34.34.34.0 0.0.0.255 area 0
network 3.3.3.0 0.0.0.255 area 0
R4:
router ospf 110
router-id 4.4.4.4
network 34.34.34.0 0.0.0.255 area 0
network 4.4.4.0 0.0.0.255 area 0
查看路由表
R1:
show ip route
R2:
show ip route
R3:
show ip route
R4:
show ip route
最后 的ping测试
OK,实验演示效果达到
实验演示5:重分布实验一
实验拓扑:
实验过程:
R1:
en
conf ter
inter s0/0
ip addr 12.12.12.1 255.255.255.0
no shut
inter loop0
ip addr 1.1.1.1 255.255.255.0
no shut
exit
R2:
en
conf ter
inter s0/0
ip addr 12.12.12.2 255.255.255.0
no shut
inter s0/1
ip addr 23.23.23.2 255.255.255.0
no shut
inter loop0
ip address 2.2.2.2 255.255.255.0
no shut
exit
R3:
en
conf ter
inter s0/1
ip addr 23.23.23.3 255.255.255.0
no shut
inter s0/0
ip addr 34.34.34.3 255.255.255.0
no shut
inter loop0
ip addr 3.3.3.3 255.255.255.0
no shut
exit
R4:
en
conf ter
inter s0/0
ip addr 34.34.34.4 255.255.255.0
no shut
inter loop0
ip addr 4.4.4.4 255.255.255.0
no shut
exit
在R1、R2及R3上面配置RIPv2
R1:
router rip
ver 2
no auto-sum
network 12.12.12.0
network 1.1.1.0
R2:
router rip
ver 2
no auto-sum
network 12.12.12.0
network 23.23.23.0
network 2.2.2.0
R3:
router rip
ver 2
no auto-sum
network 23.23.23.0
network 3.3.3.0
在R3、R4上面配置路由ospf
R3:
router ospf 110
network 34.34.34.0 0.0.0.255 area 0
R4:
router ospf 110
router-id 4.4.4.4
network 34.34.34.0 0.0.0.255 area 0
network 4.4.4.0 0.0.0.255 area 0
做重发布
R3:
router ospf 110
redistribute rip subnets
exit
router rip
redistribute ospf 110 metric 3
查看路由
R1:
show ip route
R2:
show ip route
本文转自 vbers 博客,原文链接: http://s3.51cto.com/wyfs02/M02/23/08/wKioL1MvCzrxaPKzAALsG-ZdFUQ448.jpg 如需转载请自行联系原作者
R3: