路由交换之---------------路由器上一些好用的命令


setup  重启启动配置文件


fwc01>

fwc01>

fwc01>en

fwc01>enable 

Password: 

fwc01#setup



         --- System Configuration Dialog ---


Continue with configuration dialog? [yes/no]: 



?   列出所有的参数或者子命令

fwc01#e ?

% Ambiguous command: "e "

fwc01#e?

enable  erase  exit  

fwc01#e



tab  补全命令,当你输入前面一部分字母时,tab可以补足,假如没有反应,那么可能你所在的模式有问题


show history        查看历史命令


fwc01#show histo

fwc01#show history 

  enable 

  setup

  show history 

fwc01#




terminal history size 数字   修改历史命令的条数


fwc01#show history 

  enable 

  setup

  show history 

  terminal history size 5

  show history 

fwc01#terminal history size 4

fwc01#show history 

  terminal history size 5

  show history 

  terminal history size 4

  show history 

 



arp -a  查看当前的arp缓存


C:\Users\Administrator>arp -a


接口: 192.168.1.106 --- 0xd

  Internet 地址         物理地址              类型

  192.168.1.1           00-5a-39-05-98-14     动态

  192.168.1.112         0c-d2-92-76-0d-2c     动态

  192.168.1.255         ff-ff-ff-ff-ff-ff     静态

  224.0.0.22            01-00-5e-00-00-16     静态

  224.0.0.251           01-00-5e-00-00-fb     静态

  224.0.0.252           01-00-5e-00-00-fc     静态

  239.1.1.1             01-00-5e-01-01-01     静态

  239.1.1.29            01-00-5e-01-01-1d     静态

  239.11.20.1           01-00-5e-0b-14-01     静态

  239.255.255.250       01-00-5e-7f-ff-fa     静态

  255.255.255.255       ff-ff-ff-ff-ff-ff     静态


接口: 192.168.121.1 --- 0xf

  Internet 地址         物理地址              类型

  192.168.121.255       ff-ff-ff-ff-ff-ff     静态

  224.0.0.22            01-00-5e-00-00-16     静态

  224.0.0.251           01-00-5e-00-00-fb     静态

  224.0.0.252           01-00-5e-00-00-fc     静态

  239.1.1.1             01-00-5e-01-01-01     静态

  239.1.1.29            01-00-5e-01-01-1d     静态

  239.11.20.1           01-00-5e-0b-14-01     静态

  239.255.255.250       01-00-5e-7f-ff-fa     静态


接口: 192.168.3.1 --- 0x10

  Internet 地址         物理地址              类型

  192.168.3.255         ff-ff-ff-ff-ff-ff     静态

  224.0.0.22            01-00-5e-00-00-16     静态

  224.0.0.251           01-00-5e-00-00-fb     静态

  224.0.0.252           01-00-5e-00-00-fc     静态

  239.1.1.1             01-00-5e-01-01-01     静态

  239.1.1.29            01-00-5e-01-01-1d     静态

  239.11.20.1           01-00-5e-0b-14-01     静态

  239.255.255.250       01-00-5e-7f-ff-fa     静态


C:\Users\Administrator>




show arp   查看arp缓存(路由器和交换机一样)


fwc01#show arp


fwc01#




查看快速以太网接口0/0的参数


fwc01#show interfaces fastEthernet 0/0

FastEthernet0/0 is up, line protocol is down (disabled)

  Hardware is Lance, address is 0007.ecc3.4d01 (bia 0007.ecc3.4d01)

  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,

     reliability 255/255, txload 1/255, rxload 1/255

  Encapsulation ARPA, loopback not set

  ARP type: ARPA, ARP Timeout 04:00:00, 

  Last input 00:00:08, output 00:00:05, output hang never

  Last clearing of "show interface" counters never

  Input queue: 0/75/0 (size/max/drops); Total output drops: 0

  Queueing strategy: fifo

  Output queue :0/40 (size/max)

  5 minute input rate 0 bits/sec, 0 packets/sec

  5 minute output rate 0 bits/sec, 0 packets/sec

     0 packets input, 0 bytes, 0 no buffer

     Received 0 broadcasts, 0 runts, 0 giants, 0 throttles

     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort

     0 input packets with dribble condition detected

     0 packets output, 0 bytes, 0 underruns

     0 output errors, 0 collisions, 1 interface resets

     0 babbles, 0 late collision, 0 deferred

     0 lost carrier, 0 no carrier

     0 output buffer failures, 0 output buffers swapped out

