Translate

Mostrar mensagens com a etiqueta Switching. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta Switching. Mostrar todas as mensagens

quarta-feira, 1 de maio de 2013

Spanning-Tree e Port Mirroring

Configuração de STP e SPAN em GNS3:


Nota: Todos os objectos da topologia acima são Routers da série 3600, em que mudei a "skin" para se parecerem fisicamente com Switches ou PCs/Servers consoante o caso. Para além disso, para que os routers se "comportem" como switches, está configurado na "slot0" do GNS3 o módulo "NM-16ESW".

1) Configurações de rede:

PC(config): interface ethernet0/0
PC(config-if): no shutdown
PC(config-if): ip address 192.168.10.100 255.255.255.0

WEBSERVER(config): interface ethernet0/0
WEBSERVER(config-if): no shutdown
WEBSERVER(config-if): ip address 192.168.10.101 255.255.255.0

O PC "Wireshark" é uma ligação do tipo "Host" onde se configura a ligação ao "Microsoft Loopback". No PC físico, está instalado o Wireshark e o IP do Loopback está configurado tal como na figura abaixo:


2) Criação de VLAN 10, em todos os Switches:

Switch1# vlan database
Switch1(vlan)# vlan 10
Switch1(vlan)# apply
Switch1(vlan)# exit

Switch2# vlan database
Switch2(vlan)# vlan 10
Switch2(vlan)# apply
Switch2(vlan)# exit

Switch3# vlan database
Switch3(vlan)# vlan 10
Switch3(vlan)# apply
Switch3(vlan)# exit

3) Configuração de VTP em todos os switches:

Switch1# vlan database
Switch1(vlan)# vtp domain JOAO
Switch1(vlan)# vtp password cisco
Switch1(vlan)# vtp server
Switch1(vlan)# apply
Switch1(vlan)# exit

Switch2# vlan database
Switch2(vlan)# vtp domain JOAO
Switch2(vlan)# vtp password cisco
Switch2(vlan)# vtp server
Switch2(vlan)# apply
Switch2(vlan)# exit

Switch3# vlan database
Switch3(vlan)# vtp domain JOAO
Switch3(vlan)# vtp password cisco
Switch3(vlan)# vtp server
Switch3(vlan)# apply
Switch3(vlan)# exit

4) Configuração de speed/duplex em todos os interfaces dos switches:

Switch1(config): interface range fastethernet 0/0 - 15
Switch1(config-if): duplex half
Switch1(config-if): speed 10

Switch2(config): interface range fastethernet 0/0 - 15
Switch2(config-if): duplex half
Switch2(config-if): speed 10

Switch3(config): interface range fastethernet 0/0 - 15
Switch3(config-if): duplex half
Switch3(config-if): speed 10

Nota: Esta configuração permite que o GNS3 comunique correctamente com o "Loopback". Note-se que este interface lógico comunica a 10Mbps, tal como se pode confirmar na figura abaixo:


5) Associar o interface de "loopback" (fa0/0) e o interface que liga ao PC (fa0/1), à vlan 10:

Switch1(config): interface fastethernet 0/0
Switch1(config-if): no shutdown
Switch1(config-if): switchport mode access
Switch1(config-if): switchport access vlan 10
Switch1(config-if): exit

Switch1(config): interface fastethernet 0/1
Switch1(config-if): no shutdown
Switch1(config-if): switchport mode access
Switch1(config-if): switchport access vlan 10
Switch1(config-if): exit

6) Em todos os switches, criar interfaces lógicos de gestão:

Switch1(config): interface vlan 10
Switch1(config-if): no shutdown
Switch1(config-if): ip address 192.168.10.201 255.255.255.0

Switch2(config): interface vlan 10
Switch2(config-if): no shutdown
Switch2(config-if): ip address 192.168.10.202 255.255.255.0

Switch3(config): interface vlan 10
Switch3(config-if): no shutdown
Switch3(config-if): ip address 192.168.10.203 255.255.255.0

7) Criar "trunks" entre os diversos switches:

Switch1(config): interface range fastethernet 0/2 - 3
Switch1(config-if): no shutdown
Switch1(config-if): switchport mode trunk
Switch1(config-if): switchport trunk encapsulation dot1q
Switch1(config-if): switchport trunk allowed vlan all
Switch1(config-if): switchport trunk native vlan 1

Switch2(config): interface fastethernet 0/0
Switch2(config-if): no shutdown
Switch2(config-if): switchport mode trunk
Switch2(config-if): switchport trunk encapsulation dot1q
Switch2(config-if): switchport trunk allowed vlan all
Switch2(config-if): switchport trunk native vlan 1

Switch3(config): interface fastethernet 0/0
Switch3(config-if): no shutdown
Switch3(config-if): switchport mode trunk
Switch3(config-if): switchport trunk encapsulation dot1q
Switch3(config-if): switchport trunk allowed vlan all
Switch3(config-if): switchport trunk native vlan 1

