doc:appunti:linux:sa:ipsec
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
doc:appunti:linux:sa:ipsec [2015/09/21 16:36] – [Client Router DrayTek Vigor 2500/2600 con IP statico e LAN] niccolo | doc:appunti:linux:sa:ipsec [2016/12/13 10:37] – [Configurazione Debian 8 Jessie] niccolo | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== IPSEC con Debian GNU/Linux ====== | ====== IPSEC con Debian GNU/Linux ====== | ||
+ | ===== Configurazione Debian 8 Jessie ===== | ||
+ | |||
+ | IPSEC - su una distribuzione Debian moderna - si basa sui servizi **Setkey** e **Racoon**, questi servizi si avviano con **systemd**. | ||
+ | |||
+ | Configuriamo ad esempio | ||
+ | |||
+ | (LAN 192.168.10.0/ | ||
+ | |||
+ | In generale i file di configurazione sono questi (si esamina il firewall 5.10.168.170): | ||
+ | |||
+ | **/ | ||
+ | |||
+ | < | ||
+ | spdadd 192.168.10.0/ | ||
+ | spdadd 192.168.20.0/ | ||
+ | </ | ||
+ | |||
+ | **/ | ||
+ | |||
+ | < | ||
+ | include "/ | ||
+ | </ | ||
+ | |||
+ | **/ | ||
+ | |||
+ | < | ||
+ | remote 5.20.195.220 { | ||
+ | exchange_mode main; | ||
+ | proposal { | ||
+ | encryption_algorithm 3des; | ||
+ | hash_algorithm md5; | ||
+ | authentication_method pre_shared_key; | ||
+ | dh_group modp768; | ||
+ | } | ||
+ | # Verifica l' | ||
+ | peers_identifier address " | ||
+ | verify_identifier on; | ||
+ | initial_contact on; | ||
+ | } | ||
+ | |||
+ | sainfo address 192.168.10.0/ | ||
+ | encryption_algorithm 3des; | ||
+ | authentication_algorithm hmac_md5, | ||
+ | compression_algorithm deflate; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | **/ | ||
+ | |||
+ | < | ||
+ | 5.20.195.220 | ||
+ | </ | ||
+ | |||
+ | Per fermare e riavviare il servizio: | ||
+ | |||
+ | < | ||
+ | systemctl stop racoon | ||
+ | systemctl stop setkey | ||
+ | |||
+ | systemctl start setkey | ||
+ | systemctl start racoon | ||
+ | </ | ||
+ | |||
+ | Il traffico IPSEC va ovviamente gestito in maniera opportuna poiché non corrisponde al criterio standard MASQUERADE di iptables. Ad esempio [[# | ||
+ | |||
+ | In generale si potrà testare la VPN con un ping, a patto di usare gli indirizzi IP sul lato LAN: | ||
+ | |||
+ | < | ||
+ | ping -I 192.168.10.254 192.168.20.1 | ||
+ | </ | ||
===== Pezzi di IPSEC per Linux ===== | ===== Pezzi di IPSEC per Linux ===== | ||
Line 368: | Line 439: | ||
} | } | ||
- | # | ||
- | # Connection mariabarbara | ||
- | # | ||
remote 217.19.150.165 { | remote 217.19.150.165 { | ||
proposal { | proposal { | ||
Line 445: | Line 513: | ||
</ | </ | ||
+ | ==== Initiator dietro NAT verso server passivo ==== | ||
+ | |||
+ | Se il cliente/ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | listen { | ||
+ | isakmp 10.0.1.2; | ||
+ | isakmp_natt 10.0.1.2 [4500]; | ||
+ | strict_address; | ||
+ | } | ||
+ | |||
+ | remote 82.63.172.2 { | ||
+ | nat_traversal on; | ||
+ | exchange_mode aggressive; | ||
+ | my_identifier fqdn " | ||
+ | # Verifica l' | ||
+ | peers_identifier address " | ||
+ | lifetime time 21600 sec; | ||
+ | proposal_check strict; | ||
+ | proposal { | ||
+ | encryption_algorithm 3des; | ||
+ | hash_algorithm md5; | ||
+ | authentication_method pre_shared_key; | ||
+ | # For aggressive mode, it must be the same on both ends. | ||
+ | dh_group modp1024; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | sainfo address 10.0.1.0/24 any address 192.168.100.0/ | ||
+ | pfs_group modp1024; | ||
+ | lifetime time 12 hour; | ||
+ | encryption_algorithm 3des, blowfish, des, rijndael; | ||
+ | authentication_algorithm hmac_sha1, hmac_md5; | ||
+ | compression_algorithm deflate; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Nel file **''/ | ||
+ | |||
+ | < | ||
+ | spdadd 10.0.1.0/ | ||
+ | spdadd 192.168.100.0/ | ||
+ | </ | ||
===== Configurazione firewall Shorewall ===== | ===== Configurazione firewall Shorewall ===== | ||
doc/appunti/linux/sa/ipsec.txt · Last modified: 2018/01/08 11:24 by niccolo