网络运维Day01

编程入门 行业动态 更新时间:2024-10-22 08:44:16

<a href=https://www.elefans.com/category/jswz/34/1771439.html style=网络运维Day01"/>

网络运维Day01

文章目录

  • 环境准备
  • OSI七层参考模型
  • 什么是协议?
  • 协议数据单元(PDU)
  • 设备与层的对应关系
  • 什么是IP地址?
  • IP地址分类
  • IP的网络位和主机位
  • IP地址默认网络位与主机位
  • 子网掩码
  • 默认子网掩码
  • 查看IP地址
  • 安装CISCO
    • 汉化CISCO(可选操作)
  • CISCO之PC机器
    • 验证通信
  • CISCSO之交换机
    • 测试使用交换机组网通信(各个PC机之间相互ping)
  • 路由器基本使用
    • 路由器使用技巧
    • 路由器关闭DNS查询功能
    • 路由器接口介绍
    • 路由器设置接口IP地址
    • 路由器删除或更改接口IP地址
  • 路由器综合实验
    • 路由器设置接口IP地址
    • 配置IP及子网掩码
    • 测试是否通信
  • 总结

环境准备

  • Cisco Packet Tracer 6.2 for Windows Student Version (no tutorials).exe软件
  • Chinese.ptl文件

OSI七层参考模型

国际标准化组织(International Standard Organization,ISO)于1984年颁布了开放系统互连(Open System Interconnection,OSI)参考模型

它规定将网络分为七层,从下往上依次是:物理层、数据链路层、网络层、传输层、会话层、表示层和应用层

什么是协议?

  • 为了使数据可以在网络上从源传递到目的地,网络上所有设备需要“讲”相同的“语言”

  • 描述网络通信中“语言”规范的一组规则就是协议

协议数据单元(PDU)

设备与层的对应关系

什么是IP地址?

  • IP地址:网络中唯一标识一台主机

  • IP地址由32个二进制数组成,二进制的世界里只有0和1,二进制逢2进1

  • 每8位加一个. 因此又叫做点分十进制

    11111111.11111111.11111111.11111111

    255.255.255.255

IP地址分类

  • A类:1-126(127)

  • B类:128-191

  • C类:192-223

  • D类:224-239

  • E类:240-255

  • 工作中常用的地址是A、B、C三类、D和E类分别用于组播和科研

IP的网络位和主机位

网络位:相当于标识区域

主机位:相当于标识顺序

举例子

  • 010-6752610

  • 010-6752611

  • 0313-6743121

  • 0313-6743122

IP地址默认网络位与主机位

A类:网络位.主机位.主机位.主机位 例:10.0.0.1
B类:网络位.网络位.主机位.主机位 例:172.25.0.1

C类:网络位.网络位.网络位.主机位 例:192.168.1.1

某个类别中的第一个IP地址和最后一个IP地址均不能直接使用

  • 第一个地址表示 网段

  • 最后一个地址表示 广播地址

    • 192.168.4.0 表示192.168.4.0网段(本网段第一个IP)

    • 192.168.4.255 表示广播地址

    • 192.168.4.1 表示192.168.4.0网段中的第一个可用IP

子网掩码

  • 子网掩码:计算机用来标识网络位和主机位

  • 网络为使用二进制的1 表示

  • 主机位使用二进制的0 表示

每8位转换成一个十进制

192.168.4.1–>C类–>192.168.4–>11111111.11111111.11111111.00000000

255.255.255.0

172.25.0.1–>B类–>172.40–>11111111.11111111.00000000.00000000

255.255.0.0

10.0.0.1–>A类–>10–>11111111.00000000.00000000.00000000

255.0.0.0

默认子网掩码

A类: 255.0.0.0 也可以使用8表示(8表示二进制有8个1)

B类: 255.255.0.0 也可以使用16表示(16表示二进制有16个1)

C类: 255.255.255.0 也可以使用24表示(24表示二进制有24个1)

查看IP地址

C:\Users\15790>ipconfig  							#查看IP地址
C:\Users\15790>ping 127.0.0.1						#ping测试

安装CISCO







汉化CISCO(可选操作)

​ 1、 将Chinese.ptl文件复制到CICSO安装文件夹/languages/

​ 2、 选择CISCO左上角Optinons—>Preferences–>选择CHinese.ptl—>选择Change language

​ 3、 重新启动CISCO

CISCO之PC机器

实验拓扑图

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

为两台PC机器配置IP地址,如下方法

  • 第一台配置:192.168.1.1 255.255.255.0(子网掩码)

  • 第二台配置:192.168.1.2 255.255.255.0(子网掩码)

验证通信

  • ping 命令:专门用于测试网络连通性的命令工具,数据有去有回

  • 使用格式:ping IP地址

PC>ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data:Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128Ping statistics for 192.168.1.2:Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 0ms, Average = 0ms
PC>

CISCSO之交换机

