VPN Site to Site ASA

Problemy z zakresu security (VPN, firewall, IDS/IPS itp.)
Wiadomość
Autor
iTSeba
member
member
Posty: 31
Rejestracja: 01 wrz 2015, 19:50

VPN Site to Site ASA

#1

#1 Post autor: iTSeba »

Witam,

Już nie mam pomysłu...

Środowisko testowe, wygląda następująco:



PC ----- ASA5505_A ---------- ASA5505_B ------- Server

ASY konfigurowane od 0, polityki wszystkie permit. Ostatecznie jest możliwe pingowanie z PC interfejsu zewnętrznego ASA5505_B, czyli nic mnie nie blokuje.

Utworzyłem VPNa Site to Site na różne sposoby:
- wizard
- ręcznie ASDM
- CLI "ręcznie"
- CLI (przeklejone z Guide Cisco, pozmieniane jedynie na odpowiednie adresy)

Tunele kompletnie mi nie wstają. Żadnej reakcji. Komenda "debug crypto isakmp" nic nie wyrzuca na ekran.

Show crypto isakmp:

Kod: Zaznacz cały

ASA#show crypto isakmp

There are no isakmp sas

Global IKE Statistics
Active Tunnels: 0
Previous Tunnels: 0
In Octets: 0
In Packets: 0
In Drop Packets: 0
In Notifys: 0
In P2 Exchanges: 0
In P2 Exchange Invalids: 0
In P2 Exchange Rejects: 0
In P2 Sa Delete Requests: 0
Out Octets: 0
Out Packets: 0
Out Drop Packets: 0
Out Notifys: 0
Out P2 Exchanges: 0
Out P2 Exchange Invalids: 0
Out P2 Exchange Rejects: 0
Out P2 Sa Delete Requests: 0
Initiator Tunnels: 0
Initiator Fails: 0
Responder Fails: 0
System Capacity Fails: 0
Auth Fails: 0
Decrypt Fails: 0
Hash Valid Fails: 0
No Sa Fails: 0

Global IPSec over TCP Statistics
--------------------------------
Embryonic connections: 0
Active connections: 0
Previous connections: 0
Inbound packets: 0
Inbound dropped packets: 0
Outbound packets: 0
Outbound dropped packets: 0
RST packets: 0
Recevied ACK heart-beat packets: 0
Bad headers: 0
Bad trailers: 0
Timer failures: 0
Checksum errors: 0
Internal errors: 0
Licencja AS:
This platform has a Base license.

Version 8.2(4)
Device Manager Version 6.2(5)53

Przy tylu próbach wątpie, żebym o czymś zapomniał, ale może jednak. Macie jakiś pomysł ?

mihu
wannabe
wannabe
Posty: 762
Rejestracja: 10 kwie 2006, 10:37
Lokalizacja: Kraina Deszczowcow

Re: VPN Site to Site ASA

#2

#2 Post autor: mihu »

iTSeba pisze:Witam,

Już nie mam pomysłu...

Środowisko testowe, wygląda następująco:



PC ----- ASA5505_A ---------- ASA5505_B ------- Server

ASY konfigurowane od 0, polityki wszystkie permit. Ostatecznie jest możliwe pingowanie z PC interfejsu zewnętrznego ASA5505_B, czyli nic mnie nie blokuje.

Utworzyłem VPNa Site to Site na różne sposoby:
- wizard
- ręcznie ASDM
- CLI "ręcznie"
- CLI (przeklejone z Guide Cisco, pozmieniane jedynie na odpowiednie adresy)

Tunele kompletnie mi nie wstają. Żadnej reakcji. Komenda "debug crypto isakmp" nic nie wyrzuca na ekran.

jakbyś wrzucił config to może i bym miał pomysł takto mogę zgadywać, że Ci brakuje :

Kod: Zaznacz cały

crypto isakmp enable outside
albo przekleić gotowca :)
ML
-------------------------------------------------------------------------------------
"Minds are like parachutes, they work best when they are open"

iTSeba
member
member
Posty: 31
Rejestracja: 01 wrz 2015, 19:50

Re: VPN Site to Site ASA

#3

#3 Post autor: iTSeba »

Oj chciałbym żeby po prostu tego brakowało ;) Niestety nie jest taki pięknie. Poniżej konfiguracja z obu:

Kod: Zaznacz cały

