IMPORTANT: Per accedir als fitxer de subversion: http://acacha.org/svn (sense password). Poc a poc s'aniran migrant els enllaços. Encara però funciona el subversion de la farga però no se sap fins quan... (usuari: prova i la paraula de pas 123456)

Configuració des de consola amb linux

Per poder configurar el nostre switch cisco necessitem baixa l'aplicació minicom

$ sudo apt-get install minicom

Per comprovar que ens ha instal·lat

[email protected]:~$ dpkg -L  minicom
/.
/usr
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/minicom.1.gz
/usr/share/man/man1/xminicom.1.gz
/usr/share/man/man1/ascii-xfr.1.gz
/usr/share/man/man1/runscript.1.gz
/usr/share/locale
/usr/share/locale/cs
/usr/share/locale/cs/LC_MESSAGES
/usr/share/locale/cs/LC_MESSAGES/minicom.mo
/usr/share/locale/da
/usr/share/locale/da/LC_MESSAGES
/usr/share/locale/da/LC_MESSAGES/minicom.mo
/usr/share/locale/de
/usr/share/locale/de/LC_MESSAGES
/usr/share/locale/de/LC_MESSAGES/minicom.mo
/usr/share/locale/es
/usr/share/locale/es/LC_MESSAGES
/usr/share/locale/es/LC_MESSAGES/minicom.mo
/usr/share/locale/fr
/usr/share/locale/fr/LC_MESSAGES
/usr/share/locale/fr/LC_MESSAGES/minicom.mo
/usr/share/locale/fi
/usr/share/locale/fi/LC_MESSAGES
/usr/share/locale/fi/LC_MESSAGES/minicom.mo
/usr/share/locale/hu
/usr/share/locale/hu/LC_MESSAGES
/usr/share/locale/hu/LC_MESSAGES/minicom.mo
/usr/share/locale/id
/usr/share/locale/id/LC_MESSAGES
/usr/share/locale/id/LC_MESSAGES/minicom.mo
/usr/share/locale/ja
/usr/share/locale/ja/LC_MESSAGES
/usr/share/locale/ja/LC_MESSAGES/minicom.mo
/usr/share/locale/nb
/usr/share/locale/nb/LC_MESSAGES
/usr/share/locale/nb/LC_MESSAGES/minicom.mo
/usr/share/locale/pl
/usr/share/locale/pl/LC_MESSAGES
/usr/share/locale/pl/LC_MESSAGES/minicom.mo
/usr/share/locale/pt_BR
/usr/share/locale/pt_BR/LC_MESSAGES
/usr/share/locale/pt_BR/LC_MESSAGES/minicom.mo
/usr/share/locale/ro
/usr/share/locale/ro/LC_MESSAGES
/usr/share/locale/ro/LC_MESSAGES/minicom.mo
/usr/share/locale/ru
/usr/share/locale/ru/LC_MESSAGES
/usr/share/locale/ru/LC_MESSAGES/minicom.mo
/usr/share/locale/rw
/usr/share/locale/rw/LC_MESSAGES
/usr/share/locale/rw/LC_MESSAGES/minicom.mo
/usr/share/locale/sv
/usr/share/locale/sv/LC_MESSAGES
/usr/share/locale/sv/LC_MESSAGES/minicom.mo
/usr/share/locale/vi
/usr/share/locale/vi/LC_MESSAGES
/usr/share/locale/vi/LC_MESSAGES/minicom.mo
/usr/share/locale/zh_TW
/usr/share/locale/zh_TW/LC_MESSAGES
/usr/share/locale/zh_TW/LC_MESSAGES/minicom.mo
/usr/share/menu
/usr/share/menu/minicom
/usr/share/doc
/usr/share/doc/minicom
/usr/share/doc/minicom/examples
/usr/share/doc/minicom/examples/minirc.dfl
/usr/share/doc/minicom/examples/htsalogin
/usr/share/doc/minicom/examples/saralogin
/usr/share/doc/minicom/examples/unixlogin
/usr/share/doc/minicom/examples/minirc.nullmodem
/usr/share/doc/minicom/intl
/usr/share/doc/minicom/intl/japanese
/usr/share/doc/minicom/intl/Locales
/usr/share/doc/minicom/intl/pl-translation.txt
/usr/share/doc/minicom/intl/portugues-brasil
/usr/share/doc/minicom/intl/suomeksi
/usr/share/doc/minicom/intl/ABOUT-NLS.gz
/usr/share/doc/minicom/term
/usr/share/doc/minicom/term/README.termcap
/usr/share/doc/minicom/term/README.terminfo
/usr/share/doc/minicom/term/terminfo
/usr/share/doc/minicom/term/termcap.long.gz
/usr/share/doc/minicom/term/termcap.short.gz
/usr/share/doc/minicom/todo
/usr/share/doc/minicom/todo/TODO
/usr/share/doc/minicom/todo/TODO.lrzsz
/usr/share/doc/minicom/todo/Todo
/usr/share/doc/minicom/todo/Todo.175
/usr/share/doc/minicom/todo/Todo.fsel
/usr/share/doc/minicom/todo/Todo.Irix.dif.gz
/usr/share/doc/minicom/todo/Todo.emacskey.dif.gz
/usr/share/doc/minicom/tables
/usr/share/doc/minicom/tables/mc.iso
/usr/share/doc/minicom/tables/mc.noconv
/usr/share/doc/minicom/tables/mc.pc8
/usr/share/doc/minicom/tables/mc.sf7
/usr/share/doc/minicom/AUTHORS
/usr/share/doc/minicom/NEWS
/usr/share/doc/minicom/copyright
/usr/share/doc/minicom/README.Debian
/usr/share/doc/minicom/changelog.Debian.gz
/usr/share/doc/minicom/HistSearch.gz
/usr/share/doc/minicom/COMPATABILITY.lrzsz
/usr/share/doc/minicom/fselector.txt
/usr/share/doc/minicom/Macros.gz
/usr/share/doc/minicom/minicom.FAQ
/usr/share/doc/minicom/README.lrzsz
/usr/bin
/usr/bin/minicom
/usr/bin/runscript
/usr/bin/ascii-xfr
/usr/bin/xminicom
/etc
/etc/minicom

