专业路由器登陆的话和普通路由器还是有很大分别的,主要有三种:
本地登陆
console口登录
web登录
远程登录
telnet登录
ssh登录
本次注意讲解主要以cisco2800路由器为主,登录方式中的web登录将不会讲解。
专业路由器的几种登录方式图
console口登录
console口登陆需要准备console线、usbtors232接头和终端登陆软件securecrt。
专业路由器的几种登录方式——conscol线
专业路由器的几种登录方式——usbtors232接头
专业路由器的几种登录方式——seccurecrt
在这里要注意的是usbtors232接头插上电脑安装驱动后会显示自己的编号:比如上面我的电脑里面就是com4、波特率选择9600、数据位8、奇偶校验none、停止位1。
在运用console登录是需要设置控制台登录密码和特权密码
1.控制台密码的配置方式
router>enable//进入特权模式
router#configureterminal//进入全局模式
enterconfigurationcommands,oneperline.endwithcntl/z.
router(config)#lineconsole0进入console口
router(config-line)#passwordzhang//设置密码为zhang
router(config-line)#login//启用本地认证
2.特权密码的配置方式
router>en
router#configureterminal
enterconfigurationcommands,oneperline.endwithcntl/z.
router(config)#enablepasswordzhang//设置密码为zhang
router(config)#enablesecretzhang//加密密码
telnet登录
路由器的配置
router>enable//进行特权模式
router#conft//进入全局配置模式
router(config)#enablesecretzhang//配置特权加密口令
router(config)#linevty015//进入虚拟线路模式
router(config-line)#passzhang//配置虚拟线路口令(telnet登录密码)
router(config-line)#login//强制登录
router(config-line)#exit//退出虚拟线路模式
router(config)#intf0/1//进入接口配置模式(路由器必须有ip地址,telnet才能登录)
router(config-if)#ipadd192.168.0.1255.255.255.0//配置ip地址
router(config-if)#noshut//激活端口
router(config-if)#exit//退出接口模式
router(config)#exit//退出全局配置模式
router#copyrunstart//保存配置
destinationfilename[startup-config]?
buildingconfiguration...
[ok]
ssh登录
telnet传输采用的是明文传输,登录密码可能会泄露,为了安全传输可以采用ssh登录方式。
router#conft
router(config)#hostnamehenglangkeji//配置主机名
henglangkeji(config)ipdomain-namehenglangkeji.cn
henglangkeji(config)#cryptokeygeneratersa//生成rsa密钥对
thenameforthekeyswillbe:henglangkeji.cn
choosethesizeofthekeymodulusintherangeof360to2048foryour
howmanybitsinthemodulus[512]:1024//建议模数长度1024
%generating1024bitrsakeys,keyswillbenon-exportable...[ok]
henglangkeji(config)#ipsshtime120//设置ssh时间为120秒
henglangkeji(config)#ipsshauthentication4//设置ssh认证重复次数为4,可以在0-5之间选择
henglangkeji(config)#usernameadminpasszhang//创建用户名和密码
henglangkeji(config)#linevty015//进入虚拟线路模式
henglangkeji(config-line)#transportinputssh//启用ssh,阻止其它连接
henglangkeji(config-line)#loginlocal//启用本地身份认证
注意:
为什么ssh配置需要一个域名呢,在配置ssh登录时,要生成一1024位rsakey,那么key的名字是以路由器的名字与dns域名相接合为名字。
如果输入错误老是出现域名解析可以试用noipdomin-lookup禁掉!
不让日志消息打扰你的配置过程
ciscoios中另一个我认为的小缺点就是在我配置路由器时,控制台界面就不断弹出日志消息(可能是控制台端口,aux端口或vty端口)。要预防这一点,你可以这样做。
所以在每一条端口线路上,我运用日志同步命令。举例如下:
henglangkeji(config)#linecon0
henglangkeji(config-line)#loggingsynchronous
henglangkeji(config)#lineaux0
henglangkeji(config-line)#loggingsynchronous
henglangkeji(config)#linevty04
henglangkeji(config-line)#loggingsynchronous