Reuniendo la familia para navidad

Fecha: 1 al 18 de diciembre del 2017

 

Escenario

 

Este escenario de fin de año se trata de una reunión de varias generaciones IPSec de equipos Cisco: un concentrador

Cisco VPN 3000, un PIX, un ASA y un router IOS con licencia Security. Ya que estamos en navidad…los juntamos :-)

 

Todos conectados (en layer 2) por un switch Catalyst e interconectados (en layer 3) por un router Cisco 1941.

La conexión lógica definitiva se compone de tres túneles Ipsec hacia el grandfather VPN 3000.

 

Gracias a Bruno Pomponio y a Fer Siscardi por prestarme unos días el VPN 3000, a Adrián Trombetta por el ASA 5510

y a mi fiel colaborador invisible Daniel Mendoza por el PIX 501 y el Cisco 1841.

 

 

Diagrama lógico

 

Diagrama físico

 

1.- Verificación en red terminada en PIX (192.168.1.0/24):

 

1.1.- Verificación inicial:

 

C:\>ipconfig

 

Adaptador de Ethernet LAN:

 

   Sufijo DNS específico para la conexión. . :

   Dirección IPv4. . . . . . . . . . . . . . . . . . . . . : 192.168.1.100

   Máscara de subred . . . . . . . . . . . . . . . . : 255.255.255.0

   Puerta de enlace predeterminada . . . . .: 192.168.1.1

 

C:\>

 

1.2.- Se genera tráfico interesante:

 

Se llama así al tráfico que nos “interesa” enviar por el tunel (encriptado y firmado), este tráfico debe coincidir

mediante algún permit en la crypto-ACL y exeptuado de NAT/PAT en la ACL correspondiente mediante un deny.

 

C:\>ping 192.168.0.100

 

Haciendo ping a 192.168.0.100 con 32 bytes de datos:

Respuesta desde 192.168.0.100: bytes=32 tiempo=3ms TTL=127

Respuesta desde 192.168.0.100: bytes=32 tiempo=3ms TTL=127

Respuesta desde 192.168.0.100: bytes=32 tiempo=3ms TTL=127

Respuesta desde 192.168.0.100: bytes=32 tiempo=3ms TTL=127

---omitido---

 

1.3.- Verificación en el PIX de la fase I IPSec:

 

PIX-501# sh crypto isakmp sa

Total     : 1                                               

Embryonic : 0                                         

        dst                   src                state          pending     created

       200.0.0.1        190.0.0.1    QM_IDLE         0           1 

PIX-501#                                                   |

                                                                  (esto en PIX e IOS significa tunel establecido)

 

1.4.- Verificación en el PIX de la fase II IPSec:

 

PIX-501# sh crypto ipsec sa

 

interface: outside

    Crypto map tag: vpn_map, local addr. 190.0.0.1

 

   local  ident (addr/mask/prot/port): (192.168.1.0/255.255.255.0/0/0)

   remote ident (addr/mask/prot/port): (192.168.0.0/255.255.255.0/0/0)

   current_peer: 200.0.0.1:500

     PERMIT, flags={origin_is_acl,}

    #pkts encaps: 97, #pkts encrypt: 97, #pkts digest 97

    #pkts decaps: 100, #pkts decrypt: 100, #pkts verify 100

    #pkts compressed: 0, #pkts decompressed: 0

    #pkts not compressed: 0, #pkts compr. failed: 0, #pkts decompress failed: 0

    #send errors 3, #recv errors 0

 

     local crypto endpt.: 190.0.0.1, remote crypto endpt.: 200.0.0.1

     path mtu 1500, ipsec overhead 72, media mtu 1500

     current outbound spi: 5cd11ca2

 

     inbound esp sas:

      spi: 0xe36cb0a1(3815551137)

        transform: esp-aes-256 esp-sha-hmac ,

        in use settings ={Tunnel, }

        slot: 0, conn id: 1, crypto map: vpn_map

        sa timing: remaining key lifetime (k/sec): (4607976/28647)

        IV size: 16 bytes

        replay detection support: Y