8) configurar o "Switch1" como "root bridge", para a vlan 10:

Switch1(config): spanning-tree vlan 10 priority 4096

9) Verificar o cenário, com os seguintes comandos:

Em todos os switches verificar o status referente ao "spanning-tree". Neste caso, a imagem é retirada do "Switch1", após ter executado o comando "show spanning-tree brief". Verifica-se que este é o "root bridge" para a vlan 10:

Em todos os switches verificar os "trunks". Neste caso, a imagem é retirada do "Switch2", após ter executado o comando "show interfaces trunk":

Em todos os switches verificar o mapeamento de interfaces a vlans. Neste caso, a imagem é retirada do "Switch3", após ter executado o comando "show vlan-switch"

10) Configurar "SPAN" (ie., Port Mirroring na linguagem Cisco), por forma a poder analisar o tráfego que "corre" entre o PC e o Webserver, no Wireshark que está instalado no PC físico:

Switch1(config): monitor session 1 source interface fastethernet 0/1 both
Switch1(config): monitor session 1 destination interface fastethernet 0/0

11) Verificar no Wireshark, o tráfego entre o "PC" e o "WebServer" quando a partir do "PC" se faz um ping:



Como se pode verificar na imagem acima, o interface "loopback" está a capturar tráfego que não é recebido nem transmitido pela sua própria porta. Esta é a vantagem do "Port Mirroring", que consiste em poder analisar tráfego que circula em todo o switch ou switches (neste caso poder-se-ia utilizar o RSPAN, mas o GNS3 não permite) e não apenas o que corre no PC onde está o Wiereshark.

domingo, 13 de janeiro de 2013

Teste CCNP para empregadores


Teste CCNP para empregadores:




Pressupostos:

- Não se podem criar interfaces adicionais;
- Não se podem criar rotas estáticas ou rotas "policy-based", excepto quando pedido;

Tarefa 1: Configurar um trunk 802.1q entre o interface fa1/15 do SW1 e o interface fa1/15 do SW2 fa1/15:

SW1(config): interface fastethernet 1/15
SW1(config-if): no shutdown
SW1(config-if): switchport trunk encapsulation dot1q
SW1(config-if): switchport mode trunk

SW2(config): interface fastethernet 1/15
SW2(config-if): no shutdown
SW2(config-if): switchport trunk encapsulation dot1q
SW2(config-if): switchport mode trunk

Tarefa 2: Configurar um trunk 802.1Q "etherchannel" entre o SW1 e o SW2. Ambos os interfaces fa1/10 and fa1/11 devem fazer parte do mesmo LAG:

SW1(config): interface range fastethernet 1/10 - 11
SW1(config-if-range): no shutdown
SW1(config-if-range): channel-group 1 mode on
SW1(config-if-range): switchport mode trunk
SW1(config-if-range): switchport encapsulation dot1q

SW1(config): interface port-channel 1
SW1(config-if): switchport mode trunk
SW1(config-if): switchport encapsulation dot1q

SW2(config): interface range fastethernet 1/10 - 11
SW2(config-if-range): no shutdown
SW2(config-if-range): channel-group 1 mode on
SW2(config-if-range): switchport mode trunk
SW2(config-if-range): switchport encapsulation dot1q

SW2(config): interface port-channel 1
SW2(config-if): switchport mode trunk
SW2(config-if): switchport encapsulation dot1q

Tarefa 3: Garantir que o tráfego VLAN atravessa o trunk do interface fa1/15 e não o trunk "etherchannel", a não ser que o trunk fa1/15 esteja em baixo:

SW2(config): interface fastethernet 1/15
SW2(config-if): spanning-tree cost 1

Tarefa 4: Os routers R1 e R2 devem fazer parte da VLAN 10 e devem ser ambos pingáveis através da interface fa0/0. Como estamos no GNS3, teremos que usar o comando "vlan database" para criar a VLAN:

R1(config): interface fastethernet 0/0
R1(config-if): ip address 192.168.12.1 255.255.255.0
R1(config-if): speed 10
R1(config-if): duplex half

R2(config): interface fastethernet 0/0
R2(config-if): ip address 192.168.12.2 255.255.255.0
R2(config-if): speed 10
R2(config-if): duplex half

SW1#: vlan database
SW1(vlan): vtp server
SW1(vlan): vtp domain teste
SW1(vlan): vtp password cisco
SW1(vlan): vlan 10
SW1(vlan): apply

SW1(config): interface fastethernet 1/0
SW1(config-if): speed 10
SW1(config-if): duplex half
SW1(config-if): switchport mode access
SW1(config-if): switchport access vlan 10

SW2(vlan): vtp domain teste
SW2(vlan): vtp password cisco
SW2(vlan): vtp client
SW2(vlan): apply

SW2(config): interface fastethernet 1/0
SW2(config-if): speed 10
SW2(config-if): duplex half
SW2(config-if): switchport mode access
SW2(config-if): switchport access vlan 10