fwc01#



给路由器改名


fwc01#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

fwc01(config)#host

fwc01(config)#hostname fwc

fwc(config)#




修改路由器的加密使能密码


fwc(config)#enable secret 123456

fwc(config)#exit

fwc#

%SYS-5-CONFIG_I: Configured from console by console

fwc#exit

fwc con0 is now available

Press RETURN to get started.

fwc>en

fwc>enable 

Password:    //123456

fwc#





修改路由器接口的IP地址

fwc(config-if)#ip address 192.168.1.100 255.255.255.0

% 192.168.1.0 overlaps with Vlan1    //同一路由器的不同接口,不能呢个配置成相同的网段

                        因为vlan1的ip是192.168.1.100 所以不可以

fwc(config-if)#ip address 192.168.2.100 255.255.255.0

fwc(config-if)#eexit

                ^

% Invalid input detected at '^' marker.

fwc(config-if)#exit

fwc(config)#exit

fwc#

%SYS-5-CONFIG_I: Configured from console by console


fwc#show int

fwc#show interfaces v

fwc#show interfaces vl

fwc#show interfaces vlan 

% Incomplete command.

fwc#show interfaces vlan1

Vlan1 is up, line protocol is down

  Hardware is CPU Interface, address is 0030.a347.5ada (bia 0030.a347.5ada)

  Internet address is 192.168.1.100/24

  MTU 1500 bytes, BW 100000 Kbit, DLY 1000000 usec,





临时将路由器的某个端口关闭

fwc#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

fwc(config)#inte

fwc(config)#interface fa

fwc(config)#interface fastEthernet 0/0

fwc(config-if)#shut

fwc(config-if)#shutdown 


