Networking, Security & Cloud Knowledge

Showing posts with label Cisco Commands. Show all posts
Showing posts with label Cisco Commands. Show all posts

Sunday, November 14, 2010

[<< INDEX PAGE ][009][ Reverse Telnet]

Reverse Telnet gives the ability to telnet to a device, and then console to another device from there. For example, you could telnet to a router, and then console into a switch, or anything that has a console port.
Note: connect CONSOLE port of the Switch to AUX port of the router using ROLL OVER cable.
1 configure the AUX port
router#conf t
router(config)#line aux 0
router(config-line)#modem InOut
router(config-line)#transport input all
router(config-line)#transport output telnet
router(config-line)#speed 19200
router(config-line)#no exec
router(config-line)#stop bit 1
(config-line)#exit
router(config)# interface lo 0
router(config-line)#ip address [address] [mask]
router# show line
Tty Typ Tx/Rx A Modem Roty AccO AccI Uses Noise Overruns Int
0 CTY - - - - - 0 0 0/0 -
225 AUX 19200/19200 - inout - - - 0 0 0/0 -
* 226 VTY - - - - - 10 0 0/0 -
227 VTY - - - - - 0 0 0/0 -
228 VTY - - - - - 0 0 0/0 -
229 VTY - - - - - 0 0 0/0 -
230 VTY - - - - - 0 0 0/0 -


Now to telnet switch: telnet [lo address of router] 2225
{ where 2225 = 2000 + aux tty line number}

Saturday, November 13, 2010

009 - Arcive Command

ARCHIVE
archive
log config
logging enable
logging size 200
hidekeys
path tftp://tftp_server/
write-memory
time-period 43200
**********************************************************************
SNMP and Logging configuration
ip sla responder
logging source-interface Loopback0
logging [Logg_server_ip]

access-list 1 permit [NMS_server]

snmp-server community Public RO 1
snmp-server ifindex persist
snmp-server trap-source Loopback0
snmp-server source-interface informs Loopback0
snmp-server packetsize 1300
snmp-server queue-length 20
snmp-server location Companyname . THIS_LOCATION
snmp-server contact Site-Contact [contact number]
snmp-server system-shutdown
snmp-server enable traps eigrp
snmp-server enable traps envmon
snmp-server enable traps bgp
snmp-server enable traps memory bufferpeak
snmp-server enable traps cnpd
snmp-server enable traps config
snmp-server enable traps entity
snmp-server enable traps fru-ctrl
snmp-server enable traps event-manager
snmp-server enable traps cpu threshold

************************************************************************
Netflow configuration
interface fa 0
ip route-cache flow

ip flow-export source Loopback0

ip flow-export version 5
ip flow-export destination 10.10.10.10 2020
snmp-server ifindex persist
ip flow-cache timeout active 3

008 SSH & AAA configuration

AAA configuration
username [username] privilege 15 secret [Password]

aaa new-model
!
aaa authentication login default group tacacs+ local
aaa authentication enable default group tacacs+ enable

aaa authorization config-commands

aaa authorization exec default group tacacs+ local

aaa authorization commands 1 default group tacacs+ local
aaa authorization commands 2 default group tacacs+ local
aaa authorization commands 3 default group tacacs+ local
aaa authorization commands 4 default group tacacs+ local
aaa authorization commands 5 default group tacacs+ local
aaa authorization commands 15 default group tacacs+ local

aaa accounting connection default start-stop group tacacs+
aaa accounting exec default start-stop group tacacs+

aaa accounting commands 0 default start-stop group tacacs+
aaa accounting commands 1 default start-stop group tacacs+
aaa accounting commands 2 default start-stop group tacacs+
aaa accounting commands 3 default start-stop group tacacs+
aaa accounting commands 4 default start-stop group tacacs+
aaa accounting commands 5 default start-stop group tacacs+
aaa accounting commands 15 default start-stop group tacacs+
!
!
aaa session-id unique
!


ip tacacs source-interface Loopback0

tacacs-server host {TACAC-SERVER-ADDRESS} timeout 8
tacacs-server directed-request
tacacs-server key [ACS_Key]
******************************************************************
SSH configuration
config t
crypto key generate rsa gerenal-keys modulus 1024 {1024 OR 2048}
ip ssh source-interface loopback 0
ip ssh version 2


line vty 0 15
transport input ssh
transport output telnet ssh

Sunday, March 7, 2010

006 - IOS installation on Cisco Router

Requirenment: Router connected to ethernet network
Tftp server ( solarwinds ) with ios image on root directory

