4.网络设备基础配置实验

实验一:设备基本配置

在这里插入图片描述1.为路由器接口配置IP地址
2.为PC机配置IP地址信息实现局域网通信。
为路由器接口配置IP地址:
R1(config)#interface f0/0
R1(config-if)#(接口模式)
R1(config-if)# ip address 192.168.10.152 255.255.255.0(原为254被占用了换成152了)
在这里插入图片描述在这里插入图片描述为PC机配置IP地址信息:
在这里插入图片描述在这里插入图片描述R1(config-if)#no shutdown(开启端口)
在这里插入图片描述PC0能和PC1通信,即实现局域网通信:
在这里插入图片描述查看配置:
R1(config-if)#do show running-config 查看运行配置文件
(或R1#show running-config)
在这里插入图片描述R1(config-if)# do copy running-config startup-config
(或R1#copy running-config startup-config)
R1(config-if)#do show startup-config 查看启动配置文件
(或R1#show startup-config)
在这里插入图片描述R1#erase startup-config 删除配置
在这里插入图片描述

实验二:设备安全配置

设置服务器IP地址:
在这里插入图片描述在这里插入图片描述1.配置文件一定要备份
R1#copy startup-config tftp:(将启动配置文件复制到tftp)
Address or name of remote host []?192.168.10.3(服务器IP地址)(目标主机)
Destination filename[Router-config]?(目标文件名)
在这里插入图片描述点击服务器,查看备份启动配置文件成功:
在这里插入图片描述2.配置文件还原
R1#copy tftp:startup-config
Address or name of remote host []?192.168.10.3
Source filename []?Router-confg
Destination filename[startup-config]?
在这里插入图片描述3.配置密码
(1)配置特权模式密码
R2(config)#enable password 123456(明文密码)
进入特权模式需要密码:
在这里插入图片描述R2(config)#enable secret 67890 (密文密码)
当明文密码和密文密码两种都存在时密文生效:(输入123456无效,67890有效)
在这里插入图片描述(2)配置console密码
方法一:
R2(config)#line console 0
R2(config-line)#password 666666
R2(config)#login
进入用户模式需要输入密码:
在这里插入图片描述方法二:
配置用户名和密码登录:
R2(config)#username admin password 888888 产生本地的用户名和密码
R2(config)#line console 0
R2(config-line)#login local (设置本地用户名密码登录)
进入用户模式需要输入本地用户名和密码
在这里插入图片描述

实验三:远程管理设备

远程管理设备有两种方式:
(1)telnet远程管理设备,明文传输
开虚拟终端,为虚拟终端设置密码:
R2(config-line)#enable secret 67890
R2(config)#username admin password 888888
R2(config)#line vty 0 4
R2(config-line)#login local
PC机:
terminal:
PC>telnet 192.168.10.152
Username:admin
Password:888888
Router>enable
password:67890
在这里插入图片描述(2)SSH远程管理网络设备
R1(config)#hostname R1
R1(config)#ip domain-name zlt.com(设置域名)
R1(config)#crypto key generate rsa 设置密码加密方式为RSA(加密方式)
How many bits in the modulus [512]: 1024加密长度
R1(config)#username admin privilege 0 (设置安全级别为0)
R1(config)#line vty 0 4
R1(config-line)#exec-timeout 10 0 超时时间为10分钟
R1(config-line)#logging synchronous 日志同步
R1(config-line)#login local 使用本地用户名和密码登录
R1(config-line)#transport input ssh 使用ssh登录
在这里插入图片描述PC机使用ssh登录:
在这里插入图片描述在这里插入图片描述(3)交换机如何配置远程管理
(1)硬件的连接
(2)软件的设置
(3)交换机Telnet的配置
设置PC的IP地址:
在这里插入图片描述Switch>en
Switch#conf t
Switch(config)#int vlan 1
Switch(config-if)#ip add 192.168.1.1 255.255.255.0 /设置管理交换机的IP地址
Switch(config-if)#no shutdown /启用接口
Switch(config-if)#ex
Switch(config)#enable secret 0 1234 (密文密码) /配置进入特权模式的密码为1234
Switch(config)#line vty 0 4 /进入VTY端口
Switch(config-line)#password 4321 /设置Telnet的登录密码为4321
Switch(config-line)#login /允许Telnet登录
4.验证
在这里插入图片描述(4)配置AAA认证
a.console线
R1(config)#username admin 1 password Admin 1
R1(config)#aaa new-model
R1(config)#aaa authentication login default local
R1(config)#line console 0
R1(config-line)#login authentication default
b.VTY线
R1(config)#aaa authentication login telnet-login local
R1(config)#line vty 0 4
R1(config)#login authentication telnet-login

实验四:IOS备份、还原、升级

1.硬件的连接
2.软件的设置
3.交换机的配置

升级IOS
Switch#copy tftp: flash:
Address or name of remote host []? 192.168.10.3
Source filename []?

备份IOS
Switch#show flash
Switch#copy flash: tftp:
Source filename []? runningcof
Address or name of remote host []? 192.168.10.3
Destination filename [runningcof]?

实验五:如果路由器密码忘记了怎么办?

关闭路由器电源并重新开机,当控制台出现启动过程时,赶快按【Ctrl+Break】键中断 路由器的启动过程,进入rommon模式。
3
在rommon模式,输入confreg 0x2142,改变配置寄存器的值为0x2142,这会使得路由器开机不读取NVRAM中配置文件,从而跳过密码验证。
在这里插入图片描述4
重启路由器。路由器重启后会直接进入到setup配置模式,使用【Ctrl+C】键或者回答”n”退出setup模式,
在这里插入图片描述由于没有读取NVRAM的配置文件,所以此时是没有任何配置的,也就没有了密码。直接进入配置界面。
在这里插入图片描述6
进入全局配置界面,输入 config-register 0x2102
把寄存器的值恢复为正常值0x2102
再退回到用户界面 ,保存退出重启。
在这里插入图片描述在这里插入图片描述7
reload 回车,路由器将重启,并恢复到初始状态,此时可进行相关其它设置了

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值