VPN Bintec zu Linux: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
 
(13 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 91: Zeile 91:
 
(Klicken zum Vergrößern)
 
(Klicken zum Vergrößern)
  
[[Datei:IPSec-Peers.jpg|500px]][[Datei:IPSec-Peers2.jpg|500px]]
+
==== IKE (Phase 1) ====
 
 
 
[[Datei:Phase-1.jpg|500px]][[Datei:Phase-1-2.jpg|500px]]
 
[[Datei:Phase-1.jpg|500px]][[Datei:Phase-1-2.jpg|500px]]
  
 +
==== ESP (Phase 2) ====
 
[[Datei:Phase-2.jpg|500px]][[Datei:Phase-2-2.jpg|500px]]
 
[[Datei:Phase-2.jpg|500px]][[Datei:Phase-2-2.jpg|500px]]
 +
 +
==== Peers ====
 +
[[Datei:IPSec-Peers.jpg|500px]][[Datei:IPSec-Peers2.jpg|500px]]
  
 
== VPN mit Zertifikaten ==
 
== VPN mit Zertifikaten ==
 
; {{RedText|Uhrzeiten und Datum auf allen Geräten kontrollieren und synchronisieren!}}
 
; {{RedText|Uhrzeiten und Datum auf allen Geräten kontrollieren und synchronisieren!}}
 
=== Zertifikate erstellen ===
 
=== Zertifikate erstellen ===
==== CA Erstellen ====
+
Siehe: [[SSL Certificate Authority]]
Makefile
 
<source lang="Make">
 
 
 
</source>
 
==== Zertifikate erstellen ====
 
 
=== Konfiguration der Linux Seite ===
 
=== Konfiguration der Linux Seite ===
 
=== Konfiguration der Bintec Seite ===
 
=== Konfiguration der Bintec Seite ===
Zeile 141: Zeile 139:
 
  > certtable
 
  > certtable
  
==== IKE ====
+
==== IKE (Phase 1) ====
==== ESP ====
+
RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
 +
[IPSEC][PHASE1][EDIT]                                                    rs120
 +
_______________________________________________________________________________
 +
 +
    Description (Idx 1) :    uru-cert             
 +
    Proposal              :  33 (3DES/MD5)
 +
    Lifetime Policy      :  Propose this lifetime, accept and use all proposals
 +
                            Seconds: 14400      KBytes: 0
 +
    Group                :  2 (1024 bit MODP)
 +
    Authentication Method :  RSA Signatures
 +
    Mode                  :  aggressive
 +
    Alive Check          :  autodetect
 +
    Block Time            :  -1
 +
    Local ID              :  <MAILTO=technik@xinux.de, CN=bintec, OU=edv, L=zweibruecken, ST=rlp, C=de>
 +
    Local Certificate    :  1 (own)
 +
    CA Certificates      :
 +
    Nat-Traversal        :  enabled
 +
 +
    View Proposals >
 +
 +
                          SAVE                          CANCEL
 +
_______________________________________________________________________________
 +
Enter string, max length = 255 chars
 +
 
 +
==== ESP (Phase 2) ====
 +
RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
 +
[IPSEC][PHASE2][EDIT]                                                    rs120
 +
_______________________________________________________________________________
 +
 +
    Description (Idx 1) :    Multi-Proposal             
 +
 +
    Proposal              :  5 (ESP(3DES/MD5))
 +
    Lifetime Policy      :  Propose this lifetime, accept and use all proposals
 +
                            Seconds: 7200        KBytes: 0
 +
    Use PFS              :  group 2 (1024 bit MODP)
 +
    Alive Check          :  none
 +
    Propagate PMTU        :  yes
 +
 +
    View Proposals >
 +
 +
 +
 +
 +
 +
 +
                          SAVE                          CANCEL
 +
_______________________________________________________________________________
 +
Enter string, max length = 255 chars
 +
 
 +
==== Peer ====
 +
RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
 +
[PEERS][EDIT]: Configure Peer                                            rs120
 +
_______________________________________________________________________________
 +
 +
      Description:      lin-bin                                     
 +
      IKE Version:      IKE V1
 +
      Admin Status:      up
 +
 +
      Peer Address:
 +
      Peer IDs:          [uru]
 +
 +
      Pre Shared Key:    *
 +
      IPSec Callback >
 +
                       
 +
                       
 +
 +
      Peer specific Settings >
 +
      Virtual Interface: yes
 +
      Interface IP Settings >
 +
 +
                          SAVE                          CANCEL
 +
_______________________________________________________________________________
 +
Enter string, max length = 255 chars
 +
 
 +
      IPSec Callback > ISDN Callback:      disabled
 +
 
 +
RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
 +
[PEERS][EDIT][SPECIAL]: Special Settings (lin-bin)                        rs120
 +
_______________________________________________________________________________
 +
 +
 +
      Special settings for peer No. 1  :  lin-bin
 +
 +
 +
 +
      IKE (Phase 1) Profile:  uru-cert              edit >
 +
 +
      IPsec (Phase 2) Profile: Multi-Proposal        edit >
 +
 +
      Special Peer Type:      None
 +
      Start Mode:              On Demand
 +
 +
 +
      XAUTH Profile:          (none)                edit >
 +
 +
                          SAVE                          CANCEL
 +
 +
_______________________________________________________________________________
 +
Use <Space> to select
 +
 
 +
===== Routing =====
 +
Interface IP Settings > More Routing >
 +
 
 +
RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
 +
[PEERS][EDIT][EDIT][IP][ROUTING][EDIT]                                    rs120
 +
_______________________________________________________________________________
 +
 +
  Route Type                  Network route                                 
 +
  Network                    WAN without transit network
 +
 +
  Destination IP-Address      192.168.33.0
 +
  Netmask                    255.255.255.0
 +
  Partner / Interface        lin-bin
 +
 +
  Metric                      1
 +
 +
 +
 +
 +
 +
 +
 +
 +
                    SAVE                              CANCEL
 +
_______________________________________________________________________________
 +
Use <Space> to select
 +
 
 +
= Siehe Auch =
 +
* [[Bintec]]
  
 
= Links =
 
= Links =

Aktuelle Version vom 2. August 2011, 06:46 Uhr

Ist-zustand

  • ESXi Server zur Simulation der Linux Seite unkonfiguriert vorhanden
  • unkonfigurierter Bintec Router

Soll-zustand

  1. 2 gesicherte Netze sollen über eine verschlüsselte VPN Verbindung miteinander kommunizieren
    Bintec Router - Mit Laptop für Testnetz
    Linux System
  2. VPN Eigenschaften
    1. Authentifizierung mittels PSK
    2. Austausch des PSK mit Zertifikaten
      Bintec behält feste IP

Kann Optionen

  • Linux Seite bekommt Adressen via DHCP
  • Datenverkehr wird mittels Firewall geregelt

Abgrenzungskriterien

  • Keine Roadwarrior

Netzplan

BILD

Netze

Transitnetz
192.168.240.0/20
Bintec Intern
172.23.47.0/24
Linux Intern
192.168.33.0/24

IPs

Bintec
  • Transit
192.168.253.47
  • Intern
172.23.47.1
  • Client
172.23.47.5
Linux
  • Transit
192.168.248.21
  • Intern
192.168.33.1

Vorgehensweise

  1. Grundaufbau
    Netzwerkstukur
    Verkabelung
    Bintec Basiskonfiguration ohne VPNs
    VM Installieren
  2. VPN Aufbau
    Kenndaten
    siehe Datei:Projekt Bintec VPN 1.pdf
  3. VPN Wechsel zu Zertifikaten
    Kenndaten
    Siehe Datei:Projekt Bintec VPN 2.pdf

Step by Step Anleitung

VPN mit PSK

Konfiguration der Linux Seite

Installation von OpenSwan als IPSec Implementierung

aptitude install openswan

IPSec Konfiguration

Konfiguration der VPN Tunnel

/etc/ipsec.conf

config setup
      protostack=netkey 
      nat_traversal=yes 

conn %default                         # Standartwerte
       left=192.168.248.21            # Eigene externe IP
       leftid=192.168.248.21          # Eigene Gateway ID
       leftsubnet=192.168.33.0/24     # Zu tunnelndes eigenes Netzwerk
       authby=secret                  # Authentifizierungsmethode
       ike=3des-md5-modp1024          # Phase 1 Authentifizierungs-Parameter für Verschlüsselung und Hashes
       esp=3des-md5-96                # Phase 2 Parameter 
       pfs=yes                        # erneute Diffie-Hellman-Methode bei periodischem Schlüsselwechsel
       auto=start                     # VPN Automatisch starten

conn linux-bintec                     # interner Name der VPN Verbindung
       right=192.168.253.47           # VPN Gateway IP der Gegenseite
       rightsubnet=172.23.47.0/24     # via VPN getunneltes Netz der Gegenseite
Einrichtung des gemeinsamen Geheimnisses (PSK)

/etc/ipsec.secrets

192.168.248.21 192.168.253.47 : PSK "meinsicherespasswort"

Start der Konfiguration

/etc/init.d/ipsec start
ipsec setup --restart

Konfiguration der Bintec Seite

(Klicken zum Vergrößern)

IKE (Phase 1)

Phase-1.jpgPhase-1-2.jpg

ESP (Phase 2)

Phase-2.jpgPhase-2-2.jpg

Peers

IPSec-Peers.jpgIPSec-Peers2.jpg

VPN mit Zertifikaten

Uhrzeiten und Datum auf allen Geräten kontrollieren und synchronisieren!

Zertifikate erstellen

Siehe: SSL Certificate Authority

Konfiguration der Linux Seite

Konfiguration der Bintec Seite

Konvertierung zu PKCS#12 Format

Wichtig Container mit einem Passwort versehen, da Bintec sonst den Import abbricht

# openssl pkcs12 -export -in bintec.crt -inkey bintec.key -certfile ca.crt -out bintec.p12

Zertifikate Importieren

Da wir den Schlüssel mitsamt Zertifikat und CA in einem PKCS#12 Container haben können wir mit

> cert get tftp://tftp-server/path/to/file.p12 belibigebezeichnung

alles mit einem mal Importieren.


Andernfalls muss der Schlüssel in einen PKCS#8 Container.

# openssl pkcs8 -in bintec.key -topk8 -inform pem -out bintec.pk8

Um anschließend einzeln importiert werden zu können.

> key import tftp://tftp-server/path/to/file.pk8 belibigebezeichnung passwort
In der Tabelle ipsecPublicKeyTable wird der Schlüssel angezeigt.
> ipsecPublicKeyTable

Und nun müssen die Zertifikate einzeln geladen werden. Zuerst das Schlüssel-Zertifikat.

Die Bezeichnungen von Schlüssel und Zertifikat müssen übereinstimmen!
> cert get tftp://tftp-server/path/to/file.crt belibigebezeichnung
Achten Sie auf
cert: user certificate detected

Zum Schluss das CA Zertifikat.

> cert get tftp://tftp-server/path/to/ca/file.crt belibigeCAbezeichnung
Achten Sie auf
cert: CA certificate detected
In der CertTable können alle Zertifikate kontrolliert werden.
> certtable

IKE (Phase 1)

RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
[IPSEC][PHASE1][EDIT]                                                     rs120
_______________________________________________________________________________

   Description (Idx 1) :    uru-cert              
   Proposal              :  33 (3DES/MD5)
   Lifetime Policy       :  Propose this lifetime, accept and use all proposals
                            Seconds: 14400       KBytes: 0
   Group                 :  2 (1024 bit MODP)
   Authentication Method :  RSA Signatures
   Mode                  :  aggressive
   Alive Check           :  autodetect
   Block Time            :  -1
   Local ID              :  <MAILTO=technik@xinux.de, CN=bintec, OU=edv, L=zweibruecken, ST=rlp, C=de>
   Local Certificate     :  1 (own)
   CA Certificates       :
   Nat-Traversal         :  enabled

   View Proposals >

                         SAVE                          CANCEL
_______________________________________________________________________________
Enter string, max length = 255 chars

ESP (Phase 2)

RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
[IPSEC][PHASE2][EDIT]                                                     rs120
_______________________________________________________________________________

   Description (Idx 1) :    Multi-Proposal              

   Proposal              :  5 (ESP(3DES/MD5))
   Lifetime Policy       :  Propose this lifetime, accept and use all proposals
                            Seconds: 7200        KBytes: 0
   Use PFS               :  group 2 (1024 bit MODP)
   Alive Check           :  none
   Propagate PMTU        :  yes

   View Proposals >






                         SAVE                          CANCEL
_______________________________________________________________________________
Enter string, max length = 255 chars

Peer

RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
[PEERS][EDIT]: Configure Peer                                             rs120
_______________________________________________________________________________

     Description:       lin-bin                                      
     IKE Version:       IKE V1
     Admin Status:      up

     Peer Address:
     Peer IDs:          [uru]

     Pre Shared Key:    *
     IPSec Callback >
                       
                       

     Peer specific Settings >
     Virtual Interface: yes
     Interface IP Settings >

                          SAVE                          CANCEL
_______________________________________________________________________________
Enter string, max length = 255 chars
     IPSec Callback > ISDN Callback:       disabled 
RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
[PEERS][EDIT][SPECIAL]: Special Settings (lin-bin)                        rs120
_______________________________________________________________________________


     Special settings for peer No. 1  :  lin-bin



     IKE (Phase 1) Profile:   uru-cert               edit >

     IPsec (Phase 2) Profile: Multi-Proposal         edit >

     Special Peer Type:       None
     Start Mode:              On Demand


     XAUTH Profile:           (none)                 edit >

                          SAVE                          CANCEL

_______________________________________________________________________________
Use <Space> to select
Routing
Interface IP Settings > More Routing >
RS120 Setup Tool                        Funkwerk Enterprise Communications GmbH
[PEERS][EDIT][EDIT][IP][ROUTING][EDIT]                                    rs120
_______________________________________________________________________________

  Route Type                  Network route                                   
  Network                     WAN without transit network

  Destination IP-Address      192.168.33.0
  Netmask                     255.255.255.0
  Partner / Interface         lin-bin

  Metric                      1








                    SAVE                               CANCEL
_______________________________________________________________________________
Use <Space> to select

Siehe Auch

Links