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