Cisco设备基础命令
查看命令
查看接口ip
# show ip interface brief
查看所有路由
# show ip route
查看配置信息
# show running-config
可在执行之前执行
terminal pager lines 0
命令从而一次性获取所有配置信息(无需翻页)。
查看序列号
# show inventory
其中
SN: xxxxxxxx
即为序列号
配置命令
配置接口
给某个接口配置ip
R1> enable
R1# configure terminal
R1(config)# interface fastEthernet 0/0
R1(config-if)# ip address 192.168.211.100 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# end
R1# ping 192.168.211.30
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.211.30, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 8/17/28 ms
R1# write
Warning: Attempting to overwrite an NVRAM configuration previously written
by a different version of the system image.
Overwrite the previous NVRAM configuration?[confirm]
Building configuration...
[OK]
R1#
配置路由
R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip route 192.168.211.0 255.255.255.0 10.0.1.1
R2(config)#end
R2#write
Building configuration...
[OK]
R2#
配置设备ssh
一般情况下可使用telnet协议对网络设备进行远程操作,但是为了提高设备操作的安全性和各种自定义软件对网络设备的配置管理,需要开通该设备的ssh。
SSH-R2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
SSH-R2(config)#ip domain-name xxx.com
SSH-R2(config)#crypto key generate rsa
How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
SSH-R2(config)#line vty 0 5
SSH-R2(config-line)#login local
SSH-R2(config-line)#transport input ssh
SSH-R2(config-line)#access-class 1 in
SSH-R2(config-line)#exit
SSH-R2(config)#username cisco secret cisco
SSH-R2(config)#aaa new-model
SSH-R2(config)#enable secret cisco
SSH-R2(config)#ip ssh time-out 120
SSH-R2(config)#ip ssh version 2
SSH-R2(config)#end
SSH-R2#wr
Building configuration...
[OK]
syslog配置
查看syslog配置
> show running-config | include logging
配置syslog
# logging host xxx.xxx.xxx.xxx
删除syslog配额
# no logging host xxx.xxx.xxx.xxx