Tarefa 5: Garantir que o tráfego da VLAN 10 não pode atravessar o trunk do interface fa1/15:

SW1(config): interface fastethernet 1/15
SW1(config-if): switchport trunk allowed vlan except 10

SW2(config): interface fastethernet 1/15
SW2(config-if): switchport trunk allowed vlan except 10

Tarefa 6: Garantir que o SW1 seja sempre o "root switch" para a VLAN 10, mesmo que outro switch seja colocado na mesma rede:

SW1(config): spanning-tree vlan 10 root primary

Tarefa 7: Configurar OSPF (area 0) entre o R1 e o R2. Os "hellos" em OSPF só devem ser enviados a partir do interface que faz parte da area 0. Garantir que o loopback 0 de R1 pode pingar o loopback 0 de R2:

R1(config): router ospf 1
R1(config-router): router-id 1.1.1.1
R1(config-router): passive-interface default
R1(config-router): network 192.168.12.0 0.0.0.255 area 0
R1(config-router): network 1.1.1.1 0.0.0.0 area 0
R1(config-router): no passive-interface fastethernet 0/0

R2(config): router ospf 1
R2(config-router): router-id 2.2.2.2
R2(config-router): passive-interface default
R2(config-router): network 192.168.12.0 0.0.0.255 area 0
R2(config-router): network 2.2.2.2 0.0.0.0 area 0
R2(config-router): no passive-interface fastethernet 0/0

Tarefa 8: Configurar o EIGRP (AS100) entre R1 & R3 e R2 & R3 apenas. Garantir que o R3 redistribui o interface loopback 0 apenas:

R1(config): router eigrp 100
R1(config-router): no auto-summary
R1(config-router): passive-interface default
R1(config-router): network 192.168.13.0 0.0.0.255
R1(config-router): no passive-interface fastethernet 0/1

R2(config): router eigrp 100
R2(config-router): no auto-summary
R2(config-router): passive-interface default
R2(config-router): network 192.168.13.0 0.0.0.255
R2(config-router): network 192.168.23.0 0.0.0.255
R2(config-router): no passive-interface fastethernet 0/0
R2(config-router): no passive-interface fastethernet 0/1

R3(config): router eigrp 100
R3(config-router): no auto-summary
R3(config-router): passive-interface default
R3(config-router): network 192.168.23.0 0.0.0.255
R3(config-router): no passive-interface fastethernet 0/1

R3(config): route-map CONNECTED_TO_EIGRP permit 10
R3(config-route-map): match interface Loopback0
R3(config): router eigrp 100
R3(config-router): redistribute connected metric 1 1 1 1 1500 route-map CONNECTED_TO_EIGRP

Tarefa 9: Configurar redistribuição mútua entre OSPF e EIGRP em R1 e R2. Todos os routers (R1, R2 e R3) devem ser capazes apenas de pingar os respectivos interfaces loopbacks 0 entre eles:

R1(config): router ospf 1
R1(config-router): redistribute eigrp 100 subnets

R1(config): router eigrp 100
R1(config-router): redistribute ospf 1 metric 1 1 1 1 1500

R2(config): router ospf 1
R2(config-router): redistribute eigrp 100 subnets

R2(config): router eigrp 100
R2(config-router): redistribute ospf 1 metric 1 1 1 1 1500

Tarefa 10: Sem utilizar rotas estáticas ou rotas "policy-based", garantir que o R2 é capaz de fazer um traceroute para o interface loopback 0 de R3, sobre o link directamente ligado:

R2(config): access-list 1 permit host 192.168.23.1
R2(config): route-map NEXT_HOP permit 10
R2(config-route-map): match ip address
R2(config-route-map): set ip next-hop 192.168.23.2

R2(config): interface fastethernet 0/1
R2(config-if): ip policy route-map NEXT_HOP

Tarefa 11: Negar o acesso telnet a R2 por parte do R1, quando a sessão é iniciada a partir do interface fa0/0 de R1:

R2(config): access-list 10 deny host 192.168.12.1 0.0.0.255
R2(config): access-list 10 permit any

R2(config): line vty 0 4
R2(config-line): access-class 10 in

Tarefa 12: Em R2, redistribuir RIP para dentro de OSPF e RIP para dentro de EIGRP. Evitar potenciais loops. Todos os routers devem estar alcançáveis entre eles a partir do interface loopback 0:

R2(config): router ospf 1
R2(config-router): redistribute rip metric 5 subnets

R2(config): router eigrp 100
R2(config-router): redistribute rip metric 1 1 1 1 1500

R2(config): router rip
R2(config-router): redistribute ospf 1 metric 3
R2(config-router): redistribute eigrp 100 metric 1 1 1 1 1500

Nota: No R4 quando se faz "show ip route" verifica-se "routing loops" já que se tem várias entradas na routing table associadas a RIP quando estas nunca poderiam ser anunciadas pelo RIP originalmente !!!

DESCARREGAR AS CONFIGS AQUI