---omitido---

 

     outbound esp sas:

      spi: 0x5cd11ca2(1557208226)

        transform: esp-aes-256 esp-sha-hmac ,

        in use settings ={Tunnel, }

        slot: 0, conn id: 2, crypto map: vpn_map

        sa timing: remaining key lifetime (k/sec): (4607989/28647)

        IV size: 16 bytes

        replay detection support: Y

---omitido---

 

PIX-501#

 

 

2.- Verificación en red terminada en ASA (192.168.2.0/24):

 

2.1.- Verificación inicial:

 

C:\>ipconfig

 

Configuración IP de Windows

 

Adaptador de Ethernet LAN:

 

   Sufijo DNS específico para la conexión. . :

   Dirección IPv4. . . . . . . . . . . . . . . . . . . . . : 192.168.2.100

   Máscara de subred . . . . . . . . . . . . . . . . .: 255.255.255.0

   Puerta de enlace predeterminada . . . . . : 192.168.2.1

 

C:\>

 

2.2.- Se genera tráfico interesante:

 

C:\>ping 192.168.0.1 -t

 

Haciendo ping a 192.168.0.1 con 32 bytes de datos:

Respuesta desde 192.168.0.1: bytes=32 tiempo=2ms TTL=128

Respuesta desde 192.168.0.1: bytes=32 tiempo=2ms TTL=128

Respuesta desde 192.168.0.1: bytes=32 tiempo=1ms TTL=128

--- omitido ---

 

2.3.- Verificación en el ASA de la fase I de IPSec:

 

ASA-5510# sh crypto isakmp sa

 

IKEv1 SAs:

 

   Active SA: 1

    Rekey SA: 0 (A tunnel will report 1 Active and 1 Rekey SA during rekey)

Total IKE SA: 1

 

1   IKE Peer: 200.0.0.1

    Type    : L2L             Role    : initiator

    Rekey   : no              State   : MM_ACTIVE  (esto en ASA significa tunel establecido)

 

There are no IKEv2 SAs

ASA-5510#

 

2.4.- Verificación en el ASA de la fase II de IPSec:

 

ASA-5510# sh crypto ipsec sa

interface: outside

    Crypto map tag: STATIC-MAP, seq num: 10, local addr: 200.69.0.1

 

      access-list ACL-VPN extended permit ip 192.168.2.0 255.255.255.0 192.168.0.0 255.255.255.0

      local ident (addr/mask/prot/port): (192.168.2.0/255.255.255.0/0/0)

      remote ident (addr/mask/prot/port): (192.168.0.0/255.255.255.0/0/0)

      current_peer: 200.0.0.1

 

      #pkts encaps: 8, #pkts encrypt: 8, #pkts digest: 8

      #pkts decaps: 8, #pkts decrypt: 8, #pkts verify: 8

      #pkts compressed: 0, #pkts decompressed: 0

      #pkts not compressed: 8, #pkts comp failed: 0, #pkts decomp failed: 0

      #pre-frag successes: 0, #pre-frag failures: 0, #fragments created: 0

      #PMTUs sent: 0, #PMTUs rcvd: 0, #decapsulated frgs needing reassembly: 0

      #send errors: 0, #recv errors: 0

 

      local crypto endpt.: 200.69.0.1/0, remote crypto endpt.: 200.0.0.1/0

      path mtu 1500, ipsec overhead 74, media mtu 1500

      current outbound spi: 4C11B4E6

      current inbound spi : 92CB2439

 

    inbound esp sas:

      spi: 0x92CB2439 (2462786617)

         transform: esp-aes-256 esp-sha-hmac no compression

         in use settings ={L2L, Tunnel, }

         slot: 0, conn_id: 40960, crypto-map: STATIC-MAP

         sa timing: remaining key lifetime (kB/sec): (4373999/28718)

         IV size: 16 bytes

         replay detection support: Y

         Anti replay bitmap:

          0x00000000 0x000001FF

    outbound esp sas:

      spi: 0x4C11B4E6 (1276228838)

         transform: esp-aes-256 esp-sha-hmac no compression

         in use settings ={L2L, Tunnel, }

         slot: 0, conn_id: 40960, crypto-map: STATIC-MAP

         sa timing: remaining key lifetime (kB/sec): (4373999/28718)

         IV size: 16 bytes

         replay detection support: Y

         Anti replay bitmap:

          0x00000000 0x00000001

 

