User Tools

Site Tools


doc:appunti:linux:sa:ipsec

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:linux:sa:ipsec [2015/09/21 16:34] – [Client Router DrayTek Vigor 2500/2600] niccolodoc:appunti:linux:sa:ipsec [2015/09/25 08:17] – [Initiator dietro NAT verso server passivo] niccolo
Line 289: Line 289:
 viene ripetuta finché il remoto non si accorge. viene ripetuta finché il remoto non si accorge.
  
-==== Client con IP dinamico, network remota, PSK ====+==== Client con IP dinamico e LAN associata, PSK ====
  
 Usando un IP dinamico e la PSK è obbligatorio usare l'aggressive mode. Nel file **''/etc/racoon/psk.txt''** il client con IP dinamico viene identificato con un nome FQDN. Usando un IP dinamico e la PSK è obbligatorio usare l'aggressive mode. Nel file **''/etc/racoon/psk.txt''** il client con IP dinamico viene identificato con un nome FQDN.
Line 350: Line 350:
  
  
-==== Client Router DrayTek Vigor 2500/2600 con IP statico e LAN ====+==== Client con IP statico e LAN associata, PSK (es. router DrayTek Vigor 2500/2600) ====
  
 :!: **ATTENZIONE**: Si è riscontrato un **[[ipsec_draytek|problema con i router DrayTek]]**. :!: **ATTENZIONE**: Si è riscontrato un **[[ipsec_draytek|problema con i router DrayTek]]**.
Line 368: Line 368:
 } }
  
-# 
-# Connection mariabarbara 
-# 
 remote 217.19.150.165 { remote 217.19.150.165 {
         proposal {         proposal {
Line 445: Line 442:
 </file> </file>
  
 +==== Initiator dietro NAT verso server passivo ====
 +
 +Se il cliente/initiator non ha un IP pubblico, ma sta dietro il NAT di un router, occorrono alcuni aggiustamenti alla configurazione.
 +
 +L'indirizzo del client è **10.0.1.2** (IP privato, dietro NAT), il server ha indirizzo **82.63.172.2**, la PSK è associata a tale IP in **''/etc/racoon/psk.txt''**, la rete privata da raggiungere presso il server è **192.168.100.0/24**.
 +
 +<file>
 +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 "vpn.nat-client.net";
 +        # Verifica l'identita' del peer su /etc/racoon/psk.txt con l'indirizzo IP.
 +        peers_identifier address "82.63.172.2";
 +        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/24 any {
 +        pfs_group modp1024;
 +        lifetime time 12 hour;
 +        encryption_algorithm 3des, blowfish, des, rijndael;
 +        authentication_algorithm hmac_sha1, hmac_md5;
 +        compression_algorithm deflate;
 +}
 +</file>
 +
 +Nel file **''/etc/ipsec-tools.d/82.63.172.2.conf''** si mette:
 +
 +<file>
 +spdadd 10.0.1.0/24       192.168.100.0/24  any -P out ipsec esp/tunnel/10.0.1.2-82.63.172.2/unique;
 +spdadd 192.168.100.0/24  10.0.1.0/24       any -P in  ipsec esp/tunnel/82.63.172.2-10.0.1.2/unique;
 +</file>
 ===== Configurazione firewall Shorewall ===== ===== Configurazione firewall Shorewall =====
  
doc/appunti/linux/sa/ipsec.txt · Last modified: 2018/01/08 11:24 by niccolo