fwc(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to administratively down





激活接口


fwc(config-if)#no shutd

fwc(config-if)#no shutdown 


fwc(config-if)#

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up





删除某接口ip


fwc(config-if)#no ip add

fwc(config-if)#no ip address 

fwc(config-if)#end

fwc#

%SYS-5-CONFIG_I: Configured from console by console


fwc#show int

fwc#show interfaces fas

fwc#show interfaces fastEthernet 0/0

FastEthernet0/0 is up, line protocol is down (disabled)

  Hardware is Lance, address is 0007.ecc3.4d01 (bia 0007.ecc3.4d01)

  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,

     reliability 255/255, txload 1/255, rxload 1/255




设置登录终端线时的密码

fwc#configure terminal 

Enter configuration commands, one per line.  End with CNTL/Z.

fwc(config)#line vty 0 4

fwc(config-line)#pass

fwc(config-line)#password fwc

fwc(config-line)#


远程登录测试

PC>telnet 192.168.2.100

Trying 192.168.2.100 ...Open



User Access Verification


Password:     //fwc

fwc>





设置登录终端时检查密码


fwc(config-line)#line vty 0 4

fwc(config-line)#login

fwc(config-line)#





设置中短线超市时间

fwc(config)#line vty 0 4 

fwc(config-line)#ex

fwc(config-line)#exe

fwc(config-line)#exec-timeout 5 30    5分钟30 秒没有键盘输入则强制断开

fwc(config-line)#




路由器上测试物理设备的连通性

fwc#ping 192.168.2.50


Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.50, timeout is 2 seconds:

!!!!!                   //感叹号显示出每一个成功的响应

Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms


fwc#


fwc#ping 192.168.2.51


Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 192.168.2.51, timeout is 2 seconds:

.....                     //点便是等待回包超时

Success rate is 0 percent (0/5)





扩展ping命令

fwc#ping 

Protocol [ip]: ip

Target IP address: 192.168.2.50

Repeat count [5]: 10

Datagram size [100]: 500

Timeout in seconds [2]: 

Extended commands [n]: y

Source address or interface: 

Type of service [0]: 

Set DF bit in IP header? [no]: 

Validate reply data? [no]: 

Data pattern [0xABCD]: 

Loose, Strict, Record, Timestamp, Verbose[none]: 

Sweep range of sizes [n]: 

Type escape sequence to abort.

Sending 10, 500-byte ICMP Echos to 192.168.2.50, timeout is 2 seconds:

!!!!!!!!!!

Success rate is 100 percent (10/10), round-trip min/avg/max = 0/0/2 ms





输入错误的时候很快得到结果

fwc(config)#no ip domain-lookup

fwc(config)#end

fwc#pimh

Translating "pimh"

% Unknown command or computer name, or unable to find computer address


fwc#




查看那版本信息

fwc01#show version 

Cisco IOS Software, 2800 Software (C2800NM-ADVIPSERVICESK9-M), Version 12.4(15)T1, RELEASE SOFTWARE (fc2)

Technical Support: http://www.cisco.com/techsupport

Copyright (c) 1986-2007 by Cisco Systems, Inc.

Compiled Wed 18-Jul-07 06:21 by pt_rel_team


ROM: System Bootstrap, Version 12.1(3r)T2, RELEASE SOFTWARE (fc1)

Copyright (c) 2000 by cisco Systems, Inc.


System returned to ROM by power-on

System image file is "c2800nm-advipservicesk9-mz.124-15.T1.bin"



This product contains cryptographic features and is subject to United

States and local country laws governing import, export, transfer and

use. Delivery of Cisco cryptographic products does not imply

third-party authority to import, export, distribute or use encryption.

Importers, exporters, distributors and users are responsible for

compliance with U.S. and local country laws. By using this product you

agree to comply with applicable laws and regulations. If you are unable

to comply with U.S. and local laws, return this product immediately.


A summary of U.S. laws governing Cisco cryptographic products may be found at:


http://www.cisco.com/wwl/export/crypto/tool/stqrg.html





查看路由器运行配置文件


fwc01#show running-config 

Building configuration...


Current configuration : 572 bytes

!

version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname fwc01

!

!

!

enable secret 5 $1$mERr$BGRevRmQDV0QPJf2zvZKM1

enable password 123456

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

interface FastEthernet0/0

 no ip address

 duplex auto

 speed auto

!

interface FastEthernet0/1

 no ip address

 duplex auto

 speed auto

!

interface Vlan1

 ip address 192.168.1.100 255.255.255.0

!

ip classless

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

 password 111111

 login

!

!

!

end



fwc01#  





查看那启动配置文件


fwc01#  show startup-config 

Using 572 bytes

!

version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!

hostname fwc01

!

!

!

enable secret 5 $1$mERr$BGRevRmQDV0QPJf2zvZKM1

enable password 123456

!

!

!

!

!

!

!

!

!

!

!

!

spanning-tree mode pvst

!

!

!

!

interface FastEthernet0/0

 no ip address

 duplex auto

 speed auto

!

interface FastEthernet0/1

 no ip address

 duplex auto

 speed auto

!

interface Vlan1

 ip address 192.168.1.100 255.255.255.0

!

ip classless

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

 password 111111

 login

!

!

!

end



fwc01#





将内存中运行配置文件存储到nvram中 


fwc01#copy running-config startup-config 

Destination filename [startup-config]? 

Building configuration...

[OK]

fwc01#



将NVRAM中的启动配置文件的内容复制到RAM中

fwc01#copy startup-config  running-config 

Destination filename [running-config]? 


572 bytes copied in 0.416 secs (1375 bytes/sec)

fwc01#

%SYS-5-CONFIG_I: Configured from console by console


fwc01#












你可能感兴趣的:(command,history,配置文件)