路由交换实验一——CISCO路由器的基本配置

article/2025/9/18 19:57:18

CISCO路由器的基本配置

      • 实验要求
      • 开始实验
        • 1.初始化配置:
        • 2.搭建网络:
        • 3.测试网络:
        • 4.配置密码:
        • 5.查看信息:

实验要求

  1. 初始化相关配置;
  2. 设置接口IP地址; ( F0/0 S1/0 )
  3. 测试; ( ping 、 telnet )
  4. 设置密码; ( console口、VTY接口和特权 )
  5. 查看相关信息。 ( show 命令 )

在这里插入图片描述

开始实验

1.初始化配置:

1.1使用PC进入配置面板:拉出一个2811路由器,以及一台PC设备,用配置线链接路由器的Console接口和PC的RS 232接口。

在这里插入图片描述
点击PC——选择Desktop选项卡——选择Terminal窗口——点击“确定”。
在这里插入图片描述

即可进入配置界面。

在这里插入图片描述

1.2使用路由器进入控制面板(现实操作无此方法):拉出一个2811路由器。

选择路由器——选择CLI选项卡即可进入配置界面。

在这里插入图片描述

Router>
箭头即为用户模式,权限最小,在用户模式下输入en并回车,进入特权模式Router#
井号即为特权模式,可以进行所有的查看、信息的清楚、重启等。在特权模式下输入config进入配置模式Router(config)#
此为配置模式,可以进行相关参数的配置

用户之间的切换如下所示:


Router>en
Router#config
Configuring from terminal, memory, or network [terminal]? 
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#exit
Router con0 is now available
Press RETURN to get started.
Router>

接下来进行初始化配置,在配置模式下输入host *即为对路由器命名。

Router(config)#host R1
R1(config)#

输入no ip domain-lookup关闭域名解析。

(如果忘记关闭,可在进行解析时按下Ctrl+Shift+6终止解析)

R1(config)#no ip domain-lookup

输入line con 0进入Console线路口。

R1(config)#line con 0
R1(config-line)#

输入logging synchronous实现日志自动同步(自动换行)。

R1(config-line)#logging synchronous

输入exec-time 0 0实现会话永不超时(默认10分钟)。

R1(config-line)#exec-time 0 0

2.搭建网络:

拉出两个2811路由器,一个2950交换机,4台PC,如下图摆放。

在这里插入图片描述
为两台路由器添加广域网接口,点击路由器——点击标红处断电(不断电无法添加模块)。
在这里插入图片描述

在这里插入图片描述

将A区域用直通线连接起来,B区域用交叉线连接起来(相同设备用交叉线,不用设备用直通线,路由器与PC均有网卡,所以此处视为相同设备),两个路由器用DCE串口线连接起来(先连接的一段为DCE端)。

在这里插入图片描述

接下来进入R1服务器配置端口,在配置模式下输入int f0/0进入对应端口。

R1(config)#int f0/0
R1(config-if)#

输入ip add 192.168.1.251 255.255.255.0为该端口配置IP及子网掩码。

R1(config-if)#ip add 192.168.1.251 255.255.255.0

输入no shutdown启用该端口。

R1(config-if)#no shutdownR1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

接下来输入int s1/0进入广域网端口。

R1(config-if)#int s1/0

输入ip add 192.168.2.1 255.255.255.0为该端口配置IP及子网掩码。

R1(config-if)#ip add 192.168.2.1 255.255.255.0

输入clock rate 64000为DCE配置同步时钟(仅DCE端需要进行此配置)

R1(config-if)#clock rate 64000

输入no shutdown启用该端口。

R1(config-if)#no shutdown%LINK-5-CHANGED: Interface Serial1/0, changed state to down

R2服务器配置端口与R1相同,不再分开累述。