交换机:是组网的必备设备,可以解决网线接口不足的问题,可以实现网络隔离(VLAN)

  • 第一台配置:192.168.1.1 255.255.255.0(子网掩码)
  • 第二台配置:192.168.1.2 255.255.255.0(子网掩码)
  • 第三台配置:192.168.1.3 255.255.255.0(子网掩码)

下方以一台PC为例

测试使用交换机组网通信(各个PC机之间相互ping)

以下方为例

PC>ping 192.168.1.2
Pinging 192.168.1.2 with 32 bytes of data:Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128Ping statistics for 192.168.1.2:Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:Minimum = 0ms, Maximum = 0ms, Average = 0ms

路由器基本使用

  • 用户模式
  • 特权模式
  • 全局配置模式
  • 接口模式

Router>		 					 #用户模式
Router> enable         			 #进入特权模式   
Router#                    		 #特权模式
Router# configure terminal       #进入全局配置模式   
Router(config)#		        	 #全局配置模式
Router(config)# interface GigabitEthernet 0/0	       #接口模式
Router(config-if)#

路由器使用技巧

Router>                     		#用户模式
Router> en(Tab)       				#进入特权模式
Router#                     		#特权模式
Router# conf(Tab)    t(Tab)     	#进入全局配置模式
Router(config)#                     #全局配置模式
Router(config)#  ex(Tab)            #进行后退
Ctrl  + Shift + 6      		  		#输入错误,取消DNS的查询

路由器关闭DNS查询功能

Router> enable            					#进入特权模式
Router# configure    terminal    			#进入全局配置模式
Router(config)# no    ip     domain-lookup  #关闭DNS查询功能
Router(config)# end            				#返回到特权模式
Router# haha             				 	#测试验证Translating "haha"% Unknown command or computer name, or unable to find computer address
Router#
Router# write      							#特权模式下,保存路由器配置
Building configuration...
[OK]

路由器接口介绍

  • 路由器查看接口信息
Router> enable
Router# show ip interface brief				#查看IP接口信息

路由器设置接口IP地址

Router> enable            			     	     		#进入特权模式
Router# configure    terminal         		    		#进入全局配置模式
Router(config)# interface GigabitEthernet  0/0          #进入接口g0/0
Router(config-if)# ip  address  192.168.1.1   255.255.255.0
Router(config-if)# no  shutdown       		    		#激活启用接口
Router(config-if)# exit                        	        #退回到全局配置模式
Router(config-if)# end                                  #退回到特权模式
Router# show ip interface brief                         #查看接口IP地址信息
Interface                 IP-Address OK? Method Status Protocol
GigabitEthernet0/0 192.168.1.1 YES manual up  up
GigabitEthernet0/1 unassigned YES unset administratively down down
GigabitEthernet0/2 unassigned YES unset administratively down down
Vlan1 unassigned YES unset administratively down dow

路由器删除或更改接口IP地址

Router> enable            								#进入特权模式
Router# configure    terminal          					#进入全局配置模式
Router(config)# interface GigabitEthernet 0/0 			#进入接口g0/0
Router(config-if)# no  ip  address        				#删除接口IP地址
Router(config-if)# exit                          		#退回到全局配置模式
Router(config)# interface GigabitEthernet 0/1    		#进入接口g0/1
Router(config-if)# ip  address    192.168.3.1   255.255.255.0
Router(config-if)# no  shutdown      					#激活启用接口
Router(config-if)# end                       			#退回到特权模式
Router# show ip interface brief      					#查看接口IP地址信息

路由器综合实验

  • 一台2911路由器
  • 两台交换机
  • 四台PC

路由器设置接口IP地址

Router> enable           		  					#进入特权模式
Router# configure    terminal          				#进入全局配置模式
Router(config)# interface GigabitEthernet  0/0		#进入接口g0/0
Router(config-if)# ip  address  192.168.1.254   255.255.255.0
Router(config-if)# no  shutdown       				#激活启用接口
Router(config-if)# exit                        		#退回到全局配置模式
Router(config)# interface GigabitEthernet 0/1 		#进入接口g0/1
Router(config-if)# ip  address    192.168.2.254   255.255.255.0
Router(config-if)# no  shutdown      				#激活启用接口
Router(config-if)# end                       		#退回到特权模式
Router# show ip interface brief      				#查看接口IP地址信息

配置IP及子网掩码

测试是否通信

PC>ping     192.168.2.1         
Pinging 192.168.1.2 with 32 bytes of data:
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128
Reply from 192.168.1.2: bytes=32 time=0ms TTL=128

总结

  • 掌握什么是IP地址
    • IP地址分类
    • 网络为与主机位
    • 子网掩码
  • 熟练安装Cisco软件
  • 掌握交换机工作原理
  • 掌握路由器工作原理
  • 掌握Cisco模拟器中路由器的配置方法
  • 了解路由表填充方式

更多推荐

网络运维Day01

本文发布于:2023-11-16 14:55:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627252.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网络

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!