ASA-WAN# sh run
: Saved
:
ASA Version 8.2(4)
!
hostname ASA-WAN
domain-name WAN
enable password 8Ry2YjIyt7RRXU24 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
name 10.10.10.0 Remote
!
interface Ethernet0/0
!
interface Ethernet0/1
!
interface Ethernet0/2
 switchport access vlan 10
!
interface Ethernet0/3
 switchport access vlan 10
!
interface Ethernet0/4
 switchport access vlan 10
!
interface Ethernet0/5
 switchport access vlan 10
!
interface Ethernet0/6
 switchport access vlan 10
!
interface Ethernet0/7
 switchport access vlan 10
!
interface Vlan1
 nameif outside
 security-level 0
 ip address 88.240.17.1 255.255.255.0
!
interface Vlan10
 nameif inside
 security-level 100
 ip address 192.168.0.1 255.255.255.0
!
boot system disk0:/asa824-k8.bin
ftp mode passive
dns server-group DefaultDNS
 domain-name WAN
access-list inside_access_in extended permit ip any any
access-list outside_access_in extended permit ip any any
access-list outside_1_cryptomap extended permit ip 192.168.0.0 255.255.255.0 Remote 255.255.255.0
access-list inside_nat0_outbound extended permit ip 192.168.0.0 255.255.255.0 Remote 255.255.255.0
pager lines 24
mtu outside 1500
mtu inside 1500
ipv6 access-list inside_access_ipv6_in permit ip any any
ipv6 access-list outside_access_ipv6_in permit ip any any
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-625.bin
no asdm history enable
arp timeout 14400
global (outside) 101 interface
nat (inside) 0 access-list inside_nat0_outbound
nat (inside) 101 0.0.0.0 0.0.0.0
access-group outside_access_in in interface outside
access-group outside_access_ipv6_in in interface outside
access-group inside_access_in in interface inside
access-group inside_access_ipv6_in in interface inside
route inside 0.0.0.0 0.0.0.0 88.240.17.2 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
http server enable
http 192.168.0.0 255.255.255.0 inside
http 88.240.17.0 255.255.255.252 outside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec transform-set ESP-3DES-SHA esp-3des esp-sha-hmac
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
crypto map outside_map 1 match address outside_1_cryptomap
crypto map outside_map 1 set pfs group1
crypto map outside_map 1 set peer 88.240.17.2
crypto map outside_map 1 set transform-set ESP-3DES-SHA
crypto map outside_map interface outside
crypto isakmp enable outside
crypto isakmp policy 10
 authentication pre-share
 encryption 3des
 hash sha
 group 2
 lifetime 86400
telnet timeout 5
ssh 192.168.0.0 255.255.255.0 inside
ssh timeout 5
console timeout 0
dhcpd address 192.168.0.2-192.168.0.10 inside
dhcpd enable inside
!

threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
username sebastian password edR/KHEMULfpCqWk encrypted
tunnel-group 88.240.17.2 type ipsec-l2l
tunnel-group 88.240.17.2 ipsec-attributes
 pre-shared-key *****
!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum client auto
  message-length maximum 512
policy-map global_policy
 class inspection_default
  inspect dns preset_dns_map
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect ip-options
  inspect netbios
  inspect rsh
  inspect rtsp
  inspect skinny
  inspect esmtp
  inspect sqlnet
  inspect sunrpc
  inspect tftp
  inspect sip
  inspect xdmcp
!
service-policy global_policy global
prompt hostname context
call-home
 profile CiscoTAC-1
  no active
  destination address http https://tools.cisco.com/its/service/oddce/services/DDCEService
  destination address email callhome@cisco.com
  destination transport-method http
  subscribe-to-alert-group diagnostic
  subscribe-to-alert-group environment
  subscribe-to-alert-group inventory periodic monthly
  subscribe-to-alert-group configuration periodic monthly
  subscribe-to-alert-group telemetry periodic daily
Cryptochecksum:d1715e7477a1e06d693cb079901e7883
: end

Kod: Zaznacz cały

ASA-LAN# sh run
: Saved
:
ASA Version 8.2(4)
!
hostname ASA-LAN
domain-name LAN
enable password 8Ry2YjIyt7RRXU24 encrypted
passwd 2KFQnbNIdI.2KYOU encrypted
names
name 192.168.0.0 Remote
!
interface Ethernet0/0
!
interface Ethernet0/1
!
interface Ethernet0/2
 switchport access vlan 10
!
interface Ethernet0/3
 switchport access vlan 10
!
interface Ethernet0/4
 switchport access vlan 10
