VOLUMEN 1 COLECCION PRODUCCION BOVINA . SERIE SANIDAD ANIMAL
Conmutación LAN e inalámbrica: 5.2 VTP Solución
1. VLAN Y VTP
Eduard Angrill
En esta práctica se configurará : difere ntes
VLANS, configura ción de los puertos de los
switches que f orman la red, V TP, res triccio nes
de seguridad, comu nica ción remota mediante el
protocolo SSH , redes WAN PPP con el protocolo
EIGRP.
PLANIFICACIÓN Y
ADMINISTRACIÓN DE
REDES
STUCOM
07/02/2014
2. Ed u ard An g ri l l
ASI XI I
1. Escenario de simulac ión:
En este es cenario que se mues tra a con tinua ción, se puede ver u n esquema de cómo
se con figurará la red. En es te es quema se d escribe con color verde los e quipos qu e
formarán pa rte de la VLAN 1 y en color n ar anja los equip os que f ormarán parte de
la VLAN 2. Los equip os en rojo serán usad os a modo de intrusos . Concretamen te en
el apartad o do nde se de talla la seguridad de los puer tos. Para in terconectar las
redes LAN, se usarán rou ters que se interco necta rán co n enlaces WAN configurados
con los pro to colos PPP y EIGRP , estos per mitirán la comu nica ción en tre tod os los
dispositivos de la red:
2. Calculo del d irecc ionamiento de capa 3, ( 2 VLANS y 3 WAN) r ed " 172.16.0.0/16":
o Router1:
VLAN1: 30 PCs
VLAN2: 40 PCs
o Router 2:
VLAN1: 100 PCs
VLAN2: 107 PCs
o Router 3:
VLAN1: 200 PCs
VLAN2: 197 PCs
o WAN:
3 IPS
2
3. Ed u ard An g ri l l
ASI XI I
VLSM:
172.1 6.0.0/1 6
172 .16 .0 .0/2 4
>>>> Asignada a VLA N ( 200 Hos ts).
172 .16 .1 .0/2 4
>>>> Asignada a VLA N ( 197 Hos ts).
172 .16 .2 .0/2 4
172 .16 .2 .0/2 5
>>>> Asignada a VLA N ( 107 Hos ts).
172 .16 .2 .12 8/25
>>>> Asignada a VLA N ( 100 Hos ts).
172 .16 .3 .0/2 5
172 .16 .3 .0/2 6
>>>> Asignada a VLA N ( 40 Hosts).
172 .16 .3 .64/ 26
172 .16 .3 .64/ 27
>>>> Asignada a VLA N ( 30 Hosts).
172 .16 .3 .96/ 27
172 .16 .3 .96/ 30
>>>> Asignada a WAN.
172 .16 .3 .10 0/30
>>>> Asignada a WAN.
172 .16 .3 .10 4/30
>>>> Asignada a WAN.
172.1 6.3.10 8/30
*Una vez reali zado se as ignan a cada equipo con su re spect iva más cara.
3. Configuración de las VLAN .
Configuración en Switch:
Crear la s V LAN y lev antar la VLA N por defec to "Vlan 1":
Switch>enable
Switch#vlan database
Switch(vlan)# vlan 2
Switch(vlan)# exit
Switch#configure ter minal
Switch(conf ig)# interface vlan1
Switch(conf ig -if )#no shutdo wn
Configuraciones en la s interface s por donde pasa má s de una VLAN " modo
trunk":
Switch>enable
Switch#configure ter minal
Switch(conf ig)# interface fa0/1
Switch(conf ig -if )#switchpor t mode trunk
Switch(conf ig -if )#switchpor t trunk a llowed vlan a ll
Configuraciones en la s interface s por donde solo pasa una VLA N "modo acc eso":
Switch>enable
Switch#configure ter minal
Switch(conf ig)# interface fa0/2
Switch(conf ig -if )#switchpor t mode access
Switch(conf ig -if )#switchpor t access vlan 1
Switch(conf ig -if )#exit
Switch(conf ig)# interface fa0/4
Switch(conf ig -if )#switchpor t mode access
Switch(conf ig -if )#switchpor t access vlan 2
Switch(conf ig -if )#end
Switch#wr
3
4. Ed u ard An g ri l l
ASI XI I
Ahora par a compro bar q ue las VLANs está n activas a ccedemo s a un swi tch y
ejecutam os el siguiente coman do "show vlan" Vlan1 comprob ar en "show
running-config":
Las interf aces con figuradas en m odo "trunk " no se muestra n, para mos trarlas se
tiene que ejecu tar el siguiente comando " s how interface trunk" este comando
también mues tra las VLANs permitidas y las que se encuentr an a ctivas :
Una vez realizadas estas configuracio nes los equi pos de una misma LAN ubicad os
en la misma VLAN podrán h acerse ping, per o no po drán al canzar lo s equipos de la
otra VLAN. Ejemplo de "T race rt" entre las mi smas y dife rentes VLANS :
4
5. Ed u ard An g ri l l
ASI XI I
Configuración de los Routers:
En esta configuració n se "div ide" la misma interfaz física en difere ntes in terfa ces
lógicas (Vlans), para que el r oute r pued a ha cer de ga teway de las dos Vlans a la
vez haciendo us o de una IP de gateway p or interfaz logica , por lo tanto cad a
interfaz del rou ter dispond rá de dos IPs , exceptuando las interfa ces WAN que se
configurará n más adelan te:
Router 1:
Vlan1
Router>enable
Router#configure termina l
Enter conf iguration commands, one per line. End with CNTL/Z.
Router(conf ig)# interface fa0/0 .1
Router(conf ig -subif )#encapsulat ion dot1 Q 1
Router(conf ig -subif )#ip address 172.16.3.65 255.255.255.224
Router(conf ig-subif )#end
Vlan2
Router#configure termina l
Router(conf ig)# interface fa 0/0 .2
Router(conf ig -subif )#encapsulat ion dot1 Q 2
Router(conf ig -subif )#ip address 172.16.3.1 255.255.255.192
Router(conf ig -subif )#end
Router#wr
Router2:
Vlan1
Router>enable
Router#configure termina l
Router(conf ig)# interface fa0/0 .1
Router(conf ig -subif )#encapsulat ion dot1 Q 1
Router(conf ig -subif )#ip address 172.16.2.129 255.255.255.128
Router(conf ig -subif )#end
Vlan2
Router#configure termina l
Router(conf ig)# interface fa0/0 .2
Router(conf ig-subif )#encapsulat ion dot1 Q 2
Router(conf ig -subif )#ip address 172.16.2.1 255.255.255.128
Router(conf ig -subif )#end
Router#wr
Router3:
Vlan1
Router>enable
Router#configure termina l
Router(conf ig)# interface fa 0/0 .1
Router(conf ig -subif )#encapsulat ion dot1 Q 1
Router(conf ig -subif )#ip address 172.16.0.1 255.255.255.0
Router(conf ig -subif )#end
5
6. Ed u ard An g ri l l
ASI XI I
Vlan2
Router#configure termina l
Router(conf ig)# interface fa 0/0 .2
Router(conf ig -subif )#encapsulat ion dot1 Q 2
Router(conf ig -subif )#ip address 172.16.1.1 255.255.255.0
Router(conf ig -subif )#end
Router#wr
Ahora se puede realizar la misma prueba q ue en el caso anterio r, ha ciendo u n
"trace rt" en tre dos IPs de la mis ma VLAN y d os IPs de difer entes VLANS:
En el caso de las Vlans diferentes se puede o bservar cómo el "tra cert " pasa po r el
router y luego se envía a la in terfaz indicad a. Al contra rio que co n las IPs de l a
misma Vlan, que a cce den directamente al pu erto del switch pertinen te.
4. Configuración de VTP:
Este tipo de configura ción se s uele usar e n grandes redes con mu chos switche s,
donde uno de ellos es el "S ervidor " de sde el que se puede n crear , eliminar y
modificar las VLAN. Cuando se realice n ca mbios en el switch s ervidor , es tos se
enviarán al res to de switches "Cl iente s" y sw itches "Transpar entes ".
Los switches "C liente s" re ciben las actu alizaciones VTP de los "Se rvidores " y las
aplican, en ellos no se puede crear ni modificar VLANS, solo sincronizan la s
actu alizaciones enviadas desde los switch se rvidores.
Los swi tches "T ransparentes " transmite n la
Servidores a los siwtches Cli entes pero no
transmiten , po r lo ta nto es te tip o de swi tches
localmente y no a través de las a ctualiza cion es de
informa ción de los switches
a plican la con figuración que
tienen que e star ges tionad os
un swi tch Serv idor.
6
7. Ed u ard An g ri l l
ASI XI I
Ejemplo de c onfiguración de cada modo:
Configurar s witch en modo "S erver":
Swi t ch> en ab l e
Swi t ch#co n fi g u re termi n al
Swi t ch(conf i g)#vtp d o mai n asi x
Swi t ch(conf i g)#vtp mo d e serve r
Swi t ch(conf i g)#vtp versi o n 2
Swi t ch(conf i g)#vtp p assw o rd ci sco
Swi t ch(conf i g)#en d
Swi t ch#w r
Configurar s witch en modo "Transparen te":
Swi t ch> en ab l e
Swi t ch#co n fi g u re termi n al
Swi t ch(conf i g)#vtp d o mai n asi x
Swi t ch(conf i g)#vtp mo d e tran sp aren t
Swi t ch(conf i g)#vtp versi o n 2
Swi t ch(conf i g)#vtp p assw o rd ci sco
Swi t ch(conf i g)#en d
Swi t ch#w r
Co n figu ra r s witc h en mo do " Clien t e":
Swi t ch> en ab l e
Swi t ch#co n fi g u re termi n al
Swi t ch(conf i g)#vtp d o mai n asi x
Swi t ch(conf i g)#vtp mo d e cl i en t
Swi t ch(conf i g)#vtp versi o n 2
Swi t ch(conf i g)#vtp p assw o rd ci sco
Swi t ch(conf i g)#en d
Swi t ch#w r
5. Configuración de Seguridad d e puer tos:
Restr icc ión de puer to por Nume ro de Conexi ones:
Se con figurará la inter faz "FA 0/ 1" del "Swit ch2" p ara que solo a cepte un máxim o
de 3 equipos cone ctad os a esa interf az:
Sw i tch 2:
Swi t ch# co n fi g u re termi n al
Swi t ch(conf i g)#i n terface f a 0/ 1
Swi t ch(conf i g-if )#sw i tch po rt mo d e access
Swi t ch(conf i g-if )#sw i tch po rt p o rt -secu ri ty
Swi t ch(conf i g-if )#sw i tch po rt p o rt -secu ri ty maxi mu m 3
Swi t ch(conf i g-if )#sw i tch po rt p o rt -secu ri ty mac-ad d re ss sti ck y
Swi t ch(conf i g-if )#sw i tch po rt p o rt -secu ri ty vi o l ati on sh u td o wn
Swi t ch(conf i g-if )#en d
Swi t ch#w r
El primer paso con siste en acceder a la interfaz , a contin uación se colo ca el
puerto en modo acceso , se selecciona el máx imo de conexiones ace ptad as . Con el
comand o ".. . mac-addres s sti cky" el switch g uardará un registro de toda s las Mac
que se co necten y con el coman do ". .. viol ation shutdown ", cua ndo vea q ue en
su registro hay más de 3 direcciones MAC co necta das a esa interfaz , desconectará
la interfaz.
7
8. Ed u ard An g ri l l
ASI XI I
Para que almacene las MAC se tiene que ge nerar trá fico de s de ca da PC . Ejemplo
al cone ctar u n cuar to PC:
Restr icc ión de puer to por MAC:
En el siguiente caso, se configurará la inter faz "FA 0/1 " del "Swit ch6" p ara que
solo a cepte a un e quipo dete rminado por la dirección MAC del mismo :
Sw i tch 6:
Swi t ch#co n fi g u re termi n al
Swi t ch(conf i g)#i n terface F astEth e rn et 0/ 1
Swi t ch(conf i g-if )#sw i tch po rt mo d e access
Swi t ch(conf i g-if )#sw i tch p o rt -secu ri ty
Swi t ch(conf i g-if )#sw i tch p o rt -secu ri ty mac- ad d ress 00 90. 2B 73. 57 66
Swi t ch(conf i g-if )#sw i tch p o rt -secu ri ty vi o l ati o n shu td ow n
Swi t ch(conf i g-if )#en d
Swi t ch#w r
El comand o es muy similar al anterior, se diferencia por el comando " .. .mac address [mac_de l_PC]" d onde se espe cifica que equipo se po drá conectar a esa
interfaz y con el comando " .. . violation shutdown " en caso de que un PC que no
corresp onda co n la MAC definida se conecte en dicha in terfaz , la inter faz será
descone ctada automáticamen te:
Deshabilita r Puertos Inact ivos:
Para desha bilitar los p uertos de un switch y incrementar su seguridad , se puede
usar el comand o " intere rface range fastEthernet [int_ inic ial]-[ int_final]" qu e
deshabilitará el rango de puertos es pecifica d o (Tiene n q ue ser consecutivos) :
swi t ch#co n fi g u re termi n al
swi t ch(conf i g)#i n tererf ace r an g e fastEth ern et 0/ 5 -24
swi t ch(conf i g-if -range)#sh u td o w n
8
9. Ed u ard An g ri l l
ASI XI I
6. Configuración de las interfaces WAN:
Configuración de Bandwid th y Protoco lo PPP:
Rout er> en ab l e
Rout er# co n fi g u re termi n al
Rout er(co nf i g)#i n terface Seri al 0/ 0/ 0
Rout er(co nf i g-if )#en cap su l ati o n p p p
Rout er(co nf i g-if )#b an d wi d th 2000
Rout er(co nf i g-if )#exi t
Rout er(co nf i g)#i n terface Seri al 0/ 1/ 0
Rout er(co nf i g-if )#en cap su l ati o n p p p
Rout er(co nf i g-if )#b an d wi d th 4000
Rout er(co nf i g-if )#en d
Configuración EIGRP:
Ro u ter1 EI G RP:
Rout er# co n fi g u re termi n al
Rout er(co nf i g)#ro u ter ei g rp 1
Rout er(co nf i g-rout er)#n o au to -su mmary
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 96 0 . 0. 0. 3
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 104 0. 0. 0. 3
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 64 0 . 0. 0. 31
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 0 0. 0. 0. 63
Rout er(co nf i g-rout er)#p assi v e-i n terfac e F as tEth ern et 0/ 0
Rout er(co nf i g-rout er)#en d
Rout er#w r
Ro u ter2 EI G RP:
Rout er> en ab l e
Rout er# co n fi g u re termi n al
Rout er(co nf i g)#ro u ter ei g rp 1
Rout er(co nf i g-rout er)#n o au to -su mmary
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 96 0 . 0. 0. 3
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 100 0. 0. 0. 3
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 2. 128 0. 0. 0. 127
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 2. 0 0. 0. 0. 127
Rout er(co nf i g-rout er)#p assi v e-i n terfac e F as tEth ern et 0/ 0
Rout er(co nf i g-rout er)#en d
Rout er#w r
Ro u ter3 EI G RP:
Rout er> en ab l e
Rout er# co n fi g u re termi n al
Rout er(co nf i g)#ro u ter ei g rp 1
Rout er(co nf i g-rout er)#n o au to -su mmary
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 104 0. 0. 0. 3
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 3. 100 0. 0. 0. 3
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 0. 0 0. 0. 0. 255
Rout er(co nf i g-rout er)#n etw o rk 172. 1 6. 1. 0 0. 0. 0. 255
Rout er(co nf i g-rout er)#p assi v e-i n terfac e F as tEth ern et 0/ 0
Rout er(co nf i g-rout er)#en d
Rout er#w r
ATENCI ÓN: Muy impor tan te u sar el coman d o "no auto-su mary" an tes de configurar
las redes EIGRP, o estas no se pu blicarán , ya que por defecto les pondr á una máscara
de red "/1 6".
9
10. Ed u ard An g ri l l
ASI XI I
Una vez realizadas las configura ciones anteri ores, ya se tend rá cone ctividad entre las
diferentes redes LAN, par a compr obarlo se realiza un ping entre PCs de diferentes
VLANs (1 y 2 ) y de difere ntes re des LAN:
LAN 1
WAN
LAN 2
También se puede observar cómo el pr otocolo EIGRP usa el mayor an ch o de ban da
(entre otr as cosas) en lugar de el numer o de saltos:
10
11. Ed u ard An g ri l l
ASI XI I
7. Configuración de la admin istrac ión r emota de los switch es con SSH:
Esta configuración res ulta muy út il para el administ rador ya que no tie ne
que ir con e l portátil y e l cable de consola y conecta rse dire ctamente al
switch pa ra configurarlo, con la adm inistración rem ota se le asigna una IP al
switch y se le informa de cuál es su "gateway" para que pue da se r
administ rado de forma rem ota y segura usando SS H, a continua ción se
detalla e l proces o de config ura ción en un switch de cada LAN:
Switch 1:
Swi t ch> en ab l e
Swi t ch#co n fi g u re termi n al
Swi t ch(conf i g)#u sern ame ci sco p assw o r d ci sco
Swi t ch(conf i g)#i n terface vl an 1
Swi t ch(conf i g-if )#i p add ress 172. 1 6. 3. 70 2 5 5. 255. 25 5. 22 4
Swi t ch(conf i g-if )#n o sh u tdo wn
Swi t ch(conf i g-if )#exi t
Swi t ch(conf i g)#i p d efau l t-g atew ay 172. 16. 3. 65
Swi t ch(conf i g)#h o stn ame sw i tch 1
swi t ch1(co nf i g)#en ab l e p assw o rd ci sco
swi t ch1(co nf i g)#i p d o mai n -n ame an g ri ll . lo cal
swi t ch1(co nf i g)#cryp to key g en erate rsa
T he nam e f or t he keys wi l l be: swi t ch1 . a ngri l l. l ocal
Choo se t he si ze of t he key m odul us i n t he range of 360 t o 2048 f or your
G eneral Purpo se Key s. C hoo si ng a k ey m odu l us gre at er t han 5 12 m ay t ake a
f ew mi nut es.
Ho w m any bi t s i n t he m odul us [ 512] : 1024
% G enerat i ng 102 4 bi t RSA keys, key s wi l l be non-ex port a bl e. . . [ O K]
swi t ch1(co nf i g)#l i n e vty 0 15
swi t ch1(co nf i g-li ne)#p assw o rd ci sco
swi t ch1(co nf i g-li ne)#l o g i n
swi t ch1(co nf i g-li ne)#tran sp o rt i n p u t ssh
swi t ch1(co nf i g)#i p ssh ti me-ou t 30
swi t ch1(co nf i g)#i p ssh au th en ti cati o n -retri es 3
swi t ch1(co nf i g)#i p ssh versi o n 2
swi t ch1(co nf i g-li ne)#en d
swi t ch1#w r
Switch 7:
Swi t ch> en ab l e
Swi t ch#co n fi g u re termi n al
Swi t ch(conf i g)#u sern ame ci sco p assw o rd ci sco
Swi t ch(conf i g)#i n terface vl an 1
Swi t ch(conf i g-if )#i p add ress 172. 1 6. 0. 6 25 5. 255. 25 5. 0
Swi t ch(conf i g-if )#n o sh u tdo wn
Swi t ch(conf i g-if )#exi t
Swi t ch(conf i g)#i p d efau l t-g atew ay 172. 16. 0. 1
Swi t ch(conf i g)#h o stn ame sw i tch 7
swi t ch7(co nf i g)#en ab l e p assw o rd ci sco
swi t ch7(co nf i g)#i p d o mai n -n ame an g ri ll . lo cal
swi t ch7(co nf i g)#cryp to key g en erate rsa
T he nam e f or t he keys wi l l be: swi t ch7 . a ngri l l. l ocal
Choo se t he si ze of t he key m odul us i n t he range of 360 t o 2048 f or your
G eneral Purpo se Key s. C hoo si ng a key m odu l us gre at er t han 5 12 m ay t ake a
f ew mi nut es.
11
12. Ed u ard An g ri l l
ASI XI I
Ho w m any bi t s i n t he m odul us [ 512] : 1024
% G enerat i ng 102 4 bi t RSA keys, key s wi l l be non-ex port a bl e. . . [ O K]
swi t ch7(co nf i g)#l i n e vty 0 15
swi t ch7(co nf i g-li ne)#p assw o rd ci sco
swi t ch7(co nf i g-li ne)#l o g i n
swi t ch7(co nf i g-li ne)#tran sp o rt i n p u t ssh
swi t ch7(co nf i g)#i p ssh ti me-ou t 30
swi t ch7(co nf i g)#i p ssh au th en ti cati o n -retri es 3
swi t ch7(co nf i g)#i p ssh versi o n 2
swi t ch7(co nf i g-li ne)#en d
swi t ch7#w r
Switch 4:
Swi t ch> en ab l e
Swi t ch#co n fi g u re t ermi n al
Swi t ch(conf i g)#u sern ame ci sco p assw o rd ci sco
Swi t ch(conf i g)#i n terface vl an 1
Swi t ch(conf i g-if )#i p add ress 172. 1 6. 2. 13 3 2 55. 255. 2 55. 1 28
Swi t ch(conf i g-if )#n o sh u tdo wn
Swi t ch(conf i g-if )#exi t
Swi t ch(conf i g)#i p d efau l t-g atew ay 172. 16. 2. 129
Swi t ch(conf i g)#h o stn ame sw i tch 4
swi t ch4(co nf i g)#en ab l e p assw o rd ci sco
swi t ch4(co nf i g)#i p d o mai n -n ame an g ri ll . lo cal
swi t ch4(co nf i g)#cryp to key g en erate rsa
T he nam e f or t he keys wi l l be: swi t ch4 . a ngri l l. l ocal
Choo se t he si ze of t he key m odul us i n t he range of 360 t o 2 048 f or your
G eneral Purpo se Key s. C hoo si ng a key m odu l us gre at er t han 5 12 m ay t ake a
f ew mi nut es.
Ho w m any bi t s i n t he m odul us [ 512] : 1024
% G enerat i ng 102 4 bi t RSA keys, key s wi l l be non-ex port a bl e. . . [ O K]
swi t ch4(co nf i g)#l i n e vty 0 15
swi t ch4(co nf i g-li ne)#p assw o rd ci sco
swi t ch4(co nf i g-li ne)#l o g i n
swi t ch4(co nf i g-li ne)#tran sp o rt i n p u t ssh
swi t ch4(co nf i g)#i p ssh ti me-ou t 30
swi t ch4(co nf i g)#i p ssh au th en ti cati o n -retri es 3
swi t ch4(co nf i g)#i p ssh versi o n 2
swi t ch4(co nf i g-li ne)#en d
swi t ch4#w r
Para realizar la conexión se u sa la siguiente orden desde un terminal de la re d LAN:
Comando "s sh -l c is co I P_s witch ":
12