Cisco Router Commands

Scrapbook of useful cmd for cisco routers

Make a router a tftp server
Router1#configure t
Router1(config)#tftp-server ?
Router1(config)#tftp-server flash: ?
Router1(config)#tftp-server flash:/c2500-js-l.122-10b

Read text file in flash
Router1#more flash:RTPReport.txt

Ftp client
ip ftp username alexis
ip ftp password alexispass
copy ftp flash:

OR
copy flash:your-ios ftp://alexis:alexispass@172.1.1.100/your-ios

check Md5
verify /md5 flash:c3900e-universalk9-mz.SPA.152-4.M3.bin

Do PCAP capture on a Router Interface
!access-list to filter only SIP messages (port 5060)
access-list 123 permit udp any any eq 5060
access-list 123 permit tcp any any eq 5060

!OR Use extended ACL with IP address
ip access-list extended WANSIDEACL
permit ip any host 100.100.30.196 !100.100.30.196 is IP address of the WAN interface
permit ip host 100.100.30.196 any

!create profile
ip traffic-export profile SIP_PCAP_FILE mode capture
bidirectional
incoming access-list 123 !OR WANSIDEACL
outgoing access-list 123 !OR WANSIDEACL

! apply to an interface, default memory is 5M
interface GigabitEthernet0/1
ip traffic-export apply SIP_PCAP_FILE size 5242880

traffic-export interface GigabitEthernet0/1 clear
traffic-export interface GigabitEthernet0/1 start

!capture the problem
traffic-export interface GigabitEthernet0/1 stop

!Export the pcap file to a server
traffic-export interface GigabitEthernet0/1 copy ftp://10.10.10.143/capture.pcap
traffic-export interface GigabitEthernet0/1 copy ftp://alexis:alexis@10.10.10.143/capture.pcap

Tags:

About Alexis Katsavras

Working as Freelance Cisco Unified Communications Consultant in the UK. www.NetPacket.co.uk