!
interface Ethernet0/5
 switchport access vlan 10
!
interface Ethernet0/6
 switchport access vlan 10
!
interface Ethernet0/7
 switchport access vlan 10
!
interface Vlan1
 nameif outside
 security-level 0
 ip address 88.240.17.2 255.255.255.0
!
interface Vlan10
 nameif inside
 security-level 100
 ip address 10.10.10.1 255.255.255.0
!
boot system disk0:/asa824-k8.bin
ftp mode passive
dns server-group DefaultDNS
 domain-name LAN
access-list inside_access_in extended permit ip any any
access-list outside_access_in extended permit ip any any
access-list outside_1_cryptomap extended permit ip 10.10.10.0 255.255.255.0 Remote 255.255.255.0
access-list inside_nat0_outbound extended permit ip 10.10.10.0 255.255.255.0 Remote 255.255.255.0
pager lines 24
mtu outside 1500
mtu inside 1500
ipv6 access-list inside_access_ipv6_in permit ip any any
ipv6 access-list outside_access_ipv6_in permit ip any any
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-625.bin
no asdm history enable
arp timeout 14400
global (outside) 101 interface
nat (inside) 0 access-list inside_nat0_outbound
nat (inside) 101 0.0.0.0 0.0.0.0
access-group outside_access_in in interface outside
access-group outside_access_ipv6_in in interface outside
access-group inside_access_in in interface inside
access-group inside_access_ipv6_in in interface inside
route inside 0.0.0.0 0.0.0.0 88.240.17.1 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
dynamic-access-policy-record DfltAccessPolicy
http server enable
http 10.10.10.0 255.255.255.0 inside
http 88.240.17.0 255.255.255.252 outside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ipsec transform-set ESP-3DES-SHA esp-3des esp-sha-hmac
crypto ipsec security-association lifetime seconds 28800
crypto ipsec security-association lifetime kilobytes 4608000
crypto map outside_map 1 match address outside_1_cryptomap
crypto map outside_map 1 set pfs group1
crypto map outside_map 1 set peer 88.240.17.1
crypto map outside_map 1 set transform-set ESP-3DES-SHA
crypto map outside_map interface outside
crypto isakmp enable outside
crypto isakmp policy 10
 authentication pre-share
 encryption 3des
 hash sha
 group 2
 lifetime 86400
telnet timeout 5
ssh 10.10.10.0 255.255.255.0 inside
ssh timeout 5
console timeout 0
dhcpd address 10.10.10.2-10.10.10.10 inside
dhcpd enable inside
!

threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
username sebastian password edR/KHEMULfpCqWk encrypted
tunnel-group 88.240.17.1 type ipsec-l2l
tunnel-group 88.240.17.1 ipsec-attributes
 pre-shared-key *****
!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
 parameters
  message-length maximum client auto
  message-length maximum 512
policy-map global_policy
 class inspection_default
  inspect dns preset_dns_map
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect ip-options
  inspect netbios
  inspect rsh
  inspect rtsp
  inspect skinny
  inspect esmtp
  inspect sqlnet
  inspect sunrpc
  inspect tftp
  inspect sip
  inspect xdmcp
!
service-policy global_policy global
prompt hostname context
call-home
 profile CiscoTAC-1
  no active
  destination address http https://tools.cisco.com/its/service/oddce/services/DDCEService
  destination address email callhome@cisco.com
  destination transport-method http
  subscribe-to-alert-group diagnostic
  subscribe-to-alert-group environment
  subscribe-to-alert-group inventory periodic monthly
  subscribe-to-alert-group configuration periodic monthly
  subscribe-to-alert-group telemetry periodic daily
Cryptochecksum:053f0e301cc28c07c40d385f5a9634aa
: end

kurđ
wannabe
wannabe
Posty: 226
Rejestracja: 13 kwie 2005, 07:15
Lokalizacja: München
Kontakt:

Re: VPN Site to Site ASA

#4

#4 Post autor: kurđ »

Uruchom sobie z jednej sieci wew do drugiej ciągłego pinga.
Na obu ASA-ch uruchom debug icmp trace 10
Obserwuj co się dzieje :)
MfG
Kurđ

jwidel
member
member
Posty: 16
Rejestracja: 14 gru 2016, 00:26

Re: VPN Site to Site ASA

#5

#5 Post autor: jwidel »

ASA ma fajne narzedzie, packet-tracer ktorym mozesz sobie zasymulowac ruch przechodzacy i sprawdzic gdzie ginie/ktoredy przechodzi.
n/p:

ASA-A# packet-tracer input INSIDE icmp 192.168.x.x 8 0 10.10.10.x detailed

iTSeba
member
member
Posty: 31
Rejestracja: 01 wrz 2015, 19:50

Re: VPN Site to Site ASA

#6

#6 Post autor: iTSeba »

kurđ pisze:Uruchom sobie z jednej sieci wew do drugiej ciągłego pinga.
Na obu ASA-ch uruchom debug icmp trace 10
Obserwuj co się dzieje :)

Nie dzieje się nic :O kompletnie ... żadnych informacji... ani z jednej ani z drugiej strony.
jwidel pisze:ASA ma fajne narzedzie, packet-tracer ktorym mozesz sobie zasymulowac ruch przechodzacy i sprawdzic gdzie ginie/ktoredy przechodzi.
n/p:

ASA-A# packet-tracer input INSIDE icmp 192.168.x.x 8 0 10.10.10.x detailed
Uruchamiałem wcześniej i pokazuje mi, że łapie się w polisie "blokuj wszystko inne" ale jest to nie możliwe bo nad nią jest polityka która ma zezwalać na CAŁY ruch jaki tylko występuje.

Kod: Zaznacz cały

ASA-LAN# packet-tracer input INSIDE icmp 10.10.10.2 8 0 192.168.0.253 detailed

Phase: 1
Type: ACCESS-LIST
Subtype:
Result: ALLOW
Config:
Implicit Rule
Additional Information:
 Forward Flow based lookup yields rule:
 in  id=0xc95f4ca8, priority=1, domain=permit, deny=false
        hits=1963, user_data=0x0, cs_id=0x0, l3_type=0x8
        src mac=0000.0000.0000, mask=0000.0000.0000
        dst mac=0000.0000.0000, mask=0100.0000.0000

Phase: 2
Type: ROUTE-LOOKUP
Subtype: input
Result: ALLOW
Config:
Additional Information:
in   0.0.0.0         0.0.0.0         inside

Phase: 3
Type: ACCESS-LIST
Subtype:
Result: DROP
Config:
Implicit Rule
Additional Information:
 Forward Flow based lookup yields rule:
 in  id=0xc95f5bc8, priority=111, domain=permit, deny=true
        hits=1642, user_data=0x0, cs_id=0x0, flags=0x4000, protocol=0
        src ip=0.0.0.0, mask=0.0.0.0, port=0
        dst ip=0.0.0.0, mask=0.0.0.0, port=0, dscp=0x0

Result:
input-interface: inside
input-status: up
input-line-status: up
output-interface: inside
output-status: up
output-line-status: up
Action: drop
Drop-reason: (acl-drop) Flow is denied by configured rule

kurđ
wannabe
wannabe
Posty: 226
Rejestracja: 13 kwie 2005, 07:15
Lokalizacja: München
Kontakt:

Re: VPN Site to Site ASA

#7

#7 Post autor: kurđ »

No skoro na asie "źródłowej" nic nie widać, to najwidoczniej pakiety już tutaj nie docierają. Trasy dobrze poustawiane, default gateway na kliencie?

Tapa-volk
MfG
Kurđ

iTSeba
member
member
Posty: 31
Rejestracja: 01 wrz 2015, 19:50

Re: VPN Site to Site ASA

#8

#8 Post autor: iTSeba »

Default route na Asie jest na next hope (w tym przypadku na druga ASE) a jak z sieci wewnętrznej pinguje interfejs zewnętrzny drugiej ASY to normalnie odpowiada.

jwidel
member
member
Posty: 16
Rejestracja: 14 gru 2016, 00:26

Re: VPN Site to Site ASA

#9

#9 Post autor: jwidel »

jwidel pisze:ASA ma fajne narzedzie, packet-tracer ktorym mozesz sobie zasymulowac ruch przechodzacy i sprawdzic gdzie ginie/ktoredy przechodzi.
n/p:

ASA-A# packet-tracer input INSIDE icmp 192.168.x.x 8 0 10.10.10.x detailed
iTSeba pisze: Uruchamiałem wcześniej i pokazuje mi, że łapie się w polisie "blokuj wszystko inne" ale jest to nie możliwe bo nad nią jest polityka która ma zezwalać na CAŁY ruch jaki tylko występuje.
Teoretycznie masz racje, to powinno zalatwic sprawe, icmp jest enkpsulowany w IP:

Kod: Zaznacz cały

