Friday, December 11, 2009

cisco command CLI

Cisco official CLI command reference.

router>enable
router#config terminal
router(config)#hostname myhost
router(config)#enable secret mypassword
router(config)#service password-encryption
router(config)#security passwords min-length 10
router(config)#service timestamps [debug datetime msec]
router#terminal monitor
-> display debug output on current vty session
router(config)#no ip domain-lookup
router(config)#interface s0/0/0
router(config-if)#ip address myip mymask
router(config-if)#ip hostname myhostname myip
router(config-if)#clock rate 9600
router(config-if)#description my description
router(config-if)#no shutdown
--> after interface config, always needs no shutdown
router(config-if)#exit
router(config)#ip route network_to_connect mask gateway
router(config)#banner motd # my_banner #

router(config)#line console 0
router(config-line)#password my_console_pw
router(config-line)#login
router(config-line)#logging synchronous
-> system output won't be mangled with your input
router(config-line)#exec-timeout 15 30
--> set timeout 15 minutes 30 seconds
router(config-line)#history size 100
-> history buffer
router(config)#line vty 0 4
router(config-line)#password my_telnet_pw
router(config-line)#login
--> after password reset, always need login.
router(config)#end
router#copy running-config startup-config
router#write mem
->(same as above)
router#copy startup-config tftp://172.16.2.155/tokyo-config
-> backup startup-config over the network.
router#copy startup-config flash:config.bak1
-> backup startup-config to another file.
router#reload
-> restart using the current startup-config

switch#erase nvram:
switch#erase startup-config
switch#delete flash:filename
switch#boot system ROM
-> boots a mini version of IOS
switch#copy tftp flash
-> to upgrade IOS from a network location.
swtich#copy run tftp:10.1.1.100
-> save running-config to network server.
switch#erase nvram
switch#reload
switch#dir flash:/

switch#terminal monitor
-> if using other than console, all messages will be displayed just as in console mode
switch#clock set 13:00:00 12 october 1993
switch#clock timezone EST -5
switch#logging buffered
-> save in ROM, rather than output to screen.
switch#show log
-> now read this log

(config)#ip http authentication enable
-> configure HTTP server interface to enable password, other options are: local (local user database), tacacs
(config)#ip http server
-> enable the HTTP server

switch#show interface status
-> nice brief table
switch#show ip {interface | http | arp}
-> nice brief table
Router>show control s0/0/0
-> shows cable used, clock rate, ...
Router>show interfaces
-> all serial and ethernet connections.
Router>show ip route
Router>show ip interface brief

Router(config-router#)default-information originate
-> Redistributes Default gateway (QZR) to others
Router(config-router)#passive-interface fa0/0
Router(config-router)#redistribute static

(config)#ipv6 host name [port] ipv6addr
(config)#ipv6 unicast-routing
(config)#ipv6 router rip MYNAME
(config-if)#ipv6 address ipv6_prefix/prefix-length [eui-64]
(config-if)#ipv6 rip MYNAME enable
#show ipv6 interface [brief]
#show ipv6 neighbors
#show ipv6 protocols
#show ipv6 rip
#show ipv6 route [summary]
#show ipv6 routers
#show ipv6 static [detail] [interface s0/0]
#show ipv6 traffic
#clear ipv6 rip
#clear ipv6 route *
#clear ipv6 traffic
#debug ipv6 rip
#debug ipv6 routing
#debug ipv6 packet

No comments:

Post a Comment