Chinaunix首页 | 论坛 | 博客
  • 博客访问: 8045
  • 博文数量: 1
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 10
  • 用 户 组: 普通用户
  • 注册时间: 2017-06-21 08:01
文章分类

全部博文(1)

文章存档

2017年(1)

我的朋友
最近访客

分类:

2017-06-21 08:11:36

配置过程:
Router>enable  //进入该路由器
Router#configure terminal   //进入全局配置模式
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#line con 0  //设置从全局配置模式进入控制台线路配置模式
Router(config-line)#logging syn  //同步,使命令输入时,不会被系统弹出的打印信息中断
在线路配置时,还可以用下句命令来设置控制台的等待时间,此例中设置为0 0,意思是0分0秒。假如将会话时间设置为5分钟,那么如果用户在5分钟之内没有敲击键盘,换句话说在一定的时间段(5分钟)内“闲着”时,路由器会自动将用户注销。
Router(config-line)#exec-timeout 0 0

Router(config-line)#exit //退出线路配置
Router(config)#interface e1/1 //进入接口e1/1, 即Ethernet 1/1
Router(config-if)#ip address 10.0.1.2 255.255.255.0  //设置ip地址和子网掩码
Router(config-if)#no shutdown //激活当前接口
Router(config-if)#exit
Router(config)#
*Jan 31 14:44:44.459: %LINK-3-UPDOWN: Interface Ethernet1/1, changed state to up
*Jan 31 14:44:45.459: %LINEPROTO-5-UPDOWN: Line protocol on Interface Ethernet1/1, changed state to up
Router(config)#router rip  //启动RIP路由协议
Router(config-router)#version 2  //常用version 2
Router(config-router)#network 10.0.1.0  //设置发布路由
Router(config-router)#no auto-summary  //关闭路由协议的自动汇总功能,主要是为了解决不连续子网互相访问的问题,在这种情况下都会关闭自动汇总,
Router(config-router)#end  //退出且保存
Router#

常用命令缩写:
Cisco IOS还提供了良好的命令简化功能,例如,可以将show interface简写为sh int,在对交换机进行操作时就完全没有必要将命令输全。使用Tab键输入剩余。
int = interface
con = console
no sh = no shutdown
config = configure



常用命令汇总:

如果要彻底退出或者的配置模式,使用ctrl+z;

exit是返回上层配置模式;

end退出且保存;

ctrl+z直接退出


路由器显示命令:

router#show run ;显示配置信息
router#show interface ;显示接口信息
router#show ip route ;显示路由信息
router#show cdp nei ;显示邻居信息
router#reload     ;重新起动

路由器口令设置:

router>enable ;进入特权模式
router#config terminal ;进入全局配置模式
router(config)#hostname ;设置交换机的主机名
router(config)#enable secret xxx ;设置特权加密口令
router(config)#enable password xxb ;设置特权非密口令
router(config)#line console 0 ;进入控制台口
router(config-line)#line vty 0 4 ;进入虚拟终端
router(config-line)#login ;要求口令验证
router(config-line)#password xx ;设置登录口令xx
router(config)#(Ctrl+z) ; 返回特权模式
router#exit ;返回命令

路由器配置:

router(config)#int s0/0 ;进入Serail接口
router(config-if)#no shutdown ;激活当前接口
router(config-if)#clock rate 64000 ;设置同步时钟
router(config-if)#ip address ;设置IP地址
router(config-if)#ip address second ;设置第二个IP
router(config-if)#int f0/0.1 ;进入子接口
router(config-subif.1)#ip address ;设置子接口IP
router(config-subif.1)#encapsulation dot1q ;绑定vlan中继协议
router(config)#config-register 0x2142 ;跳过配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引导

路由器文件操作:

router#copy running-config startup-config ;保存配置
router#copy running-config tftp ;保存配置到tftp
router#copy startup-config tftp ;开机配置存到tftp
router#copy tftp flash: ;下传文件到flash
router#copy tftp startup-config;下载配置文件

ROM状态:
Ctrl+Break ;进入ROM监控状态
rommon>confreg 0x2142 ;跳过配置文件
rommon>confreg 0x2102 ;恢复配置文件
rommon>reset  ;重新引导
rommon>copy xmodem: flash: ;从console传输文件

rommon>IP_ADDRESS=10.65.1.2 ;设置路由器IP
rommon>IP_SUBNET_MASK=255.255.0.0 ;设置路由器掩码
rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP服务器IP
rommon>TFTP_FILE=c2600.bin ;指定下载的文件
rommon>tftpdnld ;从tftp下载
rommon>dir flash: ;查看闪存内容
rommon>boot ;引导IOS

静态路由:

ip route ;命令格式
router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;静态路由举例
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默认路由举例

动态路由:

router(config)#ip routing ;启动路由转发
router(config)#router rip ;启动RIP路由协议。
router(config-router)#network ;设置发布路由
router(config-router)#negihbor ;点对点帧中继用。




阅读(3506) | 评论(0) | 转发(0) |
0

上一篇:没有了

下一篇:没有了

给主人留下些什么吧!~~