路由基本配置 思科路由命令

2020年05月10日 · 技术帮助分享 · 网络工程 · 879次阅读

------正---文------

路由器的基本配置

router> ---用户模式

router>enable ---用户进入特权模式

router# ---特权模式(查看、调试、保存)

router#terminal history size 10 ---终端历史大小为10

router#configuer terminal ---特权模式进入全局配置模式

router(config)# ---全局配置模式(整个设备的功能开启、关闭、修改)

router#clock set hh:mm:ss date year ---修改时间

router(config)#hostname xxx ---修改主机名

banner motd 终止符 xxx终止符 ---设置标语

router#show running-config ---查看正在运行的配置

copy running-config startup-config ---保存(多输入几遍)

router(config)#interface fastethernet 0/1 ---进入端口

router(config-if)#no shutdown ---端口打开

交换机基本配置:

同路由器

switch#show version ---查看版本号

show interfaces fastethernet 0/1 ---查看端口状态

用户模式密码设置:

switch(config)#enable password xxx ---密码明文显示

enable secret xxx ---密码密文显示(优先)

console密码:

switch(config)#line console 0 ---进入console线缆配置模式

switch(config-line)#logging synchronous ---光标跟随

switch(config-line)#exec-timeout 分钟 秒钟 ---执行超时

switch(config-line)#password xxx ---设置密码为xxx

login ---启用密码登录

switch(config)#service password-encryption

---自动把所有明文密码加密显示(单向,关闭设置密文不恢复)

switch(config)#show ip interface brief ---显示接口有关信息

 

 

三层连通性:

连接pc,给pc配置ip地址(192.168.1.1 255.255.255.0)

switch(config)#interface vlan 1 ---进入接口管理模式

switch(config-if)#no shutdown ---打开接口

switch(config-if)#ip address 192.168.1.2 255.255.255.0

 

远程登录:

telnet:明文传送

1.no login ---无需密码登陆

switch(config)#line vty 0 4 ---进入vty线缆配置模式

switch(config-line)#no login ---无需密码登录

2.login password ---需要密码登录

switch(config)#line vty 0 4 ---进入vty线缆配置模式

switch(config-line)#password xxx ---设置密码为xxx

switch(config-line)#login ---启用密码登录

3.login local ---使用本地用户名和密码登录

switch(config)#line vty 0 4 ---进入vty线缆配置模式

switch(config-line)#login local ---使用本地的用户名和密码登录

switch(config)#username xxx password ttt

---建立本地的用户名和密码数据库(可建立多个)

SSH:加密传送

switch(config)#hostname xxx ---修改主机名为xxx

switch(config)#ip domain-name xxx.nj.com ---设置域名为xxx.nj.com

switch(config)#line vty 0 4 ---进入vty线缆配置模式

switch(config-line)# login local ---使用本地用户名和密码登录

switch(config)#username xxx password kkk ---建立本地的用户名和密码数据库

switch(config)#line vty 0 4 ---进入线缆配置模式

switch(config-line)#transport input ssh ---制定只能使用ssh登录

switch(config)#crypto key generate rsa

---使用RSA算法对密钥加密(show running-config中不显示)

登录验证:ssh -L 用户名 目标地址


感谢【萌卜兔's】博主提供。


------结---束------

推广:AI工具网 | 专注人工智能工具推荐!
『静谧星河』采用《署名-相同方式共享 4.0 国际》进行许可。如需转载请保留本文地址。
本文地址:
https://www.yuvin.cn/help/380.html
AD

支持我

教程帮助解决方法网工思科

静谧星河最后编辑于4年前


因本站不提供交互式服务,评论均需审核后显示,敬请谅解。

添加新评论

captcha

请输入验证码