Existem 4 possibilidades de anunciar a "default-route" no EIGRP. Assim, no router da periferia entre a LAN e a WAN pode recorrer-se a um de quatro métodos:
1) Redistribuição de Rota;
2) Rede 0.0.0.0;
3) Comando "ip default-network";
4) Sumarização de Rota;
Assim, considerando o seguinte cenário, depois da configuração EIGRP para o AS 100, em todos os routers da LAN (R1, R2 e R3) e da criação de uma "default route" no router ISP, dirigida para o router da periferia:
1) "Route Redistribution":
No R1:
a) Criar rota estática:
R1(config): ip route 0.0.0.0 0.0.0.0 FastEthernet1/0
b) Redistribuir no processo do EIGRP a rota estática criada antes:
R1(config): router eigrp 100
R1(config-router): redistribute static metric 1 1 1 1 1
2) "Network 0.0.0.0":
No R1:
a) Criar rota estática:
R1(config): ip route 0.0.0.0 0.0.0.0 Null0
Nota: O comando "Null0" evita que ocorram "routing loops"
b) Anunciar a rota 0.0.0.0 (que significa tudo) no processo do EIGRP:
R1(config): router eigrp 100
R1(config-router): network 0.0.0.0
3) "IP Default-Network":
No R1:
a) Criar "default network" para a rede que liga à WAN:
R1(config): ip default-network 192.168.100.0
Nota: Este comando é no EIGRP o equivalente ao "default-information originate" no OSPF, com a desvantagem neste caso que anuncia uma rede "classful". Assim, a rede 192.168.100.0/30 é anunciada como 192.168.100.0/24
b) Verificar que no "show run" a rede acima aparece como "classfull" (ie, a rede é considerada neste caso de classe C de acordo com o RFC 1918), tal como foi referido acima.
c) Acrescentar no processo de EIGRP:
R1(config): router eigrp 100
R1(config-router): network 0.0.0.0
4) "Route Summarization":
No R1:
R1(config): interface fastethernet 1/0
R1(config-if): ip summary-address eigrp 100 0.0.0.0 0.0.0.0
R1(config): router eigrp 100
R1(config-router): network 0.0.0.0
Nota: Neste caso procede-se à sumarização da rede, ie., reduzir a uma só rede todas as redes num só "anúncio".
No final, verificar com "ping" e/ou "show ip route" que por exemplo em R3, tal como com os restantes routers, consegue-se chegar ao ISP.
Este blog pretende apoiar os profissionais de TI que pretendam aprofundar os seus conhecimentos na área do networking e queiram eventualmente obter a certificação CCNA e CCNP.
Translate
Mostrar mensagens com a etiqueta CCNP. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta CCNP. Mostrar todas as mensagens
domingo, 12 de maio de 2013
domingo, 5 de maio de 2013
Configuração SSH
Configuração de SSH (cliente e servidor) em Routers Cisco (série 3600):
1) Atribuir/alterar nome do SSH_Server:
Router(config): hostname SSH_Server
2) Configurações de rede:
SSH_Server(config): interface ethernet0/0
SSH_Server(config-if): no shutdown
SSH_Server(config-if): ip address 192.168.10.2 255.255.255.0
SSH_Server(config): interface ethernet1/0
SSH_Server(config-if): no shutdown
SSH_Server(config-if): ip address 192.168.100.2 255.255.255.0
SSH_Client2(config): interface ethernet0/0
SSH_Client2(config-if): no shutdown
SSH_Client2(config-if): ip address 192.168.100.1 255.255.255.0
Nota: O "SSH_Client1" é o interface de loopback do computador físico onde está instalado o GNS3 e tem o IP 192.168.10.1/24
3) Atribuir/alterar nome do SSH_Server:
Router(config): hostname SSH_Server
4) Apagar par de chaves que eventualmente existam no servidor (opcional):
SSH_Server(config): crypto key zeroize rsa
5) Criar sufixo (domínio) por forma a ter um FQDN ("Fully Qualified Domain Name"):
SSH_Server(config): ip domain-name cisco.lan
6) Gerar par de chaves pública/privada no servidor:
SSH_Server(config): crypto key generate rsa general-keys modulus 1024
Nota: "1024" refere-se ao tamanho da chave em bits
7) Criar utilizador local e respectiva senha:
SSH_Server(config): username cisco privilege 15 secret cisco
Nota: Pretende-se criar um usuário com privilégios totais de acesso, daí o "privilege 15", sendo que a senha fica armazenada no próprio router mas encriptada por forma a não ser possível vê-la no ficheiro de configuração, daí o comando "secret", seguido da senha.
8) Configurar o acesso ao "SSH_Server":
SSH_Server(config): line vty 0 4
SSH_Server(config-line): login local
SSH_Server(config-line): transport input ssh
SSH_Server(config-line): exit
Nota: O comando "login" significa que o acesso às linhas VTY exige sempre senha e o "local", que esta está armazenada no próprio Router. O comando "transport input ssh", significa que a única forma de acesso autorizada é por ssh, não sendo por exemplo possível entrar por telnet.
9) Garantir que a versão de SSH é a "2", reduzir o número de tentativas para 3 e o time-out para 5 segundos, antes de fechar a sessão:
SSH_Server(config): ip ssh version 2
SSH_Server(config): ip ssh authentication-retries 3
SSH_Server(config): ip ssh time-out 5
10) Testar o acesso a partir do "SSH_Client1", recorrendo ao aplicativo "Putty":
a) Inserir o IP do servidor de SSH (192.168.10.2) e a porta (22):
b) O Servidor responde com o envio da chave pública - escolher a opção "Sim":
e) Verificar aspectos relacionados com o protocolo SSH, recorrendo aos comandos "show ip ssh" e "show ssh":
11) Testar o acesso a partir do "SSH_Client2", pelo CLI:
Nota: Os comandos utilizados foram:
SSH_Server ssh -l cisco 192.168.100.2
em que: "cisco" é o username e "192.168.100.2" é o IP do servidor
12) Verificar quais as portas abertas no "SSH_Server":
SSH_Server# show control-plane host open-ports
(Dependendo do modelo do Router e versão do IOS, este comando poderá não existir)
Como funciona o SSH ?
a) Negociação entre o cliente e servidor quanto à versão de SSH e o tipo de encriptação comum a utilizar;
b) O servidor envia a sua chave pública para o cliente;
c) O cliente recebe a chave pública do servidor e gera um par de chaves de sessão (pública/privada);
d) O cliente envia o par de chaves de sessão encriptado com a chave pública do servidor;
e) O servidor decripta o par de chaves de sessão recorrendo à chave privada que já possui e envia mensagem de confirmação encriptada com a chave de sessão;
f) A partir daqui a comunicação é encriptada com o par de chaves de sessão que é partilhado por ambos;
Configurações do Laboratório:
Router(config): hostname SSH_Server
2) Configurações de rede:
SSH_Server(config): interface ethernet0/0
SSH_Server(config-if): no shutdown
SSH_Server(config-if): ip address 192.168.10.2 255.255.255.0
SSH_Server(config): interface ethernet1/0
SSH_Server(config-if): no shutdown
SSH_Server(config-if): ip address 192.168.100.2 255.255.255.0
SSH_Client2(config): interface ethernet0/0
SSH_Client2(config-if): no shutdown
SSH_Client2(config-if): ip address 192.168.100.1 255.255.255.0
Nota: O "SSH_Client1" é o interface de loopback do computador físico onde está instalado o GNS3 e tem o IP 192.168.10.1/24
3) Atribuir/alterar nome do SSH_Server:
Router(config): hostname SSH_Server
4) Apagar par de chaves que eventualmente existam no servidor (opcional):
SSH_Server(config): crypto key zeroize rsa
5) Criar sufixo (domínio) por forma a ter um FQDN ("Fully Qualified Domain Name"):
SSH_Server(config): ip domain-name cisco.lan
6) Gerar par de chaves pública/privada no servidor:
SSH_Server(config): crypto key generate rsa general-keys modulus 1024
Nota: "1024" refere-se ao tamanho da chave em bits
7) Criar utilizador local e respectiva senha:
SSH_Server(config): username cisco privilege 15 secret cisco
Nota: Pretende-se criar um usuário com privilégios totais de acesso, daí o "privilege 15", sendo que a senha fica armazenada no próprio router mas encriptada por forma a não ser possível vê-la no ficheiro de configuração, daí o comando "secret", seguido da senha.
8) Configurar o acesso ao "SSH_Server":
SSH_Server(config): line vty 0 4
SSH_Server(config-line): login local
SSH_Server(config-line): transport input ssh
SSH_Server(config-line): exit
Nota: O comando "login" significa que o acesso às linhas VTY exige sempre senha e o "local", que esta está armazenada no próprio Router. O comando "transport input ssh", significa que a única forma de acesso autorizada é por ssh, não sendo por exemplo possível entrar por telnet.
9) Garantir que a versão de SSH é a "2", reduzir o número de tentativas para 3 e o time-out para 5 segundos, antes de fechar a sessão:
SSH_Server(config): ip ssh version 2
SSH_Server(config): ip ssh authentication-retries 3
SSH_Server(config): ip ssh time-out 5
10) Testar o acesso a partir do "SSH_Client1", recorrendo ao aplicativo "Putty":
a) Inserir o IP do servidor de SSH (192.168.10.2) e a porta (22):
b) O Servidor responde com o envio da chave pública - escolher a opção "Sim":
c) O Servidor pede as credenciais de acesso que são o "username" e "password" definidas no passo 7:
d) Verificar quem está logado, recorrendo ao comando "who", depois de se ter estabelecido uma sessão:
e) Verificar aspectos relacionados com o protocolo SSH, recorrendo aos comandos "show ip ssh" e "show ssh":
11) Testar o acesso a partir do "SSH_Client2", pelo CLI:
Nota: Os comandos utilizados foram:
SSH_Server ssh -l cisco 192.168.100.2
em que: "cisco" é o username e "192.168.100.2" é o IP do servidor
12) Verificar quais as portas abertas no "SSH_Server":
SSH_Server# show control-plane host open-ports
(Dependendo do modelo do Router e versão do IOS, este comando poderá não existir)
quarta-feira, 1 de maio de 2013
Spanning-Tree e Port Mirroring
Configuração de STP e SPAN em GNS3:
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.
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":
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:
quinta-feira, 25 de abril de 2013
Configuração simples de QoS
Neste cenário pretende-se mostrar que após a aplicação de uma política de QoS no Router, deixa de ser possível aceder ao Server por telnet a partir do PC:
1) Configuração básica de rede em todos os activos:
PC(config): interface fastethernet 0/0
PC(config-if): no shutdown
PC(config-if): ip address 10.10.10.1 255.0.0.0
PC(config-if): exit
ROUTER(config): interface fastethernet 1/0
ROUTER(config-if): no shutdown
ROUTER(config-if): ip address 10.10.10.254 255.0.0.0
ROUTER(config-if): exit
ROUTER(config): interface fastethernet 0/0
ROUTER(config-if): no shutdown
ROUTER(config-if): ip address 192.168.1.254 255.255.255.0
ROUTER(config-if): exit
SERVER(config): interface fastethernet 0/0
SERVER(config-if): no shutdown
SERVER(config-if): ip address 192.168.1.1 255.255.255.0
SERVER(config-if): exit
2) Configuração de roteamento:
PC(config): no ip routing
PC(config): ip default-gateway 10.10.10.254
SERVER(config): no ip routing
SERVER(config): ip default-gateway 192.168.1.254
3) Criação de access-list no Router:
ROUTER(config): ip access-list extended OUTBOUND
ROUTER(config-ext-nacl): permit tcp host 10.10.10.1 host 192.168.1.1
Nota: Pretende-se incluir apenas o PC e o SERVER para simplificar
4) Definição de política de QoS (MQC) no Router:
a) Criação de "Class-map" para escolher o que controlar, neste caso pretende-se controlar ambas as condições ao mesmo tempo: o acesso por telnet e a access-list "OUTBOUND", daí o comando "match-all":
ROUTER(config): class-map match-all CONTROLE
ROUTER(config-cmap): match access-group name OUTBOUND
ROUTER(config-cmap): match protocol telnet
ROUTER(config-cmap): exit
b) Criação de "Policy-map" para escolher o que fazer com o que se escolheu antes. Neste caso, pretende-se impedir o acesso ao server na porta 23, daí o comando "drop":
ROUTER(config): policy-map NO_TELNET
ROUTER(config-pmap): class CONTROLE
ROUTER(config-pmap-c): drop
c) Aplicação da regra anterior ao interface no sentido "outbound":
ROUTER(config): interface fastethernet 0/0
ROUTER(config-if): service-policy output NO_TELNET
5) Testar no PC:
No PC fazer um telnet ao SERVER e verificar que não é possível entrar na porta 23:
6) Testar no Router:
ROUTER: show policy-map interface fastethernet 0/0
Nota: Verificar o incremento de pacotes à medida que se testam sucessivamente
1) Configuração básica de rede em todos os activos:
PC(config): interface fastethernet 0/0
PC(config-if): no shutdown
PC(config-if): ip address 10.10.10.1 255.0.0.0
PC(config-if): exit
ROUTER(config): interface fastethernet 1/0
ROUTER(config-if): no shutdown
ROUTER(config-if): ip address 10.10.10.254 255.0.0.0
ROUTER(config-if): exit
ROUTER(config): interface fastethernet 0/0
ROUTER(config-if): no shutdown
ROUTER(config-if): ip address 192.168.1.254 255.255.255.0
ROUTER(config-if): exit
SERVER(config): interface fastethernet 0/0
SERVER(config-if): no shutdown
SERVER(config-if): ip address 192.168.1.1 255.255.255.0
SERVER(config-if): exit
2) Configuração de roteamento:
PC(config): no ip routing
PC(config): ip default-gateway 10.10.10.254
SERVER(config): no ip routing
SERVER(config): ip default-gateway 192.168.1.254
3) Criação de access-list no Router:
ROUTER(config): ip access-list extended OUTBOUND
ROUTER(config-ext-nacl): permit tcp host 10.10.10.1 host 192.168.1.1
Nota: Pretende-se incluir apenas o PC e o SERVER para simplificar
4) Definição de política de QoS (MQC) no Router:
a) Criação de "Class-map" para escolher o que controlar, neste caso pretende-se controlar ambas as condições ao mesmo tempo: o acesso por telnet e a access-list "OUTBOUND", daí o comando "match-all":
ROUTER(config): class-map match-all CONTROLE
ROUTER(config-cmap): match access-group name OUTBOUND
ROUTER(config-cmap): match protocol telnet
ROUTER(config-cmap): exit
b) Criação de "Policy-map" para escolher o que fazer com o que se escolheu antes. Neste caso, pretende-se impedir o acesso ao server na porta 23, daí o comando "drop":
ROUTER(config): policy-map NO_TELNET
ROUTER(config-pmap): class CONTROLE
ROUTER(config-pmap-c): drop
c) Aplicação da regra anterior ao interface no sentido "outbound":
ROUTER(config): interface fastethernet 0/0
ROUTER(config-if): service-policy output NO_TELNET
5) Testar no PC:
No PC fazer um telnet ao SERVER e verificar que não é possível entrar na porta 23:
6) Testar no Router:
ROUTER: show policy-map interface fastethernet 0/0
Nota: Verificar o incremento de pacotes à medida que se testam sucessivamente
domingo, 10 de março de 2013
Configuração de acesso à Internet com GNS3
ACESSO DO GNS3 À INTERNET:
1) No Virtual Box criar um interface lógico - ver figura:
2) Configurar com IP à escolha. Neste exemplo: 10.0.0.10/8 - ver figura:
3) No PC real (Windows 7), verificar as definições de rede para comunicação com o Virtualbox - ver figuras:
- 10.0.0.0/8 para a rede onde se encontra o Windows XP (virtual) e R1;
- 172.16.1.0/24 para o R1 e R2;
- 192.168.1.0/24 para a rede real. Esta deverá ser alterada consoante a rede real onde o laboratório está a ser recriado;
4) Em R1 configurar as placas de rede:
R1(config): interface fa0/0
R1(config-if): no shutdown
R1(config-if): ip address 10.0.0.2 255.0.0.0
R1(config-if): exit
R1(config): interface fa1/0
R1(config-if): no shutdown
R1(config-if): ip address 172.16.1.1 255.255.255.0
R1(config-if): exit
5) Em R1, configurar protocolo de roteamento:
R1(config): router ospf 1
R1(config-router): router-id 1.1.1.1
R1(config-router): network 10.0.0.0 0.255.255.255 area 0
R1(config-router): network 172.16.1.0 0.0.0.255 area 0
6) Em R1, configurar servidor de DHCP para o windows XP:
R1(config): ip dhcp pool SCOPE
R1(dhcp-config): network 10.0.0.0
R1(dhcp-config): default-router 10.0.0.2
R1(dhcp-config): dns-server 192.168.1.254
R1(dhcp-config): lease infinite
R1(dhcp-config): exit
R1(config): ip dhcp excluded-address 10.0.0.2
R1(config): ip dhcp excluded-address 10.0.0.10
7) Em R2, configurar as placas de rede:
R2(config): interface fa0/0
R2(config-if): no shutdown
R2(config-if): ip address 192.168.1.120 255.255.255.0
R2(config-if): exit
R2(config): interface fa1/0
R2(config-if): no shutdown
R2(config-if): ip address 172.16.1.2 255.255.255.0
R2(config-if): exit
8) Em R2, configurar protocolo de roteamento e criar rota estática:
R2(config): router ospf 1
R2(config-router): router-id 2.2.2.2
R2(config-router): network 192.168.1.0 0.0.0.255 area 0
R2(config-router): network 172.16.1.0 0.0.0.255 area 0
R2(config-router): default-information originate
R2(config): ip route 0.0.0.0 0.0.0.0 192.168.1.254
(em que 192.168.1.254 é o IP do router real)
9) No PC fisico (host) que tem o IP: 192.168.1.66 /24 adicionar as seguintes rotas estáticas pelo cmd.exe:
route add -p 172.16.1.0 MASK 255.255.255.0 192.168.1.120 IF 10
route add -p 10.0.0.0 MASK 255.0.0.0 192.168.1.120 IF 10
em que '10' é o interface físico. Esta designação poderá ser diferente! - ver figura:
Assim, o PC real (host) poderá comunicar com os activos do GNS3.
11) No Windows XP (Virtual box) que tem o IP: 10.0.0.1/8 adicionar as seguintes rotas estáticas pelo cmd.exe:
route add -p 172.16.1.0 MASK 255.255.255.0 10.0.0.2
route add -p 192.168.1.0 MASK 255.255.255.0 10.0.0.2
12) No router, adicionar rotas estáticas para as redes 10.0.0.0/8 e 172.16.1.0/24 dirigidas para o Gateway 192.168.1.120:
À semelhança do item 9) adiciona-se rotas para que o router real possa comunicar com a rede montada no GNS3.
12) No Windows XP, abrir o browser e testar o acesso à Internet !
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
Subscrever:
Mensagens (Atom)