ASA-5510#

 

3.- Verificación en red terminada en un router IOS (192.168.3.0/24):

 

3.1.- Verificación inicial:

 

C:\>ipconfig

 

Adaptador de Ethernet LAN:

 

   Sufijo DNS específico para la conexión. . :

   Dirección IPv4. . . . . . . . . . . . . . . . . . . . . : 192.168.3.100

   Máscara de subred . . . . . . . . . . . . . . . . .: 255.255.255.0

   Puerta de enlace predeterminada . . . . . : 192.168.3.1

 

3.2.- Se genera tráfico interesante:

 

C:\>ping 192.168.0.1 -t

 

Haciendo ping a 192.168.0.1 con 32 bytes de datos:

Respuesta desde 192.168.0.1: bytes=32 tiempo=3ms TTL=127

Respuesta desde 192.168.0.1: bytes=32 tiempo=3ms TTL=127

Respuesta desde 192.168.0.1: bytes=32 tiempo=3ms TTL=127

Respuesta desde 192.168.0.1: bytes=32 tiempo=3ms TTL=127

---omitido---

 

3.3.- Verificación en el router de la fase I de IPSec:

 

Cisco-2801#sh crypto isakmp sa

Dst                  src                     state          conn-id slot status

200.0.0.1       200.45.0.1      QM_IDLE         1       0    ACTIVE

                                                                |

Cisco-2801#                                         (esto en PIX e IOS significa tunel establecido)

 

3.3.- Verificación en el router de la fase I de IPSec:

 

Cisco-2801#sh crypto ipsec sa

 

interface: FastEthernet0/1

    Crypto map tag: VPN-MAP, local addr 200.45.0.1

 

   protected vrf: (none)

   local  ident (addr/mask/prot/port): (192.168.3.0/255.255.255.0/0/0)

   remote ident (addr/mask/prot/port): (192.168.0.0/255.255.255.0/0/0)

   current_peer 200.0.0.1 port 500

     PERMIT, flags={origin_is_acl,}

    #pkts encaps: 30, #pkts encrypt: 30, #pkts digest: 30

    #pkts decaps: 30, #pkts decrypt: 30, #pkts verify: 30

    #pkts compressed: 0, #pkts decompressed: 0

    #pkts not compressed: 0, #pkts compr. failed: 0

    #pkts not decompressed: 0, #pkts decompress failed: 0

    #send errors 5, #recv errors 0

 

     local crypto endpt.: 200.45.0.1, remote crypto endpt.: 200.0.0.1

     path mtu 1500, ip mtu 1500, ip mtu idb FastEthernet0/1

     current outbound spi: 0x768FDE2F(1989140015)

 

     inbound esp sas:

      spi: 0xCDFF95D7(3456079319)

        transform: esp-3des esp-md5-hmac ,

        in use settings ={Tunnel, }

        conn id: 3001, flow_id: FPGA:1, crypto map: VPN-MAP

        sa timing: remaining key lifetime (k/sec): (4567507/28759)

        IV size: 8 bytes

        replay detection support: Y

        Status: ACTIVE

 

---omitido---

 

     outbound esp sas:

      spi: 0x768FDE2F(1989140015)

        transform: esp-3des esp-md5-hmac ,

        in use settings ={Tunnel, }

        conn id: 3002, flow_id: FPGA:2, crypto map: VPN-MAP

        sa timing: remaining key lifetime (k/sec): (4567507/28757)

        IV size: 8 bytes

        replay detection support: Y

        Status: ACTIVE

 

---omitido---

 

Cisco-2801#

 

4.- Verificación en VPN 3000:

 

 

 

 

5.- Configuración de los equipos:

 

5.1.- Cisco 2800:

 

Cisco-2801#sh runn (sólo lo mas relevante)

Building configuration...

 

Current configuration : 1369 bytes

!

version 12.4

!

hostname Cisco-2801

!

crypto isakmp policy 10 (fase I IPSec)

 encr 3des

 hash md5

 authentication pre-share

 group 2

crypto isakmp key Pr3sh4redKey address 200.0.0.1 (fase I IPSec)

!

!