R2(config-if)#ip add 192.168.3.1 255.255.255.0
R2(config-if)#no shutR2(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to upR2(config-if)#int s1/0
R2(config-if)#ip add 192.168.2.2 255.255.255.0
R2(config-if)#no shutR2(config-if)#
%LINK-5-CHANGED: Interface Serial1/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up

在这里插入图片描述

为PC配置IP,点开PC1——选择Desktop选项卡——选择IP Configuration——输入内容如下。

在这里插入图片描述

PC2输入内容如下。

在这里插入图片描述
PC3输入内容如下。

在这里插入图片描述
PC4输入内容如下。

在这里插入图片描述

3.测试网络:

使用PC2ping路由器R1的f0/0端口。

在这里插入图片描述

使用PC2telnet连接路由器R1的f0/0端口。

在这里插入图片描述

4.配置密码:

为路由器R1的console接口配置密码(进入用户模式时需要输入的密码)。

R1(config)#line con 0R1(config-line)#password 123456R1(config-line)#login

为路由器R1的VTY接口配置密码(telnet连接路由器时需要输入的密码)。

先输入line vty ? 显示0-15共16个接口可配置。

R1(config)#line vty ?<0-15>  First Line number

为0-4这5个接口设置密码(开启接口)。

R1(config)#line vty 0 4R1(config-line)#password 654321R1(config-line)#login

为路由器R1配置特权密码(从用户模式进入特权模式时需要输入的密码)。

设置特权明文密码:

R1(config)#enable password aaa

设置特权密文密码(明文密码与密文密码同时存在时,明文密码失效):

R1(config)#enable secret bbb

加密前查询配置显示结果:

在这里插入图片描述

对明文密码进行加密:

R1(config)#service password-encryption 

加密后查询配置显示结果:

在这里插入图片描述

此时,使用PC2telnet连接路由器:

在这里插入图片描述

输入VTY接口密码:654321,进入到用户模式。

在这里插入图片描述

输入特权密文密码:bbb(因为明文密码与密文密码同时启用,明文密码失效),进入到特权模式。

在配置服务器时,会话超时时,会要求输入console接口密码:123456,即可进入用户模式。

R1 con0 is now availablePress RETURN to get started.User Access VerificationPassword: 

5.查看信息:

  1. 查看当前内存中的配置
R1#show running-config Building configuration...Current configuration : 978 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
service password-encryption
!
hostname R1
!
enable secret 5 $1$mERr$MBmafWD9.kwwwgArTAUad0
enable password 7 08204D4F
!
no ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface FastEthernet0/0ip address 192.168.1.251 255.255.255.0duplex autospeed auto
!
interface FastEthernet0/1no ip addressduplex autospeed autoshutdown
!
interface Serial1/0ip address 192.168.2.1 255.255.255.0clock rate 64000
!
interface Serial1/1no ip addressclock rate 2000000shutdown
!
interface Serial1/2no ip addressclock rate 2000000shutdown
!
interface Serial1/3no ip addressclock rate 2000000shutdown
!
interface Vlan1no ip addressshutdown
!
ip classless
!
ip flow-export version 9
!
line con 0password 7 08701E1D5D4C53login
!
line aux 0
!
line vty 0 4password 7 0877191A5A4B54login
!
end
  1. 查看初始配置
R1#show startup-config Using 844 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname r1
!
no ip cef
no ipv6 cef
!
spanning-tree mode pvst
!
interface FastEthernet0/0ip address 192.168.1.251 255.255.255.0duplex autospeed auto
!
interface FastEthernet0/1no ip addressduplex autospeed autoshutdown
!
interface Serial1/0ip address 192.168.2.1 255.255.255.0clock rate 64000
!
interface Serial1/1no ip addressclock rate 2000000shutdown
!
interface Serial1/2no ip addressclock rate 2000000shutdown
!
interface Serial1/3no ip addressclock rate 2000000shutdown
!
interface Vlan1no ip addressshutdown
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4login
!
end
  1. 查看版本号(包含启动顺序)