access-list inside_access_in extended permit ip any any
access-list outside_access_in extended permit ip any any
ale... to jest ASA. Nie jestem ekspertem od ASy, wyglada jednak ze w objekcie 'ip' nie zawiera sie ICMP.
Spróbuj dodać:

Kod: Zaznacz cały

access-list inside_access_in extended permit icmp any any
access-list outside_access_in extended permit icmp any any

Kod: Zaznacz cały

ASA-LAN# packet-tracer input INSIDE icmp 10.10.10.2 8 0 192.168.0.253 detailed
(...)
Phase: 3
Type: ACCESS-LIST
Subtype:
Result: DROP
Config:
Implicit Rule  <---*
(...)

Implicit Rule - oznacza ze pakiet zostal dropniety przez domyslna (niewidoczna) regule na koncu ACL (drop any any)

kurđ
wannabe
wannabe
Posty: 226
Rejestracja: 13 kwie 2005, 07:15
Lokalizacja: München
Kontakt:

Re: VPN Site to Site ASA

#10

#10 Post autor: kurđ »

iTSeba pisze:Default route na Asie jest na next hope (w tym przypadku na druga ASE) a jak z sieci wewnętrznej pinguje interfejs zewnętrzny drugiej ASY to normalnie odpowiada.
ASA jest też domyślną bramą dla sieci wewnętrznej do wyjścia w internet (to że możesz pingować interfejs zewnętrzny drugiej ASY nic nie znaczy, może wychodzisz przez inny router do internetu)? Asa jest domyślną bramą dla sieci wewnętrznej do wyjścia do drugiej sieci wewnętrznej?
MfG
Kurđ

iTSeba
member
member
Posty: 31
Rejestracja: 01 wrz 2015, 19:50

Re: VPN Site to Site ASA

#11

#11 Post autor: iTSeba »

jwidel pisze:
jwidel pisze: Teoretycznie masz racje, to powinno zalatwic sprawe, icmp jest enkpsulowany w IP:

Kod: Zaznacz cały

access-list inside_access_in extended permit ip any any
access-list outside_access_in extended permit ip any any
ale... to jest ASA. Nie jestem ekspertem od ASy, wyglada jednak ze w objekcie 'ip' nie zawiera sie ICMP.
Spróbuj dodać:

Kod: Zaznacz cały

access-list inside_access_in extended permit icmp any any
access-list outside_access_in extended permit icmp any any

Kod: Zaznacz cały

ASA-LAN# packet-tracer input INSIDE icmp 10.10.10.2 8 0 192.168.0.253 detailed
(...)
Phase: 3
Type: ACCESS-LIST
Subtype:
Result: DROP
Config:
Implicit Rule  <---*
(...)

Implicit Rule - oznacza ze pakiet zostal dropniety przez domyslna (niewidoczna) regule na koncu ACL (drop any any)
Ping jest tylko przykładem - próbuje wiele rzeczy - po drugiej stronie postawiłem testowego ESXa i oprócz pinga próbuje go uruchomić nawet. Ale tunel nawet nie próbuje wstać... Wiem właśnie i to mnie dziwi bo przepuściłem cały ruch, nic nie blokuje a mimo wszystko... tylko nie jeden raz się przekonałem że nie zawsze packet tracer pokazuje rzeczywiście co się z tym dzieje.
kurđ pisze:
iTSeba pisze:Default route na Asie jest na next hope (w tym przypadku na druga ASE) a jak z sieci wewnętrznej pinguje interfejs zewnętrzny drugiej ASY to normalnie odpowiada.
ASA jest też domyślną bramą dla sieci wewnętrznej do wyjścia w internet (to że możesz pingować interfejs zewnętrzny drugiej ASY nic nie znaczy, może wychodzisz przez inny router do internetu)? Asa jest domyślną bramą dla sieci wewnętrznej do wyjścia do drugiej sieci wewnętrznej?
W skrócie ? Rozłączam wszystko - część tablicy routingu:

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 10.10.10.1 10.10.10.2 35
10.10.10.0 255.255.255.0 On-link 10.10.10.2 291
10.10.10.2 255.255.255.255 On-link 10.10.10.2 291
10.10.10.255 255.255.255.255 On-link 10.10.10.2 291






Edit:

dodałem wpis w routingu statycznym na ASIE:

route outside Remote 255.255.255.0 88.240.17.1 1

tunel wstał "od strzała".

Temat można zamknąć ;)

ODPOWIEDZ