crypto ipsec transform-set TRANSFORMA esp-3des esp-md5-hmac (fase II IPSec)

!

crypto map VPN-MAP 10 ipsec-isakmp (fase II IPSec)

 set peer 200.0.0.1

 set security-association lifetime seconds 86400

 set transform-set TRANSFORMA

 match address 101

!

!

!

interface FastEthernet0/0

 ip address 192.168.3.1 255.255.255.0

 ip nat inside

!

interface FastEthernet0/1

 ip address 200.45.0.1 255.255.255.252

 ip nat outside

crypto map VPN-MAP

!

ip route 0.0.0.0 0.0.0.0 200.45.0.2

!

ip nat inside source list 100 interface FastEthernet0/1 overload

!

access-list 100 deny   ip 192.168.3.0 0.0.0.255 192.168.0.0 0.0.0.255

access-list 100 permit ip 192.168.3.0 0.0.0.255 any

access-list 101 permit ip 192.168.3.0 0.0.0.255 192.168.0.0 0.0.0.255 (fase II IPSec)

!

!

line con 0

line aux 0

line vty 0 4

!

end

 

Cisco-2801#

 

5.2.- Cisco 1841 (concentrador):

 

Cisco-1841#sh runn  (sólo lo mas relevante)

Building configuration...

 

Current configuration : 1654 bytes

!

version 15.3

!

hostname Cisco-1841

!

interface GigabitEthernet0/0.10

 description Link a VPN 3000

 encapsulation dot1Q 10

 ip address 200.0.0.2 255.255.255.248

!

interface GigabitEthernet0/0.11

 description Link a PIX

 encapsulation dot1Q 11

 ip address 190.0.0.2 255.255.255.252

!

interface GigabitEthernet0/0.12

 description Link a ASA

 encapsulation dot1Q 12

 ip address 200.69.0.2 255.255.255.252

!

interface GigabitEthernet0/0.13

 description Link a Cisco 2801

 encapsulation dot1Q 13

 ip address 200.45.0.2 255.255.255.252

!

line con 0

line aux 0

line vty 0 4

 password cisco

 login

!

end

 

Cisco-1841#

 

5.3.- Cisco 2950 :

 

Catalyst-2950#sh runn  (sólo lo mas relevante)

Building configuration...

 

Current configuration : 3161 bytes

!

version 12.1

!

hostname Catalyst-2950

!

spanning-tree mode pvst

!

interface FastEthernet0/1

!

interface FastEthernet0/2

!

interface FastEthernet0/3

!

interface FastEthernet0/4

!

interface FastEthernet0/5

!

interface FastEthernet0/6

!

interface FastEthernet0/7

!

interface FastEthernet0/8

!

interface FastEthernet0/9

!

interface FastEthernet0/10

 description Cisco VPN 3000

 switchport access vlan 10

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/11

 description Cisco PIX

 switchport access vlan 11

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/12

 description Cisco PIX 501

 switchport access vlan 12

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/13

 description Cisco 2801

 switchport access vlan 13

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/14

 description Cisco 1941

 switchport trunk allowed vlan 10-13

 switchport mode trunk

 spanning-tree portfast trunk

!

interface FastEthernet0/15

!

interface FastEthernet0/16

!

interface FastEthernet0/17

!

interface FastEthernet0/18

!

interface FastEthernet0/19

!

interface FastEthernet0/20

 description Equipo en la red 192.168.0.0

 switchport access vlan 10

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/21

 description Equipo en la red 192.168.1.0

 switchport access vlan 11

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/22

 description Equipo en la red 192.168.2.0

 switchport access vlan 20

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/23

 description Equipo en la red 192.168.3.0

 switchport access vlan 30

 switchport mode access

 spanning-tree portfast

!

interface FastEthernet0/24

!

interface Vlan1

 no ip address

 shutdown

!

line con 0

line vty 0 4

line vty 5 15

!

end

 

Catalyst-2950#

 

5.4.- PIX 501:

 

PIX-501# sh runn  (sólo lo mas relevante)

: Saved

:

PIX Version 6.3(5)

interface ethernet0 auto

interface ethernet1 100full

nameif ethernet0 outside security0

nameif ethernet1 inside security100

---omitido---

hostname PIX-501

