加入收藏 | 设为首页 | 会员中心 | 我要投稿 源码门户网 (https://www.92codes.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

路由器怎么登录 路由器几种登录方式说明

发布时间:2021-12-13 12:45:24 所属栏目:教程 来源:互联网
导读:专业路由器登陆的话和普通路由器还是有很大分别的,主要有三种: 本地登陆 console口登录 web登录 远程登录 telnet登录 ssh登录 本次注意讲解主要以cisco 2800路由器为主,登录方式中的web登录将不会讲解。 专业路由器的几种登录方式 图 console口登录 con
 专业路由器登陆的话和普通路由器还是有很大分别的,主要有三种:
 
  本地登陆
 
  console口登录
 
  web登录
 
  远程登录
 
  telnet登录
 
  ssh登录
 
  本次注意讲解主要以cisco 2800路由器为主,登录方式中的web登录将不会讲解。
 
  专业路由器的几种登录方式 图
 
  console口登录
 
  console口登陆需要准备 Console线 、 USB to RS232接头 和 终端登陆软件SecureCRT。
 
  专业路由器的几种登录方式—— CONSCOL线
 
  专业路由器的几种登录方式—— USB to RS232接头
 
  专业路由器的几种登录方式—— seccureCRT
 
  在这里要注意的是 USB to RS232接头插上电脑安装驱动后会显示自己的编号:比如上面我的电脑里面就是com4、波特率选择9600、数据位8、奇偶校验none、停止位1。
 
  在运用console登录是需要设置控制台登录密码和特权密码
 
  1.控制台密码的配置方式
 
  Router>enable //进入特权模式
 
  Router#configure terminal //进入全局模式
 
  Enter configuration commands, one per line. End with CNTL/Z.
 
  Router(config)#line console 0 进入console口
 
  Router(config-line)#password zhang //设置密码为zhang
 
  Router(config-line)#login //启用本地认证
 
  2.特权密码的配置方式
 
  Router>en
 
  Router#configure terminal
 
  Enter configuration commands, one per line. End with CNTL/Z.
 
  Router(config)#enable password zhang //设置密码为zhang
 
  Router(config)#enable secret zhang //加密密码
 
  telnet登录
 
  路由器的配置
 
  Router>enable //进行特权模式
 
  Router#conf t // 进入全局配置模式
 
  Router(config)#enable secret zhang //配置特权加密口令
 
  Router(config)#line vty 0 15 //进入虚拟线路模式
 
  Router(config-line)#pass zhang //配置虚拟线路口令(telnet 登录密码)
 
  Router(config-line)#login //强制登录
 
  Router(config-line)#exit //退出虚拟线路模式
 
  Router(config)#int f0/1 //进入接口配置模式(路由器必须有IP地址,telnet才能登录)
 
  Router(config-if)#ip add 192.168.0.1 255.255.255.0 //配置IP地址
 
  Router(config-if)#no shut //激活端口
 
  Router(config-if)#exit //退出接口模式
 
  Router(config)#exit //退出全局配置模式
 
  Router#copy run start //保存配置
 
  Destination filename [startup-config]?
 
  Building configuration...
 
  [OK]
 
  SSH登录
 
  telnet 传输采用的是明文传输,登录密码可能会泄露,为了安全传输可以采用SSH登录方式。
 
  Router#conf t
 
  Router(config)#hostname henglangkeji //配置主机名
 
  henglangkeji(config)ip domain-name henglangkeji.cn
 
  henglangkeji(config)#crypto key generate rsa //生成RSA密钥对
 
  The name for the keys will be: henglangkeji.cn
 
  Choose the size of the key modulus in the range of 360 to 2048 for your
 
  How many bits in the modulus [512]: 1024 //建议模数长度1024
 
  % Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
 
  henglangkeji(config)#ip ssh time 120//设置ssh时间为120秒
 
  henglangkeji(config)#ip ssh authentication 4//设置ssh认证重复次数为4,可以在0-5之间选择
 
  henglangkeji(config)#username admin pass zhang //创建用户名和密码
 
  henglangkeji(config)#line vty 0 15 //进入虚拟线路模式
 
  henglangkeji(config-line)#transport input ssh //启用SSH,阻止其它连接
 
  henglangkeji(config-line)#login local //启用本地身份认证
 
  注意:
 
  为什么SSH配置需要一个域名呢,在配置SSH登录时,要生成一1024位RSA key,那么key的名字是以路由器的名字与DNS域名相接合为名字。
 
  如果输入错误老是出现域名解析可以试用 no ip domin-lookup 禁掉!
 
  不让日志消息打扰你的配置过程
 
  Cisco IOS中另一个我认为的小缺点就是在我配置路由器时,控制台界面就不断弹出日志消息(可能是控制台端口,AUX端口或VTY端口)。要预 防这一点,你可以这样做。
 
  所以在每一条端口线路上,我运用日志同步命令。举例如下:
 
  henglangkeji(config)# line con 0
 
  henglangkeji(config-line)# logging synchronous
 
  henglangkeji(config)# line aux 0
 
  henglangkeji(config-line)# logging synchronous
 
  henglangkeji(config)# line vty 0 4
 
  henglangkeji(config-line)# logging synchronous

(编辑:源码门户网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读