R1#show version Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2007 by Cisco Systems, Inc.
Compiled Wed 18-Jul-07 06:21 by pt_rel_teamROM: System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)
Copyright (c) 2000 by cisco Systems, Inc.System returned to ROM by power-on
System image file is "c2800nm-advipservicesk9-mz.124-15.T1.bin"This product contains cryptographic features and is subject to United
States and local country laws governing import, export, transfer and
use. Delivery of Cisco cryptographic products does not imply
third-party authority to import, export, distribute or use encryption.
Importers, exporters, distributors and users are responsible for
compliance with U.S. and local country laws. By using this product you
agree to comply with applicable laws and regulations. If you are unable
to comply with U.S. and local laws, return this product immediately.A summary of U.S. laws governing Cisco cryptographic products may be found at:
http://www.cisco.com/wwl/export/crypto/tool/stqrg.htmlIf you require further assistance please contact us by sending email to
export@cisco.com.cisco 2811 (MPC860) processor (revision 0x200) with 60416K/5120K bytes of memory
Processor board ID JAD05190MTZ (4292891495)
M860 processor: part number 0, mask 49
2 FastEthernet/IEEE 802.3 interface(s)
4 Low-speed serial(sync/async) network interface(s)
239K bytes of NVRAM.
62720K bytes of processor board System flash (Read/Write)Configuration register is 0x2102
  1. 查看闪存大小及IOS文件名
R1#show flash: System flash directory:
File  Length   Name/status3   50938004 c2800nm-advipservicesk9-mz.124-15.T1.bin2   28282    sigdef-category.xml1   227537   sigdef-default.xml
[51193823 bytes used, 12822561 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)
  1. 查看接口的简略信息
R1#show ip interface brief Interface              IP-Address      OK? Method Status                ProtocolFastEthernet0/0        192.168.1.251   YES manual up                    upFastEthernet0/1        unassigned      YES unset  administratively down downSerial1/0              192.168.2.1     YES manual up                    upSerial1/1              unassigned      YES unset  administratively down downSerial1/2              unassigned      YES unset  administratively down downSerial1/3              unassigned      YES unset  administratively down downVlan1                  unassigned      YES unset  administratively down down
  1. 查看某接口的详细信息
R1#show interfaces s1/0Serial1/0 is up, line protocol is up (connected)Hardware is HD64570Internet address is 192.168.2.1/24MTU 1500 bytes, BW 128 Kbit, DLY 20000 usec,reliability 255/255, txload 1/255, rxload 1/255Encapsulation HDLC, loopback not set, keepalive set (10 sec)Last input never, output never, output hang neverLast clearing of "show interface" counters neverInput queue: 0/75/0 (size/max/drops); Total output drops: 0Queueing strategy: weighted fairOutput queue: 0/1000/64/0 (size/max total/threshold/drops)Conversations  0/0/256 (active/max active/max total)Reserved Conversations 0/0 (allocated/max allocated)Available Bandwidth 96 kilobits/sec5 minute input rate 0 bits/sec, 0 packets/sec5 minute output rate 0 bits/sec, 0 packets/sec4 packets input, 196 bytes, 0 no bufferReceived 4 broadcasts, 0 runts, 0 giants, 0 throttles0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort0 packets output, 0 bytes, 0 underruns0 output errors, 0 collisions, 1 interface resets0 output buffer failures, 0 output buffers swapped out0 carrier transitionsDCD=up  DSR=up  DTR=up  RTS=up  CTS=up

http://chatgpt.dhexx.cn/article/8JgxleRd.shtml

相关文章

路由器的基本配置(Cisco Packet Tracer )