---omitido---

access-list NAT0 permit ip 192.168.1.0 255.255.255.0 192.168.0.0 255.255.255.0

access-list 100 permit ip 192.168.1.0 255.255.255.0 192.168.0.0 255.255.255.0 (fase II IPSec)

access-list PAT deny ip 192.168.1.0 255.255.255.0 192.168.0.0 255.255.255.0

access-list PAT permit ip 192.168.1.0 255.255.255.0 any

access-list OUTSIDE permit udp any any eq isakmp

access-list OUTSIDE permit esp any any

---omitido---

ip address outside 190.0.0.1 255.255.255.252

ip address inside 192.168.1.1 255.255.255.0

---omitido---

global (outside) 1 interface

nat (inside) 0 access-list NAT0

nat (inside) 1 access-list PAT 0 0

---omitido---

route outside 0.0.0.0 0.0.0.0 190.0.0.2 1

---omitido---

sysopt connection permit-ipsec (aplica en fase II IPSec)

crypto ipsec transform-set ENCRIPTA esp-aes-256 esp-sha-hmac (fase II IPSec)

crypto map vpn_map 10 ipsec-isakmp

crypto map vpn_map 10 match address 100

crypto map vpn_map 10 set peer 200.0.0.1

crypto map vpn_map 10 set transform-set ENCRIPTA

crypto map vpn_map interface outside

isakmp enable outside (fase I IPSec)

isakmp key ******** address 200.0.0.1 netmask 255.255.255.255

isakmp policy 10 authentication pre-share

isakmp policy 10 encryption aes-256

isakmp policy 10 hash sha

isakmp policy 10 group 2

isakmp policy 10 lifetime 86400

---omitido---

Cryptochecksum:8e8a7cf56c3970a18a56c3d37548f93b

: end

PIX-501#

 

5.5.- ASA 5510:

 

ASA-5510# sh runn  (sólo lo mas relevante)

: Saved

:

: Hardware:   ASA5510, 1024 MB RAM, CPU Pentium 4 Celeron 1600 MHz

:

ASA Version 8.4(7)30

!

hostname ASA-5510

!

interface Ethernet0/0

 nameif outside

 security-level 0

 ip address 200.69.0.1 255.255.255.252

!

interface Ethernet0/1

 nameif inside

 security-level 100

 ip address 192.168.2.1 255.255.255.0

!

interface Ethernet0/2

!

interface Ethernet0/3

!

interface Management0/0

 management-only

!

boot system disk0:/asa847-30-k8.bin

!

object network obj-192.168.0.0 (tráfico remoto)

 subnet 192.168.0.0 255.255.255.0

object network obj-192.168.2.0 (tráfico local)

 subnet 192.168.2.0 255.255.255.0

!

access-list ACL-VPN extended permit ip 192.168.2.0 255.255.255.0 192.168.0.0 255.255.255.0

!

nat (inside,outside) source static obj-192.168.2.0 obj-192.168.2.0 destination static obj-192.168.0.0 obj-192.168.0.0

nat (inside,outside) source dynamic obj-192.168.2.0 interface

route outside 0.0.0.0 0.0.0.0 200.69.0.2 1

!

crypto ipsec ikev1 transform-set ENCRIPTA esp-aes-256 esp-sha-hmac (fase II IPSec)

crypto map STATIC-MAP 10 match address ACL-VPN (fase II IPSec)

crypto map STATIC-MAP 10 set peer 200.0.0.1

crypto map STATIC-MAP 10 set ikev1 transform-set ENCRIPTA

crypto map STATIC-MAP interface outside

crypto ikev1 enable outside (fase I IPSec)

crypto ikev1 policy 10

 authentication pre-share

 encryption 3des

 hash sha

 group 2

 lifetime 86400

---omitido---

tunnel-group 200.0.0.1 type ipsec-l2l (fase I IPSec)

tunnel-group 200.0.0.1 ipsec-attributes

 ikev1 pre-shared-key *****

!

---omitido---

Cryptochecksum:a56d59b4a418acf903b9eccb59eff996

: end

ASA-5510#

 

5.6.- VPN 3000:

 

 

 

 

(2017) Whaiting from packets at chrystmas

Rosario, Argentina