2022年2022年路由器交换机基本配 .pdf
一、配置路由器密码1、console password RouterenRouter#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#line console 0 Router(config-line)#login (该项为登陆检测, 不要忘记)Router(config-line)#password ciscoRouter(config-line)#exit Router(config)#exit %SYS-5-CONFIG_I: Configured from console by console Router#exit 执行这条命令后显示如下Router con0 is now available Press RETURN to get started. 再回车显示User Access V erification Password: (此处需要输入密码: cisco )Router 2、设置虚拟终端密码(Virtual Terminal Password )Routeren Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#line vty 0 4 Router(config-line)#login (该项为登陆检测, 不要忘记)% Login disabled on line 66, until password is set % Login disabled on line 67, until password is set % Login disabled on line 68, until password is set % Login disabled on line 69, until password is set % Login disabled on line 70, until password is set Router(config-line)#password sanjoseRouter(config-line)# 3、设置 Enable passwrod 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 4 页 - - - - - - - - - Routeren Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#enable password 123 (全局模式下执行该命令)Router(config)#Z (ctrl+z)%SYS-5-CONFIG_I: Configured from console by console Router#exit (退出)Router con0 is now available Press RETURN to get started. Routeren Password: (此处需要输入密码: sanjose )Router#4、设置 Enable secretRouteren Router#conf tEnter configuration commands, one per line. End with CNTL/Z. Router(config)#enable secret sanfranRouter(config)# Enable password和 enable secret的区别:Enable password ,密码以明文形式显示;enable secret,密码以密文形式显示。在两者同时存在的情况下,enable secret起作用。5、 删除密码Router(config)#no login (登陆不检测)Router(config)#no enable password (或 secret )在计算机中利用 telnet 进行远程登录,必须要先在路由器中设置console密码和vty 密码,之后再 PC 中输入 telnet 192.168.0.1,如下:PCtelnet 192.168.0.1 Trying 192.168.0.1 . User Access V erification Password: 输入 console密码Password: 输入 vty 密码进入路由器后Routeren Password: 输入 enable password ,如果设置了enable secret则输入 enable secret密码。Router# 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 4 页 - - - - - - - - - 二、配置端口 IP 地址Routeren Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int fa0/0 Router(config-if)# ip address 192.168.0.1 255.255.255.0 Router(config-if)# no shutdown (该项为激活端口,不要忘记)%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up Router(config-if)# 三、存储配置文件Routeren Router#copy run start (在特权模式下)Destination filename startup-config? Building configuration. OK 四、更改名字RouterenRouter#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname r1 r1(config)# 五、端口描述r1enr1#conf t r1(config)#int fa0/0r1(config-if)# description miaoshuxinxi (对 fa0/0 的端口描述进行设置)r1(config-if)# exit r1(config)#exitr1#show run (可先在特权模式下用show run 命令查看端口的描述信息,配置完后再用该命令查看端口的描述信息)Building configuration. 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 4 页 - - - - - - - - - Current configuration : 399 bytes version 12.4 no service password-encryption hostname r1 ! ip ssh version 1 ! interface FastEthernet0/0 description miaoshuxinxi (此处为设定的描述内容 ) ip address 192.168.0.1 255.255.255.0 duplex auto speed auto 六、显示登录信息r1enr1#conf t Enter configuration commands, one per line. End with CNTL/Z. r1(config)#banner motd # zai ci xian shi deng lu hou xian shi de xin xi! # (显示登录后的信息, 以#开始,以 # 结束)r1(config)#exit%SYS-5-CONFIG_I: Configured from console by console r1#copy run start (特权模式下执行该命令)Destination filename startup-config? Building configuration. OK r1#exitr1 con0 is now available Press RETURN to get started. zai ci xian shi deng lu hou xian shi de xin xi! r1 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 4 页,共 4 页 - - - - - - - - -