This is an old revision of cisco from 09/19/2013 19:45 edited by EvaggelosBalaskas.

View source for cisco

{{anchor href="top"}}
Hits :  **{{hits}}**

== Cisco ==

{{ToC from="h2" to="h3"}}

=== Cisco Tips ===

http://www.adslgr.com/forum/archive/index.php/t-4489.html

http://users.panafonet.gr/highland/

http://www.forthnet.gr/templates/supportPosting.aspx?c=10006931

http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/index.htm

((#top))
-----------

==== Version ====

Για να δω τι έκδοση τρέχει ο router μου: 

%%(code)
show version
%%

Σημειώνουμε 2 πράγματα,
το System Image File & Configuration Register

%%(code)
cisco#sh ver | i System image           
System image file is "flash:c837-k9o3sy6-mz.123-11.YZ2.bin"

cisco#sh ver | i Configuration register
Configuration register is 0x2102

%%

((#top))
-----------

==== Configurations ====

Για να δω το running configuration :

%%(code)
[ enter ]
enable
[ password / most cases cisco ]
show run
%%

Πως γράφω το running configuration στην μνήμη του router δλδ 
πως κάνω copy το running configuration στο start-up configuration
ώστε όταν κάνω reload ή κλείσω και ανοίξω πάλι τον router να έχει 
το νέο (running) configuration.

%%(code)
Router# write mem
%%

((#top))
-----------

==== Dhcp Pool ===

Για να ορίσω ένα dhcp pool :

%%(code)
ip dhcp excluded-address 10.10.10.1
!
ip dhcp pool dhcp_pool
   network 10.10.10.0 255.255.255.0
   default-router 10.10.10.1
   dns-server 195.170.0.1 195.170.2.2
%%

Εάν θέλουμε να κάνουμε exclude μαζικά IPs
π.χ. από την 10.10.10.1 έως και την 10.10.10.10 τότε μπορούμε να χρησιμοποιήσουμε την εξής δήλωση:

%%
ip dhcp excluded-address 10.10.10.1 10.10.10.10
%%

__//**ΠΡΟΣΟΧΗ:**//__ Το default route (δλδ το gateway) πρέπει να είναι IP μέσα από το pool που δίνει το dhcp
(δεν ξέρω ακόμα γιατί)


((#top))
-----------

==== Interfaces ====

Πως κάνω up ένα interface : 
%%(code)
[ enter ]
enable
[ password / most cases cisco ]
configure terminal
interface FastEthernet1
no shutdown
exit
%%

Ποιο interface είναι επάνω : 

%%(code)
[ enter ]
enable
[ password / most cases cisco ]
show interface summary
%%

((#top))
-----------

==== Show ====

Πως βλέπω τις access-lists ?

%%(code)
show access-lists
%%

Πως βλέπω όλα τα Interface :

%%(code)
show ip interface brief
%%

Πως βλέπω το routing : 

%%(code)
show ip route
%%

Πληροφορίες για το dsl interface

%%
show dsl interface ATM 0
%%

όπως για παράδειγμα την ταχύτητα:

%%
cisco#show dsl interface ATM 0 | i Speed
Speed (kbps):	          0	        8128	         0	         384
%%

((#top))
-----------

==== http ====

Πως σηκώνω το http server

%%(code)
Router> enable
Router# configure terminal
Router (config)# ip http server
%%

((#top))
-----------

==== Tcp Port Forward - Simple NAT ====

Πως να ορίσω μία πόρτα του router να κάνει redirect σε μία tcp port ενός εσωτερικού υπολογιστή:

%%(code)
Router (config)# ip nat inside source static tcp ΕΣΩΤΕΡΙΚΗ_IP ΕΣΩΤΕΡΙΚΗ_ΠΟΡΤΑ ΕΞΩΤΕΡΙΚΗ_IP ΕΞΩΤΕΡΙΚΗ_ΠΟΡΤΑ extendable
%%

((#top))
-----------

==== Loopback ====

Πως ορίζω μία δεύτερη static ip (η οποία φυσικά θα παίζει πάνω από το dialer)

%%(code)
Router (config)# interface Loopback 0
Router (config)# ip address 172.172.172.172 255.255.255.255
Router (config)# end
Router # show Loopback 0
Loopback0 is up, line protocol is up
  Hardware is Loopback
  Internet address is 172.172.172.172/32
  ...
  %%
  
((#top))
-----------

==== Port Mapping ====

Πως να κάνω redirect μία πόρτα σε μία άλλη:

%%(code)
Router (config)# ip port-map http port 8080
Router (config)# end
Router # show ip port-map
...
Default mapping: http             port 8080                user defined
...
%%

((#top))
-----------

==== Monitor ====

Ένα από τα πιο χρήσιμα πράγματα που μπορεί κάποιος να χρειαστεί είναι να βλέπει κάποια μηνύματα στην οθόνη του.
Για να μετατρέψουμε το τερματικό με το οποίο έχουμε συνδεθεί σε monitor του router μας γράφουμε στο enable:

%%
terminal monitor
%%

Και στην συνέχεια τα συμβάντα που θέλουμε να παρακολουθήσουμε:

%%
debug dhcp
%%

((#top))
-----------

==== Tftpd ====

Πως περνάω ένα cisco configuration σε έναν tftpd server

%%(code)
Router# copy run tftp:
Address or name of remote host []? 192.168.0.2
Destination filename [router-confg]?
!!
4358 bytes copied in 2.580 secs (1689 bytes/sec)
%%

Εναλλακτικά μέσω ssh:

%%
Router#copy running-config scp:
Address or name of remote host []? 192.168.0.2            
Destination username [ebal]? 
Destination filename [Router-confg]? 
Writing Router-confg 
Password: 
!
3117 bytes copied in 10.680 secs (292 bytes/sec)
%%

((#top))
-----------

==== Minicom ====

Πως συνδέουμε τον υπολογιστή μας με το router μας μέσω του usb2serial device:

%%
lsusb
dmesg
%%

και βλέπουμε ότι η συσκευή μας είναι ή **/dev/ttyUSB0**
άρα το αρχείο μας **.minirc.dfl** πρέπει να είναι κάπως έτσι:

%%(code)
pu port           /dev/ttyUSB0
pu baudrate  9600
pu bits            8
pu parity        N
pu stopbits    1
%%