路由器的基本配置 1.路由器的基本命令 2.路由器的常用查询命令 3.直连路由和静态路由 ​ 直接连到路由器接口的子网被称为直连网络(Directly-Connected Network)。当接口开始工作并配置了IP地址和子网掩码时,路由器自动地将它们的路由加入路由表,被称为直连路由(Directly-Con…

Cisco Packet Tracer路由器的基本配置

要求&#xff1a;通过计算机访问路由器并对其简单的设置包括,路由器名称、端口IP、特权密码、远程登录设置、路由器的模块添加和使用。 设备和条件&#xff1a; 2811路由器一台、Console配置线一根、网线若干、PC机两台 步骤&#xff1a; 1.构建网络拓扑&#xff0c;并分配IP地…

MATLAB神经网络工具箱的使用——Neural Net Fitting app

一、欢迎界面 二、输入输出数据选择 三、数据集分类 四、神经网络结构设置 五、神经网络训练函数选择及训练 其中&#xff0c;训练算法有LM算法、贝叶斯正则化法、量化共轭梯度法。 六、神经网络调整 七、产生神经网络应用函数与simulink块 八、产生神经网络示例代码及结果保存…

卷积神经网络工具PlotNeuralNet在Windows安装并使用

目录 一、安装Git二、安装MikTex三、复制PlotNeuralNet源代码四、使用PlotNeuralNet1.编写python脚本Unet.py2.执行程序Unet.py3.使用Git Bash 一、安装Git Git是一个开源的分布式版本控制系统&#xff0c;可以有效、高速地处理从很小到非常大的项目版本管理。 也是Linus Torva…

如何利用matlab做BP神经网络分析(利用matlab神经网络工具箱)

最近一段时间在研究如何利用预测其销量个数&#xff0c;在网上搜索了一下&#xff0c;发现了很多模型来预测&#xff0c;比如利用回归模型、时间序列模型&#xff0c;GM&#xff08;1,1&#xff09;模型&#xff0c;可是自己在结合实际的工作内容&#xff0c;发现这几种模型预测…

数学建模学习(79):Matlab神经网络工具箱使用,实现多输入多输出预测

最近遇到一个比赛题,要做一个预测,而且还是多输出多输出。开始我选择了一个多输入多输出预测算法进行实现。为了拓展,这里再使用神经网络来实现一下。 文章目录 一、问题描述二、案例实现2.1 读取2.2 训练评估2.3 预测一、问题描述 这个是我们的训练集,文件名为:data3.x…

matlab 神经网络工具箱 nntraintool 详解

概览 Neural Network 该部分展示了神经网络的结构&#xff0c;从结构图中可以看出该网络有三个隐含层&#xff0c;神经元个数分别为9个、8个、7个 Algorithms 该部分展示了该网络所使用的训练算法&#xff0c;可以看出 Data Division&#xff1a;该网络采用随机划分的方法将…

matlab神经网络工具箱关掉ValidationChecks的三种方法

原文来自 老饼玩转-BP神经网络http://bp.bbbdata.com/teach#107 目录 一、Validation Checks是什么 二、怎么关掉Validation Checks 本文讲解matlab神经网络工具箱关掉ValidationChecks的三种方法。 一、Validation Checks是什么 在训练时&#xff0c;会出现遇到达到最大V…

如何利用matlab做BP神经网络分析(包括利用matlab神经网络工具箱)

如何利用matlab做BP神经网络分析&#xff08;包括利用matlab神经网络工具箱&#xff09; 转载&#xff1a;https://blog.csdn.net/xgxyxs/article/details/53265318 最近一段时间在研究如何利用预测其销量个数&#xff0c;在网上搜索了一下&#xff0c;发现了很多模型来预测&…

3.netwox网络工具集入门教程

我是Allen,我的公众号是【CodeAllen】&#xff0c;关注回复【1024】获取资源&#xff0c;程序员技术交流①群&#xff1a;736386324 一个好的辅助工具可以起到事半功倍的效果&#xff0c;在本教程中将使用到两个辅助工具——网络工具集工具 netwox 和网络分析工具 Wireshark。本…

MATLAB快速搭建一个神经网络以及神经网络工具箱的使用

文章目录 0.导读1.神经网络工具箱2.如何利用MATLAB工具箱建立神经网络 人工神经网络学习笔记2——MATLAB神经网络工具箱神经网络工具箱的使用 MATLAB中神经网络工具箱的使用 0.导读 首先声明&#xff0c;这篇文章的内容并不全是本人的原创内容&#xff0c;凡是引用了别人的博客…

matlab:matlab神经网络工具的使用

步骤如下&#xff1a; 1、打开matlab&#xff0c;点击“app”,图示“三角形”图标。 2、图中圈出工具箱&#xff0c;即为神经网络工具箱工具箱。这四种分别为BP、拟合、模式识别和时间序列神经网络。这里我们使用时间序列神经网络。 3、图示&#xff0c;右边即为选择问题处理…

网络工具推荐盘点:助你事半功倍的神奇工具

工具一&#xff1a; Timing是一款非常优秀的学习时间管理APP&#xff0c;它可以帮助用户更好地规划和管理学习时间。该应用程序提供了丰富的工具和功能&#xff0c;包括图书馆、自习室、番茄钟等&#xff0c;让用户可以轻松记录和管理学习时间。 作为一个专注于学习时间管理的…

backtrader股票技术指标自定义与量化回测

01 引言 股票市场自交易以来&#xff0c;人们就开始孜孜不倦地探索各种各样的投资理论&#xff0c;其中技术分析是重要的理论之一。实际上&#xff0c;技术分析是100多年前创建的股票投资理论&#xff0c;是投资者对股票量价变化长期观察归纳总结的若干“规律”。技术分析以市场…

TradingView--自定义技术指标

TradingView 支持自定义指标&#xff0c;不过是把你要定义的指标写成一个 JS&#xff08;customIndex.js&#xff09; 源文件&#xff0c;放在图表库 static 文件夹下。自定义指标 JS 源代码官网模板如下&#xff1a; {// 将<study name>替换为您的指标名称// 它将由图表…

图表背后的秘密 | 技术指标讲解:ATR指标

ATR&#xff08;Average True Range&#xff09;被称为平均真实波幅。起初应用于股票市场分析&#xff0c;主要用于研判买卖时机&#xff0c;是显示市场变化率的反趋向指标&#xff0c;由威尔德1978年在其书中提出&#xff0c;目前已成为众多指标经常引用的技术量。 ATR指标的计…

PLC系统中的5个技术指标

在工业自动化控制中&#xff0c;经常会遇到开关量、数字值、模拟值、离散值、脉冲值等各种概念&#xff0c;人们在实际应用中很容易混淆这些概念。各种概念如下: 1.开关量:一般指触点的“开”和“关”状态&#xff0c;计算机设备中也常用“0”或“1”来表示开关量的状态。开关量…

传统技术指标有效性的量化分析

投资要点 技术分析源远流长&#xff0c;最早可追溯到查尔斯.亨利.道对股票移动平均数&#xff08;MA&#xff09;的研究&#xff0c;至今已走过100多年的发展历程。这些技术指标尤其是那些常见的、经典的、传统的指标&#xff0c;已经成为普通投资者普遍熟知和使用的研判工具&…

性能测试指标之业务指标和技术指标如何进行区别

通过业务指标 转化我们的技术指标&#xff0c;用户 第三方客户&#xff0c; 公司内部产品经理 产品经理 会提出产品业务指标&#xff0c;需要对业务指标进行挖掘&#xff0c;提出测试场景 业务指标会转化成相对应的技术指标 时间指标 平均响应时间 最大响应时间 最小的响…

用Python绘制MACD、KDJ、布林线技术指标图

背景介绍&#xff1a; 搭建程序化交易平台的过程需要研究技术指标。 环境&#xff1a; OS&#xff1a;mac PYTHON: 3.8 IDE: pycharm 步骤&#xff1a; 第一步&#xff1a;加载库 import pandas as pd import pandas_datareader as web from datetime import datetime, …