Comandos Ccna Security
Comandos Ccna Security
2
CONFIGURAR R1 COMO CLIENTE NTP.
R1(config)# ntp authenticate
R1(config)# ntp authentication-key 1 md5 ciscontppa55 R1(config)#
ntp trusted-key 1
R1(config)# ntp server 192.168.1.5 key 1
step 2. Create a user ID of **+admin with the highest possib!e privi!ege !eve! and a secret password of
ciscosshpa55.
R3(config)# username ssHadmin privilege 15 secret ciscosshpa55
step 3. Configure the incoming VTY !ines on R3. Use the !oca! user accounts for mandatory
!ogin and va!idation. Accept on!y **+ connections.
R3(config)# line vty 0 4
R3(config-!ine)# login local
R3(config-!ine)# transport input ssh
step 4. 0rase existing key pairs on R3. Any existing R*A key pairs shou!d be erased on the
router.
R3(config)#crypto key zeroize rsa
step 5. Generate the R*A encryption key pair for R3. R3(config)#
crypto key generate rsa
TO sECURE THE IOs IMAGE AND ENABLE CIsCO IOs IMAGE REsILIENCE
R1(config)#secure boot-image
CREAR ACLs
EJEMPLOs DE ACLs
permit udp any 192.168.1.& &.&.&.255 eq domain Permite a cua!quier host acceder a DNs
permit tcp any 192.168.1.& &.&.&.255 eq smtp Permite a cua!quier host acceder a sMTP
permit tcp any 192.168.1.& &.&.&.255 eq ftp Permite a cua!quier host acceder a FTP deny
tcp any host 192.168.1.3 eq 443 8iega a cua!quier host acceder a HTTPs
permit tcp any host 192.168.3.3 eq 22 Permite a cua!quier host acceder a ssH
permit icmp any any echo-rep!y Permite a cua!quier host echo replies
permit icmp any any unreachab!e Permite a cua!quier host dest. unreachable
deny icmp any any 8iega a cua!quier host acceder a ICMP
permit ip any any Permite a cua!quier host a cualquier lado
ACL PARA PERMITIR PROTOCOLOs PARA EsP (50) - AH(51)- IsAKMAP(UDP PORT 500)
Crear una ACL NOMBRADA EXTENDIDA !!amado ACL-13 ap!icada entrante en !a interfaz 7a&>&3
que niega e! servidor workgroup server sa!ga3 pero permite que e! resto de !os usuarios de LA8 fuera de acceso
usando !a pa!abra c!ave established
R1(config)# ip access-list extended ACL-1
R1(config-ext-nacl)# remark LAN ACL
R1(config-ext-nacl)# deny ip host 192.168.1.6 any
R1(config-ext-nacl)# permit tcp 192.168.1.0 0.0.0.255 any established
R1(config-ext-nacl)# deny ip any any
R1(config-ext-nacl)# exit
R1(config)# interface Fa0/0
R1(config-if)# ip access-$roup ACL-1 in
R1(config-if)# exit
CREAR UNA ACL NOMBRADA extended named !!amada ACL-23 ap!icada en dirección sa!iente en
!a interfaz DM@ 7a&>13 para permitir e! acceso a !os servidores 4eb e 0mai! especificados.
R1(config)# ip access-list extended ACL-1
R1(config-ext-nacl)# remark LAN ACL
R1(config-ext-nacl)# deny ip host 192.168.1.6 any R1(config-ext-nacl)# permit tcp 192.168.1.0 0.0.0.255 any established
R1(config-ext-nacl)# deny ip any any R1(config-ext-nacl)# exit R1(config)# interface Fa0/0
R1(config-if)# ip access-$roup ACL-1 in
R1(config-if)# exit
permittcpanyhost192.168.2.6eq
80lo$
ACL NUMERADA
R1#
R1(config)# ip access-list extended 150
R1(config-ext-nac!)# permit tcp host 192.168.1.100 any eq telnet
R1(config-ext-nac!)# permit tcp any any eq www
R1(config-ext-nac!)# permit tcp any any eq telnet
R1(config-ext-nac!)# permit tcp any any eq smtp
R1(config-ext-nac!)# permit tcp any any eq pop3
R1(config-ext-nac!)# permit tcp any any eq 21
R1(config-ext-nac!)# permit tcp any any eq 20
R1# show access-list 150
0xtended IP access !ist 15&
1& permit tcp any any eq www
2& permit tcp any any eq te!net
3& permit tcp any any eq smtp
4& permit tcp any any eq pop3
5& permit tcp any any eq 21 6&
permit tcp any any eq 2&
ACLs COMPLEJAs
Reflexive ACLs
R1(config)# ip access-list extended INTERNAL_ACL
R1(config-ext-nac!)# permit tcp any any eq 80 reflect WEB-ONLY-REFLEXIVE-ACL
R1(config-ext-nac!)# permit udp any any eq 53 reflect DNs-ONLY-REFLEXIVE-ACL timeout 10
R1(config-ext-nac!)# exit
R1(config)# ip access-list extended EXTERNAL_ACL
R1(config-ext-nac!)# evaluate WEB-ONLY-REFLEXIVE-ACL
R1(config-ext-nac!)# evaluate DNs-ONLY-REFLEXIVE-ACL
R1(config-ext-nac!)# deny ip any any
R1(config-ext-nac!)# exit
R1(config)# interface s0/0/0
R1(config-if)# ip access-group INTERNAL_ACL out
R1(config-if)# ip access-group EXTERNAL_ACL in
Dynamic ACLs
R3(config)# username student password cisco
R3(config)# access-list 101 permit tcp any host 10.2.2.2 eq telnet
R3(config)# access-list 101 dynamic TEsTLIsT timeout 15 permit ip 192.168.10.0 0.0.0.255
192.168.3.0 0.0.0.255
R3(config)# interface s0/0/1 R3(config-
if)# ip access-group 101 in R3(config-
if)# exit
R3(config)# line vty 0 4
R3(config-!ine)# login local
R3(config-!ine)# autocommand access-enable host timeout 15 (aqui no funciona tabulador y es un
comando oculto)
Time-based ACLs
R1(config)# time-range EMPLOYEE-TIME
R1(config-time-range)# periodic weekdays 12:00 to 13:00
R1(config-time-range)# periodic weekdays 17:00 to 19:00
R1(config-time-range)# exit
R1(config)# access-list 100 permit ip 192.168.1.0 0.0.0.255 any time-range EMPLOYEE-TIME
R1(config)# access-list 100 deny ip any any
R1(config)# interface FastEthernet 0/1
R1(config-if)# ip access-group 100 in
R1(config-if)# exit
MITIGATING ATTACKs WITH ACLs
A Do not a!!ow any outbound IP packets with a source address other than a va!id IP address of the
interna! network.
B Create an ACL that permits on!y those packets that contain source addresses from inside
the network and denies a!! others.
B Inbound on Fa0/1
A R1(config)# access-list 105 permit ip 192.168.1.0 0.0.0.255 any
Protect DNs, sMTP, and FTP
• D8*3 *MTP3 and 7TP are common services that often must be a!!owed through a firewa!!. B
Outbound on Fa0/0
R1(config)# access-list 180 permit udp any host 192.168.20.2 eq domain
R1(config)# access-list 180 permit tcp any host 192.168.20.2 eq smtp
R1(config)# access-list 180 permit tcp any host 192.168.20.2 eq ftp
R1(config)# access-list 180 permit tcp host 200.5.5.5 host 192.168.20.2 eq telnet R1(config)#
access-list 180 permit tcp host 200.5.5.5 host 192.168.20.2 eq 22 R1(config)# access-list 180
permit udp host 200.5.5.5 host 192.168.20.2 eq syslog R1(config)# access-list 180 permit udp
host 200.5.5.5 host 192.168.20.2 eq snmptrap
A *evera! outbound ICMP messages are required for proper network operation<
B Echo - A!!ows users to ping externa! hosts.
B Parameter problem - Informs the host of packet header prob!ems. B
Packet too big - Required for packet MTU discovery.
B source quench - Thrott!es down traffic when necessary. B
Inbound on Fa0/0
In this examp!e topo!ogy3 there are 3 servers3 each requiring outside to inside access for 3
protoco!s
4ithout object groups3 we have to configure a permit statement for each server3 for each
protoco!
R1(config)# ip access-list extended In
R1(config-ext-nac!)# permit tcp any host 10.10.10.1 eq smtp
R1(config-ext-nac!)# permit tcp any host 10.10.10.1 eq www
R1(config-ext-nac!)# permit tcp any host 10.10.10.1 eq https
R1(config-ext-nac!)# permit tcp any host 10.10.10.2 eq smtp
R1(config-ext-nac!)# permit tcp any host 10.10.10.2 eq www
R1(config-ext-nac!)# permit tcp any host 10.10.10.2 eq https
R1(config-ext-nac!)# permit tcp any host 10.10.10.3 eq smtp
R1(config-ext-nac!)# permit tcp any host 10.10.10.3 eq www
R1(config-ext-nac!)# permit tcp any host 10.10.10.3 eq https
7or the same topo!ogy3 using object group configuration3 first create the service object for the
services.
R1(config)# object-group service Web-svcs tcp
R1(config-service-group)# tcp smtp
R1(config-service-group)# tcp www
R1(config-service-group)# tcp https
This ACL is app!ied to the interna! interface in the inbound direction. The ACL processes traffic
initiating from the interna! network prior to !eaving the network.
8ext3 create an extended ACL in which *MTP and +TTP traffic is permitted from the externa! network
to the DM@ network on!y3 and a!! other traffic is denied.
This ACL is app!ied to the interface connecting to the externa! network in the inbound direction. R1(config)#
interface S0/0/0
8ext3 create inspection ru!es for TCP inspection and UDP inspection.
These inspection ru!es are app!ied to the interna! interface in the inbound direction.
1.- Configure a named IP ACL on R3 to block all traffic originating from the outside network.
Use the ip access-list extended command to create a named IP ACL.
R3(config)# ip access-list extended OUT-IN
R3(config-ext-nac!)# deny ip any any
R3(config-ext-nac!)# exit
7.- Verify that audit trail messages are being logged on the syslog server.
From PC-C, test connectivity to PC-A with ping, Telnet, and HTTP. Ping and HTTP should be successful.
Note that PC-A will reject the Telnet session.
From PC-A, test connectivity to PC-C with ping and Telnet. All should be blocked.
Review the syslog messages on server PC-A: click the Config tab and then click the SYSLOG
option.
R3# show ip inspect sessions displays the existing sessions that are currently being tracked and inspected by
CBAC
step 1. Crear las zOnas para el firewall COn el COmandO zone security.
step 2. Crear una ACL que define el tráfiCO internO. Use el COmandO access-list para Crear una extendida
ACL 101 para permitir tOdO el tráfiCO IP desde la red 192.168.3.0/24 haCia Cualquier destinO.
R3(COnfig)# access-list 101 permit ip 192.168.3.0 0.0.0.255 any
step 3. Definir el trafiCO que será sOmetidO a las reglas de firewall COn el COmandO class-map type inspect.
(ACá se usó una ACL)
Step 5. Crear par de zOnas interna versus externa (sOurCe and destinatiOn zOnes) usandO el COmandO zone-
pair security y menCiOnadO lOs nOmbres de las zOnas.
R3(COnfig)# zone-pair security IN-2-OUT-ZPAIR source IN-ZONE destination OUT-ZONE
Step 6. EspeCifiCar el policy map para manejar el tráfiCO entre el par de zOnas. IndiCar el pOliCy- map y la
aCCión asOCiada (inspect) al par de zOnas, usandO el COmandO service-policy type inspect y haCiendO
referenCia al policy map previamente CreadO, IN-2-OUT-PMAP.
R3(COnfig-seC-zOne-pair)# service-policy type inspect IN-2-OUT-PMAP
R3(COnfig-seC-zOne-pair)# exit
Step7. Asignar las interfaCes del rOuter interfaCes a las zOnas interna O externa usandO el COmandO
zone-member security.
R3(COnfig)# interface fa0/1
R3(COnfig-if)# zone-member security IN-ZONE
R3(COnfig-if)# exit
1º CREAR ZONAS
zone security NETWORK
zone security INTERNET
zone security DMZ
inspect
policy-map type inspect OUTSIDEtoNETWORK
class type inspect OUTtoNET
drop
policy-map type inspect NETWORKtoDMZ
class type inspect NETtoDMZ
inspect
policy-map type inspect DMZtoNETWORK
class type inspect DMZtoNET
inspect
policy-map type inspect OUTSlDEtoDMZ class
type inspect OUTtoDMZ
inspect
policy-map type inspect DMZtoOUTSlDE class
type inspect DMZtoOUT
inspect
LAYER 2 sECURITY
1.- CONFIGURE ROOT BRIDGE
Assign Central as the primary root bridge.
Centra!(config)# spanning-tree vlan 1 root primary
Peer Hostname R3 R1
)et*or+ to be
1(2.168.1.0)24 1(2.168.3.0)24
encrypted
2. se debe permitir tráfico para que el Router R4 pueda autentificarse a través de Radius en el servidor
WinRadius (PC2)
Class-map type inspeCt matCh-any CM_OUT_TO_IN matCh
prOtOCOl radius
3. El trafico desde el PC4 hacia los servidores WEB y FTP (PC3) debe ser permitido.
Class-map type inspeCt matCh-any CM_OUT_TO_DMZ
matCh prOtOCOl http
matCh prOtOCOl ftp
policy-map type inspect PM_OUT_TO_DMZ
class type inspect CM_OUT_TO_DMZ inspect
4. La red interna también debe poder llegar al servidor Web (PC3), FTP no será permitido para esta red.
class-map type inspect match-any CM_IN_TO_DMZ
match protocol http
5. El servidor ACs debe poder alcanzar a través de ping al router R4 (loopback) y a la red 10.X40.0/24 (no se
debe permitir generar una tabla de estado)
access-list 100 permit ip host 10.6.20.10 any
class-map type inspect match-all CM_ACS
match protocol icmp
match access-group 100
6. Los usuarios de la red Interna se les permite navegar en Internet (solo HTTP y DNs)
class-map type inspect match-any CM_IN_TO_OUT
match protocol http
match protocol dns
7. El FW debe tener los permisos para poder realizar Telnet y SSH hacia el Router R1 y R2 (Interfaces
loopbacks), además de permitir el envío de los Logs hacia el servidor syslog (PC1) – No es permitido
utilizar las políticas por defecto del Firewall.
access-list 102 permit tcp host 10.6.23.3 any eq telnet
access-list 102 permit tcp host 10.6.13.3 any eq telnet
access-list 102 permit tcp host 10.6.13.3 any eq 22
access-list 102 permit tcp host 10.6.23.3 any eq 22 access-
list 102 permit tcp host 10.6.13.3 any eq syslog access-list
102 permit tcp host 10.6.23.3 any eq syslog class-map type
inspect match-any CM_SELF_TO_IN match access-group
102
8. Es necesario permitir que el PC2 pueda administrar a través de CCP al dispositivo FW (Habilite lo
necesario para lograr este requerimiento)
access-list 103 permit tcp host 10.6.20.10 host 10.6.23.3 eq www
access-list 103 permit tcp host 10.6.20.10 host 10.6.23.3 eq 443
access-list 103 permit tcp host 10.6.20.10 host 10.6.13.3 eq 443
access-list 103 permit tcp host 10.6.20.10 host 10.6.13.3 eq www
class-map type inspect match-any CM_IN_TO_SELF
match access-group 103
9. El cliente PC4 debe tener los permisos suficientes para establecer una sesión VPN hacia el Router R1, para
este es necesario que el FW genere una tabla de estada para los protocolos ESP y AH.
access-list 104 permit ahp host 10.6.40.10 host 10.6.13.1
access-list 104 permit esp host 10.6.40.10 host 10.6.13.1
access-list 104 permit udp host 10.6.40.10 host 10.6.13.1 eq isakmp
c!ass-map type inspect match-any CMOVP8 match
access-group 1&4
10. Todas las sesiones EIGRP deben ser mantenidas entre el FW y Router R1, R2 y entre el FW y el router
R4.