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 GNS3. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta GNS3. 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, 31 de março de 2013
Port Forwarding em Router Cisco
Redirecionamento de portas em Router Cisco:
1) Configuração inicial de rede em todos os routers do lab:
SSH(config): interface fastethernet 0/0
SSH(config-if): no shutdown
SSH(config-if): ip address 192.168.123.1 255.255.255.0
WEB(config): interface fastethernet 0/0
WEB(config-if): no shutdown
WEB(config-if): ip address 192.168.123.2 255.255.255.0
R3(config): interface fastethernet 0/0
R3(config-if): no shutdown
R3(config-if): ip address 192.168.123.3 255.255.255.0
R3(config): interface fastethernet 1/0
R3(config-if): no shutdown
R3(config-if): ip address 192.168.34.3 255.255.255.0
R4(config): interface fastethernet 0/0
R4(config-if): no shutdown
R4(config-if): ip address 192.168.34.4 255.255.255.0
2) Desactivação de funcionalidades de Router em WEB e SSH, para simular servidores:
WEB(config): no ip routing
WEB(config): ip default-gateway 192.168.123.3
SSH(config): no ip routing
SSH(config): ip default-gateway 192.168.123.3
3) Configuração de roteamento no R3 e R4:
R3(config): ip route 0.0.0.0 0.0.0.0 192.168.34.4
R4(config): ip route 192.168.123.0 255.255.255.0 192.168.34.3
4) Configuração de acesso total por telnet em WEB e SSH (não recomendado em ambientes de produção):
WEB(config): line vty 0 4
WEB(config-line): privilege level 15
SSH(config): line vty 0 4
SSH(config-line): privilege level 15
5) Configuração de NAT no R3:
R3(config): interface fastethernet 0/0
R3(config-if): ip nat inside
R3(config-if): exit
R3(config): interface fastethernet 1/0
R3(config-if): ip nat outside
R3(config-if): exit
6) Abertura das porta 80 no WEB e 22 no SSH:
WEB(config): ip http server
SSH(config): ip domain-name LAB.LOCAL
SSH(config): crypto key generate rsa
SSH(config): line vty 0 4
SSH(config-line): transport input ssh
7) Configuração de "Port Forwarding" nas portas 80 e 22 para o WEB e SSH respectivamente:
R3(config): ip nat inside source static tcp 192.168.123.2 80 192.168.34.3 80
R3(config): ip nat inside source static tcp 192.168.123.1 22 192.168.34.3 22
8) Testar o acesso por telnet no R4:
telnet 192.168.34.3 80
telnet 192.168.34.3 22
O resultado será o seguinte:
1) Configuração inicial de rede em todos os routers do lab:
SSH(config): interface fastethernet 0/0
SSH(config-if): no shutdown
SSH(config-if): ip address 192.168.123.1 255.255.255.0
WEB(config): interface fastethernet 0/0
WEB(config-if): no shutdown
WEB(config-if): ip address 192.168.123.2 255.255.255.0
R3(config): interface fastethernet 0/0
R3(config-if): no shutdown
R3(config-if): ip address 192.168.123.3 255.255.255.0
R3(config): interface fastethernet 1/0
R3(config-if): no shutdown
R3(config-if): ip address 192.168.34.3 255.255.255.0
R4(config): interface fastethernet 0/0
R4(config-if): no shutdown
R4(config-if): ip address 192.168.34.4 255.255.255.0
2) Desactivação de funcionalidades de Router em WEB e SSH, para simular servidores:
WEB(config): no ip routing
WEB(config): ip default-gateway 192.168.123.3
SSH(config): no ip routing
SSH(config): ip default-gateway 192.168.123.3
3) Configuração de roteamento no R3 e R4:
R3(config): ip route 0.0.0.0 0.0.0.0 192.168.34.4
R4(config): ip route 192.168.123.0 255.255.255.0 192.168.34.3
4) Configuração de acesso total por telnet em WEB e SSH (não recomendado em ambientes de produção):
WEB(config): line vty 0 4
WEB(config-line): privilege level 15
SSH(config): line vty 0 4
SSH(config-line): privilege level 15
5) Configuração de NAT no R3:
R3(config): interface fastethernet 0/0
R3(config-if): ip nat inside
R3(config-if): exit
R3(config): interface fastethernet 1/0
R3(config-if): ip nat outside
R3(config-if): exit
6) Abertura das porta 80 no WEB e 22 no SSH:
WEB(config): ip http server
SSH(config): ip domain-name LAB.LOCAL
SSH(config): crypto key generate rsa
SSH(config): line vty 0 4
SSH(config-line): transport input ssh
7) Configuração de "Port Forwarding" nas portas 80 e 22 para o WEB e SSH respectivamente:
R3(config): ip nat inside source static tcp 192.168.123.2 80 192.168.34.3 80
R3(config): ip nat inside source static tcp 192.168.123.1 22 192.168.34.3 22
8) Testar o acesso por telnet no R4:
telnet 192.168.34.3 80
telnet 192.168.34.3 22
O resultado será o seguinte:
9) Enquanto a ligação telnet está aberta testar no WEB:
WEB# show ip http server connection
sábado, 30 de março de 2013
Configuração ADSL em Router Cisco
CONFIGURAÇÃO DE ROUTER CISCO 877 ADSL (APENAS INTERNET):
1) Excluir o IP do Gateway (192.168.1.254) da atribuição DHCP :
Router(config): ip dhcp excluded-address 192.168.1.254
2) Configuração de Scope de DHCP chamada de "LAN":
Router(config): ip dhcp pool LAN
Router(dhcp-config): network 192.168.1.0 255.255.255.0
Router(dhcp-config): default-router 192.168.1.254
Router(dhcp-config): dns-server 192.168.1.254
Router(dhcp-config): lease infinite
3) Configuração de DNS:
Router(config): ip dns server
Router(config): ip name-server 194.65.47.43
Router(config): ip name-server 194.65.47.44
Nota: Estes IPs podem ser outros em função da operadora. Inclusivamente podem colocar-se os "famosos" servidores de DNS: 4.2.2.2, 8.8.8.8, etc...
4) Configuração da placa física ADSL:
Router(config): interface ATM0
Router(config-if): no ip address
Router(config-if): no atm ilmi-keepalive
Router(config-if): dsl operating-mode auto
Router(config-if): pvc 0/35
Router(config-if-atm-vc): encapsulation aal5snap
Router(config-if-atm-vc): pppoe-client dial-pool-number 1
Nota: Na MEO (PT), as definições de PVC (VPI/VCI) são 0/35 e encapsulamento é "aal5snap". Estas podem variar consoante as operadoras.
5) Configuração simples para as 4 placas de rede do Switch:
Router(config): interface range FastEthernet 0 - 3
Router(config-range-if): switchport mode access
Router(config-range-if): switchport access vlan 1
6) Configuração do Default-Gateway:
Router(config): interface Vlan1
Router(config-if): description GATEWAY LAN
Router(config-if): ip address 192.168.1.254 255.255.255.0
Router(config-if): ip nat inside
7) Configuração do interface Dialer 1 (Interface lógico de ATM0):
Router(config): interface Dialer1
Router(config-if): ip address negotiated
Router(config-if): ip mtu 1492
Router(config-if): ip nat outside
Router(config-if): encapsulation ppp
Router(config-if): dialer pool 1
Router(config-if): dialer-group 1
Router(config-if): no cdp enable
Router(config-if): ppp authentication pap callin
Router(config-if): ppp pap sent-username asxxxxxxxx@3p.sapo.pt password 0 xxxxxxxx
Router(config-if): ppp ipcp dns request
Nota:
- O IP de Dialer 1 é recebido dinamicamente por IPCP, daí o comando "ip address negotiated";
- O MTU é 1492 pois trata-se de uma ligação PPPoE, daí o comando "ip mtu 1492";
- É este interface que faz o NAT para fora, daí o comando "ip nat outside";
- O encapsulamento é "PPP", daí o comando "encapsulation ppp";
- A autenticação na operadora é neste caso "PAP", daí os comandos "ppp pap"
- O "username" e "password" são facultados pela operadora.
8) Configuração de rota estática:
Router(config): ip route 0.0.0.0 0.0.0.0 Dialer1
9) Configuração de NAT (tipo PAT):
Router(config): access-list 1 permit 192.168.1.0 0.0.0.255
Router(config): route-map internet-nat permit 10
Router(config-route-map): match ip address 1
Router(config-route-map): match interface Dialer1
Router(config): ip nat inside source route-map internet-nat interface Dialer1 overload
10) Configuração de NTP:
Router(config): ntp master
Router(config): ntp server 195.220.94.163
Nota: O servidor de NTP pode ser outro como por exemplo o "pool.ntp.org" (195.22.17.7)
1) Excluir o IP do Gateway (192.168.1.254) da atribuição DHCP :
Router(config): ip dhcp excluded-address 192.168.1.254
2) Configuração de Scope de DHCP chamada de "LAN":
Router(config): ip dhcp pool LAN
Router(dhcp-config): network 192.168.1.0 255.255.255.0
Router(dhcp-config): default-router 192.168.1.254
Router(dhcp-config): dns-server 192.168.1.254
Router(dhcp-config): lease infinite
3) Configuração de DNS:
Router(config): ip dns server
Router(config): ip name-server 194.65.47.43
Router(config): ip name-server 194.65.47.44
Nota: Estes IPs podem ser outros em função da operadora. Inclusivamente podem colocar-se os "famosos" servidores de DNS: 4.2.2.2, 8.8.8.8, etc...
4) Configuração da placa física ADSL:
Router(config): interface ATM0
Router(config-if): no ip address
Router(config-if): no atm ilmi-keepalive
Router(config-if): dsl operating-mode auto
Router(config-if): pvc 0/35
Router(config-if-atm-vc): encapsulation aal5snap
Router(config-if-atm-vc): pppoe-client dial-pool-number 1
Nota: Na MEO (PT), as definições de PVC (VPI/VCI) são 0/35 e encapsulamento é "aal5snap". Estas podem variar consoante as operadoras.
5) Configuração simples para as 4 placas de rede do Switch:
Router(config): interface range FastEthernet 0 - 3
Router(config-range-if): switchport mode access
Router(config-range-if): switchport access vlan 1
6) Configuração do Default-Gateway:
Router(config): interface Vlan1
Router(config-if): description GATEWAY LAN
Router(config-if): ip address 192.168.1.254 255.255.255.0
Router(config-if): ip nat inside
7) Configuração do interface Dialer 1 (Interface lógico de ATM0):
Router(config): interface Dialer1
Router(config-if): ip address negotiated
Router(config-if): ip mtu 1492
Router(config-if): ip nat outside
Router(config-if): encapsulation ppp
Router(config-if): dialer pool 1
Router(config-if): dialer-group 1
Router(config-if): no cdp enable
Router(config-if): ppp authentication pap callin
Router(config-if): ppp pap sent-username asxxxxxxxx@3p.sapo.pt password 0 xxxxxxxx
Router(config-if): ppp ipcp dns request
Nota:
- O IP de Dialer 1 é recebido dinamicamente por IPCP, daí o comando "ip address negotiated";
- O MTU é 1492 pois trata-se de uma ligação PPPoE, daí o comando "ip mtu 1492";
- É este interface que faz o NAT para fora, daí o comando "ip nat outside";
- O encapsulamento é "PPP", daí o comando "encapsulation ppp";
- A autenticação na operadora é neste caso "PAP", daí os comandos "ppp pap"
- O "username" e "password" são facultados pela operadora.
8) Configuração de rota estática:
Router(config): ip route 0.0.0.0 0.0.0.0 Dialer1
9) Configuração de NAT (tipo PAT):
Router(config): access-list 1 permit 192.168.1.0 0.0.0.255
Router(config): route-map internet-nat permit 10
Router(config-route-map): match ip address 1
Router(config-route-map): match interface Dialer1
Router(config): ip nat inside source route-map internet-nat interface Dialer1 overload
10) Configuração de NTP:
Router(config): ntp master
Router(config): ntp server 195.220.94.163
Nota: O servidor de NTP pode ser outro como por exemplo o "pool.ntp.org" (195.22.17.7)
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 !
segunda-feira, 14 de janeiro de 2013
Configuração RIP em GNS3
RIP - Lab com múltiplas tarefas:
- Configuração de Frame-Relay nos Routers:
R1(config): interface Serial0/0
R1(config-if): no shutdown
R1(config-if): no ip address
R1(config-if): encapsulation frame-relay
R1(config-if): no frame-relay inverse-arp
R1(config): interface Serial0/0.12 point-to-point
R1(config-if): ip address 172.12.123.1 255.255.255.0
R1(config-if): frame-relay interface-dlci 102
R1(config): interface Serial0/0.13 point-to-point
R1(config-if): ip address 172.12.13.1 255.255.255.0
R1(config-if): frame-relay interface-dlci 103
R2(config): interface Serial0/0
R2(config-if): no shutdown
R2(config-if): no ip address
R2(config-if): encapsulation frame-relay
R2(config-if): no frame-relay inverse-arp
R2(config): interface Serial0/0.21 point-to-point
R2(config-if): ip address 172.12.123.2 255.255.255.0
R2(config-if): frame-relay interface-dlci 201
R3(config): interface Serial0/0
R3(config-if): no shutdown
R3(config-if): no ip address
R3(config-if): encapsulation frame-relay
R3(config-if): no frame-relay inverse-arp
R3(config): interface Serial0/0.31 point-to-point
R3(config-if): ip address 172.12.13.2 255.255.255.0
R3(config-if): frame-relay interface-dlci 301
- Configuração do Frame-Relay Switch:
- Configuração básica de RIP:
R1(config): router rip
R1(config-router): version 2
R1(config-router): no auto-summary
R1(config-router): network 172.12.0.0
R1(config-router): network 1.0.0.0
R2(config): router rip
R2(config-router): version 2
R2(config-router): no auto-summary
R2(config-router): network 172.12.0.0
R2(config-router): network 2.0.0.0
R3(config): router rip
R3(config-router): version 2
R3(config-router): no auto-summary
R3(config-router): network 172.12.0.0
R3(config-router): network 3.0.0.0
- Configuração de timers:
R1(config): router rip
R1(config-router): timers basic 30 180 180 240
R2(config): router rip
R2(config-router): timers basic 30 180 180 240
R3(config): router rip
R3(config-router): timers basic 30 180 180 240
- Configuração de "triggered updates":
R1(config): interface serial 0/0.12
R1(config-if): ip rip triggered
R1(config): interface serial 0/0.13
R1(config-if): ip rip triggered
R2(config): interface serial 0/0.201
R2(config-if): ip rip triggered
R3(config): interface serial 0/0.301
R3(config-if): ip rip triggered
- Configuração de neighbours (unicast):
Nota: O comando "passive" impede o envio de broadcasts/multicasts.
R1(config): router rip
R1(config-router): neighbor 172.12.123.2
R1(config-router): neighbor 172.12.13.2
R1(config-router): passive interface serial 0/0.12
R1(config-router): passive interface serial 0/0.13
R1(config-router): passive interface loopback 1
R2(config): router rip
R2(config-router): neighbor 172.12.123.1
R2(config-router): passive interface serial 0/0.201
R2(config-router): passive interface loopback 2
R3(config): router rip
R3(config-router): neighbor 172.12.13.1
R3(config-router): passive interface serial 0/0.301
R3(config-router): passive interface loopback 3
- Criar Default Route que seja anunciada pelo RIP no R1:
R1(config): ip route 0.0.0.0 0.0.0.0 195.23.10.2
R1(config): router rip
R1(config-router): default-information originate
- Configurar sumarização no R3:
R3(config): interface serial 0/0.301
R3(config-if): ip summary-address rip 10.30.0.0 255.255.252.0
- Criar link de backup entre R0 e R2 por forma a evitar o Load-Balancing entre os 2 links:
R0(config): ip access-list standard RIP_BACKUP_OFFSET
R0(config-std-nacl): permit any
R0(config): router rip
R0(config-router): offset-list RIP_BACKUP_OFFSET in 2 Serial0/1
R0(config-router): offset-list RIP_BACKUP_OFFSET out 2 Serial0/1
DESCARREGAR AS CONFIGS AQUI
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
sábado, 12 de janeiro de 2013
Configuração de ASA em Active/Standby Failover
Configuração de ASA em Active/Standby Failover:
-- Configuração inicial:
ASA1(config)# interface Ethernet0/1
ASA1(config-if)# nameif outside
ASA1(config-if)# security-level 0
ASA1(config-if)# ip address 1.1.1.1 255.255.255.0 standby 1.1.1.2
ASA1(config-if)# no shut
ASA1(config)# interface Ethernet0/0
ASA1(config-if)# nameif inside
ASA1(config-if)# security-level 100
ASA1(config-if)# ip address 10.0.0.1 255.255.255.0 standby 10.0.0.2
ASA1(config-if)# no shut
ASA2(config)# interface Ethernet0/1
ASA2(config-if)# nameif outside
ASA2(config-if)# security-level 0
ASA2(config-if)# ip address 1.1.1.2 255.255.255.0
ASA2(config-if)# no shut
ASA2(config)# interface Ethernet0/0
ASA2(config-if)# nameif inside
ASA2(config-if)# security-level 100
ASA2(config-if)# ip address 10.0.0.2 255.255.255.0
ASA2(config-if)# no shut
-- Configuração do "Failover":
ASA1(config)# failover
ASA1(config)# failover lan unit primary
ASA1(config)# failover lan interface FOCONTROL e0/2
ASA1(config)# failover interface ip FOCONTROL 192.168.21.1 255.255.255.252 standby 192.168.21.2
ASA1(config)# failover link FOSTATE e0/3
ASA1(config)# failover interface ip FOSTATE 192.168.21.5 255.255.255.252 standby 192.168.21.6
ASA1(config)# failover key cisco
ASA1(config)# failover polltime msec 200 holdtime msec 800
ASA1(config)# copy running-config disk0:/.private/startup-config
ASA2(config)# failover
ASA2(config)# failover lan unit secondary
ASA2(config)# failover lan interface FOCONTROL e0/2
ASA2(config)# failover interface ip FOCONTROL 192.168.21.1 255.255.255.252 standby 192.168.21.2
ASA2(config)# failover key cisco
ASA2(config)# failover polltime msec 200 holdtime msec 800
ASA2(config)# copy running-config disk0:/.private/startup-config
-- Testar desligando o principal:
Aparece no ASA2 "Switching To Active"
-- Executar os seguintes comandos e verificar o status dos ASAs:
show failover
show failover interface
DESCARREGAR AS CONFIGS AQUI
-- Configuração inicial:
ASA1(config)# interface Ethernet0/1
ASA1(config-if)# nameif outside
ASA1(config-if)# security-level 0
ASA1(config-if)# ip address 1.1.1.1 255.255.255.0 standby 1.1.1.2
ASA1(config-if)# no shut
ASA1(config)# interface Ethernet0/0
ASA1(config-if)# nameif inside
ASA1(config-if)# security-level 100
ASA1(config-if)# ip address 10.0.0.1 255.255.255.0 standby 10.0.0.2
ASA1(config-if)# no shut
ASA2(config)# interface Ethernet0/1
ASA2(config-if)# nameif outside
ASA2(config-if)# security-level 0
ASA2(config-if)# ip address 1.1.1.2 255.255.255.0
ASA2(config-if)# no shut
ASA2(config)# interface Ethernet0/0
ASA2(config-if)# nameif inside
ASA2(config-if)# security-level 100
ASA2(config-if)# ip address 10.0.0.2 255.255.255.0
ASA2(config-if)# no shut
-- Configuração do "Failover":
ASA1(config)# failover
ASA1(config)# failover lan unit primary
ASA1(config)# failover lan interface FOCONTROL e0/2
ASA1(config)# failover interface ip FOCONTROL 192.168.21.1 255.255.255.252 standby 192.168.21.2
ASA1(config)# failover link FOSTATE e0/3
ASA1(config)# failover interface ip FOSTATE 192.168.21.5 255.255.255.252 standby 192.168.21.6
ASA1(config)# failover key cisco
ASA1(config)# failover polltime msec 200 holdtime msec 800
ASA1(config)# copy running-config disk0:/.private/startup-config
ASA2(config)# failover
ASA2(config)# failover lan unit secondary
ASA2(config)# failover lan interface FOCONTROL e0/2
ASA2(config)# failover interface ip FOCONTROL 192.168.21.1 255.255.255.252 standby 192.168.21.2
ASA2(config)# failover key cisco
ASA2(config)# failover polltime msec 200 holdtime msec 800
ASA2(config)# copy running-config disk0:/.private/startup-config
-- Testar desligando o principal:
Aparece no ASA2 "Switching To Active"
-- Executar os seguintes comandos e verificar o status dos ASAs:
show failover
show failover interface
DESCARREGAR AS CONFIGS AQUI
Configuração inicial de ASA em GNS3
Configuração Básica de ASA no GNS3:
Depois de ter o ASA a correr fazer:
1) Configurar o "inside" NIC:
asa(config): interface ethernet 0/0
asa(config-if): no shut
asa(config-if): ip address 192.168.1.199 255.255.255.0
asa(config-if): nameif inside
asa(config-if): security-level 100
Nota: O loopback está com 192.168.1.200 / 24
2) Activar a função de web server:
asa(config): http server enable
3) Permitir acesso do "host" fisico (loopback):
asa(config): http 192.168.1.200 255.255.255.255 inside
4) Criar user com permissões para a aceder ao GUI do ASA:
asa(config): username cisco password cisco privilege 15
5) Importar o ficheiro bin do ASA:
asa: copy tftp://192.168.1.200/asdm-645.bin flash:
6) Enquanto importa verificar onde o ASA vai gravar o bin !!!
Se for em flash: fazer:
asa(config): asdm image flash:/asdm-645.bin
Se for em disk0: fazer:
asa(config): asdm image disk0:/asdm-645.bin
7) Gravar a startup-config:
cisco-asa(config): boot config disk0:/.private/startup-config
cisco-asa(config): copy running-config disk0:/.private/running-config
cisco-asa(config): copy disk0:/.private/running-config disk0:/.private/startup-config
8) Fazer download do java a 32 bits !!! Se necessário desinstalar o java do IE e instalar apenas o de 32 bits (confirmar no control panel):
9) Abrir o IE com o seguinte URL:
https://192.168.1.199/admin/public/asdm.jnlp
10) Executar o ficheiro "asdm.jnlp" e seguir as instruções do browser
No ASDM ir a:
a) Certificate Management -> Identity Certificates -> Clicar em Add (ver imagem abaixo):
b) Selecionar "Add a new identity certifcate" -> Selecionar "New" e escolher <Default-RSA-Key> e <CN=nome do ASA>
c) Clicar em "Generate self-signed certifcate"
DESCARREGAR AS CONFIGS AQUI
Depois de ter o ASA a correr fazer:
1) Configurar o "inside" NIC:
asa(config): interface ethernet 0/0
asa(config-if): no shut
asa(config-if): ip address 192.168.1.199 255.255.255.0
asa(config-if): nameif inside
asa(config-if): security-level 100
Nota: O loopback está com 192.168.1.200 / 24
2) Activar a função de web server:
asa(config): http server enable
3) Permitir acesso do "host" fisico (loopback):
asa(config): http 192.168.1.200 255.255.255.255 inside
4) Criar user com permissões para a aceder ao GUI do ASA:
asa(config): username cisco password cisco privilege 15
5) Importar o ficheiro bin do ASA:
asa: copy tftp://192.168.1.200/asdm-645.bin flash:
6) Enquanto importa verificar onde o ASA vai gravar o bin !!!
Se for em flash: fazer:
asa(config): asdm image flash:/asdm-645.bin
Se for em disk0: fazer:
asa(config): asdm image disk0:/asdm-645.bin
7) Gravar a startup-config:
cisco-asa(config): boot config disk0:/.private/startup-config
cisco-asa(config): copy running-config disk0:/.private/running-config
cisco-asa(config): copy disk0:/.private/running-config disk0:/.private/startup-config
8) Fazer download do java a 32 bits !!! Se necessário desinstalar o java do IE e instalar apenas o de 32 bits (confirmar no control panel):
9) Abrir o IE com o seguinte URL:
https://192.168.1.199/admin/public/asdm.jnlp
10) Executar o ficheiro "asdm.jnlp" e seguir as instruções do browser
11) Garantir que o certificado "self-signed" emitido pelo ASA não se renova em cada sessão, obrigando o browser a anunciar erro de certificado:
a) Certificate Management -> Identity Certificates -> Clicar em Add (ver imagem abaixo):
b) Selecionar "Add a new identity certifcate" -> Selecionar "New" e escolher <Default-RSA-Key> e <CN=nome do ASA>
c) Clicar em "Generate self-signed certifcate"
DESCARREGAR AS CONFIGS AQUI
Configuração VPN Site-To-Site (Pre-Shared Keys)
Configuração de VPN Site-To-Site (Pre-Shared Keys):
-- Configuração dos Routers que estabelecem a VPN:
No Router A:
Router_A:(config): crypto isakmp enable
Router_A:(config): crypto isakmp policy 1
Router_A:(config-isakmp): authentication pre-share
Router_A:(config-isakmp): hash sha
Router_A:(config-isakmp): encryption aes 128
Router_A:(config-isakmp): group 2
Router_A:(config-isakmp): lifetime 86400
Router_A:(config-isakmp): exit
Router_A:(config): crypto isakmp key cisco address 172.16.1.2
Router_A:(config): exit
Router_A:(config): crypto ipsec transform set MYSET esp-aes esp-sha
Router_A:(config-crypto-trans): exit
Router_A:(config): access-list 101 permit ip 192.168.1.0 0.0.0.255 10.0.1.0 0.0.0.255
Router_A:(config): crypto map ROUTER_A_TO_ROUTER_B 10 ipsec-isakmp
Router_A:(config-crypto-map): set peer 172.16.1.2
Router_A:(config-crypto-map): match address 101
Router_A:(config-crypto-map): set transform-set MYSET
Router_A:(config-crypto-map): exit
Router_A:(config): interface s0/0
Router_A:(config-if): crypto map ROUTER_A_TO_ROUTER_B
Router_A: wr
No Router B:
Router_B:(config): crypto isakmp enable
Router_B:(config): crypto isakmp policy 1
Router_B:(config-isakmp): authentication pre-share
Router_B:(config-isakmp): hash sha
Router_B:(config-isakmp): encryption aes 128
Router_B:(config-isakmp): group 2
Router_B:(config-isakmp): lifetime 86400
Router_B:(config-isakmp): exit
Router_B:(config): crypto isakmp key cisco address 172.16.1.1
Router_B:(config): exit
Router_B:(config): crypto ipsec transform set MYSET esp-aes esp-sha
Router_B:(config-crypto-trans): exit
Router_B:(config): access-list 101 permit ip 10.0.1.0 0.0.0.255 192.168.1.0 0.0.0.255
Router_B:(config): crypto map ROUTER_B_TO_ROUTER_A 10 ipsec-isakmp
Router_B:(config-crypto-map): set peer 172.16.1.1
Router_B:(config-crypto-map): match address 101
Router_B:(config-crypto-map): set transform-set MYSET
Router_B:(config-crypto-map): exit
Router_B:(config): interface s0/0
Router_B:(config-if): crypto map ROUTER_B_TO_ROUTER_A
Router_B: wr
-- Fazer um ping do Router A ao servidor da rede local B;
-- Para testar o status da VPN:
show crypto session
show crypto isakmp sa
show crypto ipsec sa
DESCARREGAR AS CONFIGS AQUI
-- Configuração dos Routers que estabelecem a VPN:
No Router A:
Router_A:(config): crypto isakmp enable
Router_A:(config): crypto isakmp policy 1
Router_A:(config-isakmp): authentication pre-share
Router_A:(config-isakmp): hash sha
Router_A:(config-isakmp): encryption aes 128
Router_A:(config-isakmp): group 2
Router_A:(config-isakmp): lifetime 86400
Router_A:(config-isakmp): exit
Router_A:(config): crypto isakmp key cisco address 172.16.1.2
Router_A:(config): exit
Router_A:(config): crypto ipsec transform set MYSET esp-aes esp-sha
Router_A:(config-crypto-trans): exit
Router_A:(config): access-list 101 permit ip 192.168.1.0 0.0.0.255 10.0.1.0 0.0.0.255
Router_A:(config): crypto map ROUTER_A_TO_ROUTER_B 10 ipsec-isakmp
Router_A:(config-crypto-map): set peer 172.16.1.2
Router_A:(config-crypto-map): match address 101
Router_A:(config-crypto-map): set transform-set MYSET
Router_A:(config-crypto-map): exit
Router_A:(config): interface s0/0
Router_A:(config-if): crypto map ROUTER_A_TO_ROUTER_B
Router_A: wr
No Router B:
Router_B:(config): crypto isakmp enable
Router_B:(config): crypto isakmp policy 1
Router_B:(config-isakmp): authentication pre-share
Router_B:(config-isakmp): hash sha
Router_B:(config-isakmp): encryption aes 128
Router_B:(config-isakmp): group 2
Router_B:(config-isakmp): lifetime 86400
Router_B:(config-isakmp): exit
Router_B:(config): crypto isakmp key cisco address 172.16.1.1
Router_B:(config): exit
Router_B:(config): crypto ipsec transform set MYSET esp-aes esp-sha
Router_B:(config-crypto-trans): exit
Router_B:(config): access-list 101 permit ip 10.0.1.0 0.0.0.255 192.168.1.0 0.0.0.255
Router_B:(config): crypto map ROUTER_B_TO_ROUTER_A 10 ipsec-isakmp
Router_B:(config-crypto-map): set peer 172.16.1.1
Router_B:(config-crypto-map): match address 101
Router_B:(config-crypto-map): set transform-set MYSET
Router_B:(config-crypto-map): exit
Router_B:(config): interface s0/0
Router_B:(config-if): crypto map ROUTER_B_TO_ROUTER_A
Router_B: wr
-- Fazer um ping do Router A ao servidor da rede local B;
-- Para testar o status da VPN:
show crypto session
show crypto isakmp sa
show crypto ipsec sa
DESCARREGAR AS CONFIGS AQUI
Subscrever:
Mensagens (Atom)