For 1700 series Router
rommon> set
IP_ADDRESS=192.168.1.2
IP_SUBNET_MASK=255.255.0.0
TFTP_SERVER=192.168.1.10
DEFAULT_GATEWAY=192.168.1.1
TFTP_FILE={the name of the IOS that is saved on the PC}

rommon > tftpdnld


rommon>reset



For 2500 series Router

Steps:
Step 2:Change the configuration register to boot the ROM(BOOT) image. Configuration register to be used is 0×2141
Step 3: Initialize the router by issuing the i command
Step 4 Assign an IP address to the Ethernet interface and configure a default gateway (if required).


Commands:
>o/r 0×2141>i


Press RETURN to get started!

Router(boot)>enable
Router(boot)#config t
Router(boot)(config)#interface e0
Router(boot)(config-if)#ip add 10.1.1.20 255.255.255.0
Router(boot)(config-if)#no shut
Router(boot)(config-if)#exit
NOTE: The line below is optional if your TFTP server is not on the same network
Router(boot)(config)#ip default-gateway 10.1.1.254
Router(boot)(config)#end

Router(boot)#copy tftp flash







Friday, November 27, 2009

005 - USERFULL COMMAND CISCO

ROUTER(CONFIG)# NO IP DOMAIN LOOKUP -disables domain lookup process

ROUTER# SHOW TECH-SUPPORT -generates configuration text files

ROUTER# SHOW CONTROLLERS SERIAL 0 -show dce/dte and clock rate information

ROUTER# SHOW RUN INTERFACE SERIAL 0 -shows running configuration of serial interface

ROUTER# TERMINAL MONITOR

ROUTER# TERMINAL LENGTH 0 -show run command output without break

Router(config)# alias exec sr show run -create our own command
--------------------------------------------------------------------------
show tech-support tee tftp://192.168.1.10/test.txt -redirects command output

show run redirect tftp://192.168.1.10/test.txt -redirects command output
---------------------------------------------------------------------------
sh run i include
sh run b begin
sh run e exclude
sh run i ^
sh run i $
sh run linenum
* To view the serial numbers of WIC cards, get details of the specific cards in the router and even the PVDMs (DSPs) in the router.
Note: The show inventory command is not supported on older IOS versions.
show inventory
show inventory raw
show diag
* Commands to see the CPU utilization, processes running on a router and the memory used/available.
show processes cpu : command to display detailed information on the processes
show processes memory : command to show the amount of memory used.
show processes cpu history :gives you a nice graph of CPU utilization. It displays a historical graph of the CPU in 60 seconds, 60 minutes and 72 hour format. This is useful as it shows the CPU utilization over a period of time, rather than just as at a specific point in time.

----------------------------------------------------------------------------

ping 192.168.1.10 repeat 100 source fa0/0 -for extended ping


--------------------------------------------------------------------------------
Delete Non - Empty folder on Cisco device.
Command:  delete /force /recursive flash:directory

----------------------------------------------------------------------------------------------

Verify md5 hash of the image:

Switch #verify /md5 flash:/ c2960-lanbasek9-mz.150-2.SE2.bin
Verify filename []?  c2960-lanbasek9-mz.150-2.SE2.bin
..............................................................................................................................................................................................................................................................................................................................................................................................................................Done!
%Error verifying flash:c2960-lanbasek9-mz.150-2.SE2.bin
Computed signature  = cef59a65fd31713481fb5d245b1ef950
Submitted signature = c2960-lanbasek9-mz.150-2.se2.bin

****************************************************************************

Send message on ssh / vty session

# show line

# send


Monday, November 23, 2009

002 - cisco password recovery

Access Poing 1300
Default username and password: Cisco
To rest configuration:
[1] CLI :write erase , reload
[2] GUI :System Software > System Configuration. Press the Reset to Defaults button
Password recovery process:
step 1: Reboot access point.
step 2: press ESC when you see this lines on the cli.

Loading"flash:/" ...######################################################
##################################################################### #####################################################################
#################
Once you press ESC, this information is displayed on the CLI screen.
Xmodem file system is available.flashfs[0]: filesystem check interrupted!The system has been interrupted, or encountered an errorduring initialization of the flash filesystem. The followingcommands will initialize the flash filesystem, and finishloading the operating system software:
flash_init
ether_init
tftp_init
boot
ap:
step 3: type command flash_init
step 4: dir flash:
step 5: rename flash:config.txt flash:config.old
step 6: reset
==============================================
For Cisco Catalyst Switch
Step 1: reload switch (Keep MODE button pressed while reloading)
Step 2: type command flash_init
Step 3: rename flash:config.txt flash:config.old
Step 4: reload
===================================================
For Cisco router
Step 1: Reload and press CTR+BREAK
Step 1: o/r 0x2142 then type B {old router}
confreg ox2142 then type reset {new router}