一些命令

关闭DNS查询功能

Router(config)#no ip domain-lookup

默认情况下,路由器的DNS查询是启用的,即当你错误的输入一条Cisco ISO软件无法识别的命令的时候,路由器会把这个命令当成主机名,然后向DNS服务器进行查询。一般实验性的环境中,如果我们没有DNS服务器,因为输入错误的命令而造成无用的查询,是非常耗时的,因此我们可以选择关闭这一功能。

假如你在你的网络里有DNS服务器,可以使用下列命令使DNS解析开始工作:
1.第一条命令是:ip domain-lookup,这个命令默认是打开了的.如果你之前使用了no ip domain-lookup的话,就要用这条命令打开它
2.第二条命令是:ip name-server.设置DNS服务器的IP地址,可以使1个IP地址对应多达6个服务器
3.最后条命令是:ip domain-name.虽然这个命令是可选的,但是最好还是设置一下

如:

Router(config)#ip domain-lookup
Router(config)#ip name-server 192.168.0.23
Router(config)#ip domain-name noko.com


IOS软件的几种模式
普通用户模式:
开机直接进入普通用户模式,在该模式下我们只能查询路由器的一些基础信息,如版本号(show version)。    
Router>

特权模式:在普通用户模式下输入enable命令即可进入特权模式,在该模式下我们可以查看路由器的配置信息和调试信息等等。   
Router#

全局配置模式:在特权用户模式下输入configure terminal命令即可进入全局配置模式,在该模式下主要完成全局参数的配置。

Router(config)#
接口配置子模式:在全局配置模式下输入interface interface-list即可进入接口配置模式,在该模式下主要完成接口参数的配置。   
Router(config-if)#

show命令查看路由器的各种信息

show version:可以查看IOS版本信息、Rom版本信息、开机时间、IOS的映象文件名、物理 接口,存储器大小,及配置寄存器值

show flash:可以查看flash中文件目录结构,flash的空间使用情况

show running-config: 查看路由器的全部配置情况

show startup-config:查看路由器的初始配置情况

另外:

Router#show history显示历史

Router#terminal history size 100

//将路由器能够显示历史命令的空间扩大到100


关于exec-timeout X X

exec-timeout 5 0
设置在登录路由器后,不做任何操作的情况下,5分0秒后将与路由器断开。如果不输入此命令,当你进入路由器没有输入任何内容时,10分钟后将被路由器自动踢出。
“exec-timeout”命令的完整形式为:exec-timeoutx x (也就是exec-timeout 分 秒)
注:如果你在此输入“exec-timeout 0 0”则表示你将永远与路由器保持联接,除非你自己logout。
Router>enable
Router#config terminal
Router(config)#enable secret houyong
Router(config)#line console 0
Router(config-line)#password cisco
Router(config-line)#login
Router(config-line)#exit
Router(config)#line vty 0 4
Router(config-line)#password class
Router(config-line)#login
Router(config-line)#exit
Router(config)#line console 0
Router(config-line)#exec-timeout 0 15
//15秒钟后
Press RETURN to get started.
User Access Verification
Password:
Router>enable
Password:
Router#
//两次密码分别为cisco、houyong


debug命令

Router#debug ?      //用上下文帮助查看debug包含子命令
  aaa           AAA Authentication, Authorization and Accounting
  crypto        Cryptographic subsystem
  custom-queue  Custom output queueing
  eigrp         EIGRP Protocol information
  ephone        ethernet phone skinny protocol
  frame-relay   Frame Relay
  ip            IP information
  ipv6          IPv6 information
  ntp           NTP information
  ppp           PPP (Point to Point Protocol) information
Router#debug ip ?
  icmp     ICMP transactions
  inspect  Stateful inspection events
  nat      NAT events
  ospf     OSPF information
  packet   Packet information
  rip      RIP protocol transactions
  routing  Routing table events
Router#debug ip icmp      //开始检测ICMP协议
ICMP packet debugging is on
Router#ping 192.168.1.1   //用ping来做测试

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)   
Router#no debug ip packet    //只关闭对ip packet的检测
Packet debugging is off
Router#show debug      //查看检测项目
ICMP packet debugging is on
Router#no debug all      //关闭对所有项目的检测
All possible debugging has been turned off
Router#show debug
Router#


setup命令
从特权模式下面键入setup命令就可以进入安装(配置会话)模式,或者当路由器的NVRAM中没有配置文件时,也会自动进入安装模式对话。
如果NVRAM中有配置文件存在,可以用erase nvram清空NVRAM,reload重启动路由器,就可以进入安装模式了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值