Cal configurar minicom per utilitzar el port sèrie amb les característiques que ens especifiquen a Cisco:

  • Baudis: 9600
  • 8 N 1
  • Port sèrie: /dev/ttyS0

Per realitzar la configuració executarem

$ minicom -s

I anirem a

Serial Port Setup
           +-----[configuration]------+
           | Filenames and paths      |
           | File transfer protocols  |
           | Serial port setup        |
           | Modem and dialing        |
           | Screen and keyboard      |
           | Save setup as dfl        |
           | Save setup as..          |
           | Exit                     |
           | Exit from Minicom        |
           +--------------------------+

On ens apareixerar

+-----------------------------------------------------------------------+
   | A -    Serial Device      : /dev/ttyS0                                |
   | B - Lockfile Location     : /var/lock                                 |
   | C -   Callin Program      :                                           |
   | D -  Callout Program      :                                           |
   | E -    Bps/Par/Bits       : 115200 8N1                                |
   | F - Hardware Flow Control : Yes                                       |
   | G - Software Flow Control : No                                        |
   |                                                                       |
   |    Change which setting?                                              |
   +-----------------------------------------------------------------------+
           | Screen and keyboard      |                    
           | Save setup as dfl        |                    
           | Save setup as..          |                    
           | Exit                     |                    
           | Exit from Minicom        |                    
           +--------------------------+

Escollim les opcions que volem modificar per connectar al dispositiu Cisco:

  • Seleccionem A i modifiquen del Port a /dev/ttyS0
  • Seleccionem E. Apareix el següent menú:
 +-----------------+---------[Comm Parameters]----------+----------------+
   | A -    Serial De|                                    |                |
   | B - Lockfile Loc|     Current:  9600 8N1             |                |
   | C -   Callin Pro| Speed            Parity      Data  |                |
   | D -  Callout Pro| A: <next>        L: None     S: 5  |                |
   | E -    Bps/Par/B| B: <prev>        M: Even     T: 6  |                |
   | F - Hardware Flo| C:   9600        N: Odd      U: 7  |                |
   | G - Software Flo| D:  38400        O: Mark     V: 8  |                |
   |                 | E: 115200        P: Space          |                |
   |    Change which |                                    |                |
   +-----------------| Stopbits                           |----------------+
           | Screen a| W: 1             Q: 8-N-1          |
           | Save set| X: 2             R: 7-E-1          |
           | Save set|                                    |
           | Exit    |                                    |
           | Exit fro| Choice, or <Enter> to exit?        |
           +---------+------------------------------------+

Configurem a 9600 8 N 1. La configuració ha de quedar de la següent manera:

+-----------------------------------------------------------------------+
   | A -    Serial Device      : /dev/ttyS0                                |
   | B - Lockfile Location     : /var/lock                                 |
   | C -   Callin Program      :                                           |
   | D -  Callout Program      :                                           |
   | E -    Bps/Par/Bits       : 9600 8N1                                  |
   | F - Hardware Flow Control : Yes                                       |
   | G - Software Flow Control : No                                        |
   |                                                                       |
   |    Change which setting?                                              |
   +-----------------------------------------------------------------------+
           | Screen and keyboard      |                    
           | Save setup as dfl        |                    
           | Save setup as..          |                    
           | Exit                     |                    
           | Exit from Minicom        |                    
           +--------------------------+

Quan tinguem configurat el minicom li donarem a Enter i guardarem a Save setup as dfl

+-----[configuration]------+                                     
           | Filenames and paths      |                                     
           | File transfer protocols  |                                     
           | Serial port setup        |                                     
           | Modem and dialing        |                                     
           | Screen and keyboard      |                    
           | Save setup as dfl        |                    
           | Save setup as..          |                    
           | Exit                     |                    
           | Exit from Minicom        |                    
           +--------------------------+

Ara per establir la connexió només ens falta seleccionar Exit. Apareixerà un missatge:

Initializing Modem

Si la configuració s'ha realitzat correctament ja podrem accedir des de la consola de configuració del switch, en el nostre cas en apereixerar el nom de

2asix>

Creació VLAN

Per poder crear vlan hem d'accedir dins de la consola de comandes amb mode de privilegis per tant per poder començar hem d'activar-lo amb

2asix>enable 
Password:

Una vegada dins del mode privilegis, hem de preparar el terminal per poder treballar amb les diferents comandes de configuració per tant hem de fer

2asix#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z. 

Hem de tenir en compte que cada una de les comandes que utilitzarem les hem de fer línia per línia.

Una vegada dins de la configuració li donarem un id a la vlan en el nostre cas vlan 2

2asix(config)# vlan 2

Li donarem un nom per exemple vlan2

2asix(config-vlan)# vlan2

Una vegada fet això amb end guardarem els canvis

2asix(config-vlan)# end

Repetirem els pasos tantes vegades com vlan vulguem crear

Mostrar vlan

Amb la comanda show podem mostrar les vlan creades dins del nostre switch, també ens pot servir per saber la vlan abans creada ho està.

2asix#show vlan 

Com podem veure ens ha creat la vlan2 dins de la taula vlan, només ens falta poder afegir els port que volem que formin part de la vlan2

VLAN Name                             Status    Ports 
---- -------------------------------- --------- ------------------------------- 
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4 
                                                Fa0/5,Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13,Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17,Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21,Fa0/22, Fa0/23, Fa0/24 
                                                Gi0/1, Gi0/2 
2    vlan2                            active    
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup

Assignar un port a una vlan

La manera d'assignar un port a una vlan és molt similar a crear una vlan

Entrarem dins de la consola en mode privilegis

2asix>enable 
Password: 

Preparem el terminal per a treballar en les comandes de configuració

2asix#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.

El primer pas que realitzarem serà seleccionar quin port volem que formi part de la vlan2, li assignarem el port 1 del dispositiu

2asix(config)#interface Fa0/1

Farem que aquest port estigui accessible amb la comanda

2asix(config-if)#switchport mode access

I afegirem el port a la vlan2

2asix(config-if)#switchport  access vlan 2

I guardarem els canvis amb end

2asix(config-if)#end 

Utilitzarem la comanda show per veure que realment s'ha afegit el port 1 a la vlan2

2asix#show vlan

El resultat és el següent

VLAN Name                             Status    Ports 
---- -------------------------------- --------- ------------------------------- 
1    default                          active    Fa0/2, Fa0/3, Fa0/4, Fa0/5 
                                                Fa0/6, Fa0/7, Fa0/8, Fa0/9 
                                                Fa0/10, Fa0/11, Fa0/12, Fa0/13 
                                                Fa0/14, Fa0/15, Fa0/16, Fa0/17 
                                                Fa0/18, Fa0/19, Fa0/20, Fa0/21 
                                                Fa0/22, Fa0/23, Fa0/24, Gi0/1 
                                                Gi0/2 
2    vlan2                            active    Fa0/1 
1002 fddi-default                     act/unsup 
1003 token-ring-default               act/unsup 
1004 fddinet-default                  act/unsup 
1005 trnet-default                    act/unsup

Configurar un port com a troncal

Per configurar un port del switch o farem de la següent manera

Accedirem al terminal en mode privileges

2asix# configure terminal Enter configuration commands, one per line. End with CNTL/Z.

2asix(config)# interface Gi0/1

2asix(config-if)# switchport mode trunk

2asix(config-if)#

2asix(config-if)# end