Poniżej pokazuję jak zestawiać połączenie IPsec pomiędzy PaloAlto Networks a Cisco ASA. W mym przypadku oba urządzenia są w wersji wirtualnej ale konfiguracja ich odpowiada tak jak byśmy konfigurowali urządzenia fizyczne.
Założenia:
| Faza 1 | aes256 sha-1 pfs g2 86400s |
| Faza 2 | aes256 sha-1 pfs g2 28800s |
| Palo | Cisco ASA | |
| Sieci które będą podlegały szyfrowaniu | 10.20.10.0/24 | 172.16.1.0/24 |
| Palo | Cisco ASA | |
| Interfejs z adresem tzw. publicznym | 192.168.1.51/24 | 192.168.1.80/24 |
Konfiguracja Cisco ASA
Logujemy się do SSH lub ASDM’a. Poniżej będę prezentować konfigurację obu sposobów.
ASDM – przechodzimy do Configuration –> Site-to-Site VPN
włączamy IKE dla Interfejsu NET_LAB nasz interfejs publiczny oraz przechodzimy do konfiguracji Profilu połączenie klikając Add
CLI:
crypto ikev1 enable NET_LAB
w nowym oknie konfigurujemy parametry naszego połączenia IPSEC, w polach:
Peer IP Address wpisujemy adres Palo, Local Network oraz Remote Network wpisujemy ip pomiędzy którymi będzie szyfrowanie IPSEC
w polu Group Policy Name wybieramy Manage gdzie tworzymy profil dla naszego profilu.
Tworzymy nowe IKE Policy
wybieramy odpowiednią politykę IPSEC
Przechodzimy do Advanced –> Crypto Map Entry gdzie ustawiamy nasze parametry
CLI
//Tworzymy ACL'kę która będzie użyta do krypto mapy access-list NET_LAB_cryptomap extended permit ip 172.16.1.0 255.255.255.0 10.20.10.0 255.255.255.0 // Tworzymy profil dla fazy 1 crypto ikev1 policy 10 authentication pre-share encryption aes-256 hash sha group 2 lifetime 86400 //Tworzymy profil Group Policy group-policy IPSEC-PALO internal group-policy IPSEC-PALO attributes vpn-tunnel-protocol ikev1 //Configuracja Crypto mapy crypto map NET_LAB_map2 1 match address NET_LAB_cryptomap crypto map NET_LAB_map2 1 set pfs crypto map NET_LAB_map2 1 set peer 192.168.1.51 crypto map NET_LAB_map2 1 set ikev1 transform-set ESP-AES-256-SHA crypto map NET_LAB_map2 1 set nat-t-disable crypto map NET_LAB_map2 interface NET_LAB //Profil Tunelu tunnel-group 192.168.1.51 type ipsec-l2l tunnel-group 192.168.1.51 general-attributes default-group-policy IPSEC-PALO tunnel-group 192.168.1.51 ipsec-attributes ikev1 pre-shared-key Qwert6
Tworzymy Politykę NAT aby ruch nie był nigdy NATOWANY
CLI
object network Net_172.16.1.0 subnet 172.16.1.0 255.255.255.0 object network NET_10.20.10.0 subnet 10.20.10.0 255.255.255.0 nat (LAN,NET_LAB) source static Net_172.16.1.0 Net_172.16.1.0 destination static NET_10.20.10.0 NET_10.20.10.0
Konfiguracja PALO
przechodzimy do network –> network-profiles –> ike-crypto tworzymy profil dla naszego połączenia
CLI
set network ike crypto-profiles ike-crypto-profiles IKE-ASA hash sha1 set network ike crypto-profiles ike-crypto-profiles IKE-ASA dh-group group2 set network ike crypto-profiles ike-crypto-profiles IKE-ASA encryption aes-256-cbc set network ike crypto-profiles ike-crypto-profiles IKE-ASA lifetime hours 24
przechodzimy do network –> network-profiles –> ipsec-crypto tworzymy profil dla który użyjemy podczas konfiguracji fazy 2
CLI
set network ike crypto-profiles ipsec-crypto-profiles Ipsec-asa esp authentication sha1 set network ike crypto-profiles ipsec-crypto-profiles Ipsec-asa esp encryption aes-256-cbc set network ike crypto-profiles ipsec-crypto-profiles Ipsec-asa lifetime hours 8 set network ike crypto-profiles ipsec-crypto-profiles Ipsec-asa dh-group group2
w kolejnym kroku przechodzimy do network –> network-profiles –> ike-gateways jest to konfiguracja Fazy 1
w Advanced Options:
CLI
set network ike gateway VPN-ASA authentication pre-shared-key key Qwert6 set network ike gateway VPN-ASA protocol ikev1 dpd enable no set network ike gateway VPN-ASA protocol ikev1 ike-crypto-profile IKE-ASA set network ike gateway VPN-ASA protocol ikev1 exchange-mode main set network ike gateway VPN-ASA protocol ikev2 dpd enable yes set network ike gateway VPN-ASA protocol-common nat-traversal enable no set network ike gateway VPN-ASA protocol-common fragmentation enable no set network ike gateway VPN-ASA local-address interface ethernet1/1 set network ike gateway VPN-ASA peer-address ip 192.168.1.80
Tworzymy interfejs Tunnel.1 z przypisanie do Security Zone VPN
CLI
set network interface tunnel units tunnel.1 set zone VPN network layer3 tunnel.1
tworzymy konfigurację dla Fazy 2 przechodząc do network –> ipsec-tunnels w polu Tunnel Interface wybieramy nasz interfejs tunnel.1 w IKE Gataway nasz profil który wcześniej stworzyliśmy VPN-ASA oraz IPSec Crypo Profile Ipsec-asa
w proxy ID’s ustawiamy naszą konfigurację również
CLI
set network tunnel ipsec tunel-asa auto-key ike-gateway VPN-ASA set network tunnel ipsec tunel-asa auto-key proxy-id asa-palo protocol any set network tunnel ipsec tunel-asa auto-key proxy-id asa-palo local 10.20.10.0/24 set network tunnel ipsec tunel-asa auto-key proxy-id asa-palo remote 172.16.1.0/24 set network tunnel ipsec tunel-asa auto-key ipsec-crypto-profile Ipsec-asa set network tunnel ipsec tunel-asa tunnel-monitor enable no set network tunnel ipsec tunel-asa tunnel-interface tunnel.1 set network tunnel ipsec tunel-asa anti-replay no
Dodajemy routing do sieci po stronie ASY przechodzimy do network –> virtual-routers
CLI
set network virtual-router default routing-table ip static-route Route-toASA interface tunnel.1 set network virtual-router default routing-table ip static-route Route-toASA metric 10 set network virtual-router default routing-table ip static-route Route-toASA destination 172.16.1.0/24
Weryfikujemy połączenia
Cisco ASA
CLI
Faza1:
# show crypto isakmp sa detail
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: 192.168.1.51
Type : L2L Role : initiator
Rekey : no State : MM_ACTIVE
Encrypt : aes-256 Hash : SHA
Auth : preshared Lifetime: 86400
Lifetime Remaining: 86380
There are no IKEv2 SAs
Faza 2
# show ipsec sa detail
interface: NET_LAB
Crypto map tag: NET_LAB_map2, seq num: 1, local addr: 192.168.1.80
access-list NET_LAB_cryptomap extended permit ip 172.16.1.0 255.255.255.0 10.20.10.0 255.255.255.0
local ident (addr/mask/prot/port): (172.16.1.0/255.255.255.0/0/0)
remote ident (addr/mask/prot/port): (10.20.10.0/255.255.255.0/0/0)
current_peer: 192.168.1.51
#pkts encaps: 3, #pkts encrypt: 3, #pkts digest: 3
#pkts decaps: 3, #pkts decrypt: 3, #pkts verify: 3
#pkts compressed: 0, #pkts decompressed: 0
#pkts not compressed: 3, #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
#TFC rcvd: 0, #TFC sent: 0
#Valid ICMP Errors rcvd: 0, #Invalid ICMP Errors rcvd: 0
#pkts no sa (send): 0, #pkts invalid sa (rcv): 0
#pkts encaps failed (send): 0, #pkts decaps failed (rcv): 0
#pkts invalid prot (rcv): 0, #pkts verify failed: 0
#pkts invalid identity (rcv): 0, #pkts invalid len (rcv): 0
#pkts invalid pad (rcv): 0,
#pkts invalid ip version (rcv): 0,
#pkts replay rollover (send): 0, #pkts replay rollover (rcv): 0
#pkts replay failed (rcv): 0
#pkts min mtu frag failed (send): 0, #pkts bad frag offset (rcv): 0
#pkts internal err (send): 0, #pkts internal err (rcv): 0
local crypto endpt.: 192.168.1.80/0, remote crypto endpt.: 192.168.1.51/0
path mtu 1500, ipsec overhead 74(44), media mtu 1500
PMTU time remaining (sec): 0, DF policy: copy-df
ICMP error validation: disabled, TFC packets: disabled
current outbound spi: A1AD74BD
current inbound spi : 9F115119
inbound esp sas:
spi: 0x9F115119 (2668712217)
transform: esp-aes-256 esp-sha-hmac no compression
in use settings ={L2L, Tunnel, PFS Group 2, IKEv1, }
slot: 0, conn_id: 81920, crypto-map: NET_LAB_map2
sa timing: remaining key lifetime (sec): 28567
IV size: 16 bytes
replay detection support: Y
Anti replay bitmap:
0x00000000 0x0000000F
outbound esp sas:
spi: 0xA1AD74BD (2712499389)
transform: esp-aes-256 esp-sha-hmac no compression
in use settings ={L2L, Tunnel, PFS Group 2, IKEv1, }
slot: 0, conn_id: 81920, crypto-map: NET_LAB_map2
sa timing: remaining key lifetime (sec): 28566
IV size: 16 bytes
replay detection support: Y
Anti replay bitmap:
0x00000000 0x00000001
Weryfikacja ze strony Palo
W GUI przechodzimy do monitor –> logs –> system gdzie log filtrujemy: ( subtype eq vpn )
możemy też przejść do network –> ipsec-tunnels i sprawdzić czy kontrolki w kolumnach świecą na zielono, można kliknąć na nie i zobaczyć więcej szczegółów:
CLI
Faza1
> show vpn ike-sa detail gateway VPN-ASA
IKE Gateway VPN-ASA, ID 1 192.168.1.51 => 192.168.1.80
Current time: Mar.24 04:04:31
IKE Phase1 SA:
Cookie: 8EE57EC6DC0BF7C0:E4C239F89F5E3F8F Resp
State: Established
Mode: Main
Authentication: PSK
Proposal: AES256-CBC/SHA1/DH2
NAT: Not detected
Message ID: 0, phase 2: 0
Phase 2 SA created : 1
Created: Mar.24 03:51:45, 12 minutes 46 seconds ago
Expires: Mar.25 03:51:45
Faza 2
> show vpn tunnel name tunel-asa TnID Name(Gateway) Local Proxy IP Ptl:Port Remote Proxy IP Ptl:Port Proposals ---- ------------- -------------- -------- --------------- -------- --------- 1 tunel-asa:asa-palo(VPN-ASA) 10.20.10.0/24 0:0 172.16.1.0/24 0:0 ESP tunl [DH2][AES256][SHA1] 28800-sec Show IPSec tunnel config: Total 1 tunnels found. > show vpn ipsec-sa tunnel tunel-asa:asa-palo GwID/client IP TnID Peer-Address Tunnel(Gateway) Algorithm SPI(in) SPI(out) life(Sec/KB) -------------- ---- ------------ --------------- --------- ------- -------- ------------ 1 1 192.168.1.80 tunel-asa:asa-palo(VPN-ASA) ESP/A256/SHA1 A1AD74BD 9F115119 27991/0 Show IPSec SA: Total 1 tunnels found. 1 ipsec sa found.
Statystki dla połączenia:
> show vpn flow name tunel-asa:asa-palo
tunnel tunel-asa:asa-palo
id: 1
type: IPSec
gateway id: 1
local ip: 192.168.1.51
peer ip: 192.168.1.80
inner interface: tunnel.1
outer interface: ethernet1/1
state: active
session: 212
tunnel mtu: 1428
lifetime remain: 27906 sec
latest rekey: 894 seconds ago
monitor: off
monitor packets seen: 0
monitor packets reply:0
en/decap context: 5
local spi: A1AD74BD
remote spi: 9F115119
key type: auto key
protocol: ESP
auth algorithm: SHA1
enc algorithm: AES256
proxy-id:
local ip: 10.20.10.0/24
remote ip: 172.16.1.0/24
protocol: 0
local port: 0
remote port: 0
anti replay check: no
copy tos: no
authentication errors: 0
decryption errors: 0
inner packet warnings: 0
replay packets: 0
packets received
when lifetime expired:0
when lifesize expired:0
sending sequence: 3
receive sequence: 0
encap packets: 116
decap packets: 6
encap bytes: 13536
decap bytes: 624
key acquire requests: 63
owner state: 0
owner cpuid: s1dp0
ownership: 1


















