OPNsense NAT in der SP: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Manual) |
|||
| (17 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
=Ziel= | =Ziel= | ||
| − | * | + | *Unser lokales Netz (172.16.113.0/24) darf nicht direkt in ein externes Netz (172.16.114.0/24) kommunizieren. |
| − | + | *Die Kommunikation erfolgt deshalb über eine zugewiesene Pseudo-IP (172.20.24.1/32). | |
| − | + | *Pakete aus unserem Netz werden via NAT auf diese einzelne IP übersetzt, bevor sie in das externe Netz gesendet werden. | |
| − | + | *Das externe Netz sieht nur unsere Pseudo-IP (172.20.24.1), niemals unsere tatsächlichen Adressen. | |
| − | + | *NAT erfolgt im IPsec-Tunnel selbst; hierzu sind manuelle SPD-Einträge nötig, um Pakete überhaupt erst in den Tunnel zu bringen. | |
| − | + | =Plan= | |
| − | + | {{#drawio:nat-ipse}} | |
| − | |||
=Szenario= | =Szenario= | ||
| Zeile 15: | Zeile 14: | ||
| '''IP Address''' || 192.168.6.113 || 192.168.6.114 | | '''IP Address''' || 192.168.6.113 || 192.168.6.114 | ||
|- | |- | ||
| − | | '''Internes Netz''' || 172. | + | | '''Internes Netz''' || 172.16.113.0/24 || 172.16.114.0/24 |
|- | |- | ||
| '''Zugeteilte VPN IP''' || 172.20.24.1/32 || X | | '''Zugeteilte VPN IP''' || 172.20.24.1/32 || X | ||
| Zeile 24: | Zeile 23: | ||
|- | |- | ||
| '''Phase 2''' || colspan="2" | AES256 – SHA256 – DH16 | | '''Phase 2''' || colspan="2" | AES256 – SHA256 – DH16 | ||
| + | |} | ||
| + | =VPN: IPsec: Pre-Shared Keys= | ||
| + | ==opnsense.it113.int PSK== | ||
| + | {| class="wikitable" | ||
| + | ! Einstellung || Wert | ||
| + | |- | ||
| + | | '''Local Identifier''' || 192.168.6.113 | ||
| + | |- | ||
| + | | '''Remote Identifier''' || 192.168.6.114 | ||
| + | |- | ||
| + | | '''Pre-Shared Key''' || 123Start$ | ||
| + | |- | ||
| + | | '''Type''' || PSK | ||
| + | |- | ||
| + | | '''Description''' || – | ||
| + | |} | ||
| + | =VPN: IPsec: Connections= | ||
| + | ==opnsense.it113.int Connections== | ||
| + | {| class="wikitable" | ||
| + | ! Einstellung || Wert | ||
| + | |- | ||
| + | | '''Enabled''' || aktiviert (✓) | ||
| + | |- | ||
| + | | '''Proposals''' || es256-sha256-modp4096 [DH16] | ||
| + | |- | ||
| + | | '''Version''' || IKEv2 | ||
| + | |- | ||
| + | | '''MOBIKE''' || deaktiviert | ||
| + | |- | ||
| + | | '''Local addresses''' || 192.168.6.113 | ||
| + | |- | ||
| + | | '''Remote addresses''' || 192.168.6.114 | ||
| + | |- | ||
| + | | '''DPD delay (s)''' || – | ||
| + | |- | ||
| + | | '''Pools''' || Nothing selected | ||
| + | |- | ||
| + | | '''Description''' || it113-it114 | ||
| + | |} | ||
| + | |||
| + | =VPN: IPsec: Connections= | ||
| + | ==opnsense.it113.int Authentication== | ||
| + | ===Local=== | ||
| + | {| class="wikitable" | ||
| + | ! Einstellung || Wert | ||
| + | |- | ||
| + | | '''Enabled''' || aktiviert (✓) | ||
| + | |- | ||
| + | | '''Connection''' || it113-it114 | ||
| + | |- | ||
| + | | '''Round''' || 0 | ||
| + | |- | ||
| + | | '''Authentication''' || Pre-Shared Key | ||
| + | |- | ||
| + | | '''Id''' || 192.168.6.113 | ||
| + | |- | ||
| + | | '''Certificates''' || Nothing selected | ||
| + | |- | ||
| + | | '''Description''' || – | ||
| + | |} | ||
| + | ===Remote=== | ||
| + | {| class="wikitable" | ||
| + | ! Einstellung || Wert | ||
| + | |- | ||
| + | | '''Enabled''' || aktiviert (✓) | ||
| + | |- | ||
| + | | '''Connection''' || it113-it114 | ||
| + | |- | ||
| + | | '''Round''' || 0 | ||
| + | |- | ||
| + | | '''Authentication''' || Pre-Shared Key | ||
| + | |- | ||
| + | | '''Id''' || 192.168.6.114 | ||
| + | |- | ||
| + | | '''Certificates''' || Nothing selected | ||
| + | |- | ||
| + | | '''Description''' || – | ||
| + | |} | ||
| + | ==Children== | ||
| + | ===opnsense.it113.int Children=== | ||
| + | {| class="wikitable" | ||
| + | ! Einstellung || Wert | ||
| + | |- | ||
| + | | '''Enabled''' || aktiviert (✓) | ||
| + | |- | ||
| + | | '''Connection''' || it113-it114 | ||
| + | |- | ||
| + | | '''Mode''' || Tunnel | ||
| + | |- | ||
| + | | '''Policies''' || aktiviert (✓) | ||
| + | |- | ||
| + | | '''Start action''' || Start | ||
| + | |- | ||
| + | | '''DPD action''' || Clear | ||
| + | |- | ||
| + | | '''Reqid''' || 10 | ||
| + | |- | ||
| + | | '''ESP Proposals''' || aes256-sha256-modp4096 [DH16] | ||
| + | |- | ||
| + | | '''Local''' || 172.20.24.1 | ||
| + | |- | ||
| + | | '''Remote''' || 172.16.114.0/24 | ||
| + | |- | ||
| + | | '''Description''' || – | ||
| + | |} | ||
| + | =VPN: IPsec: Security Policy Database= | ||
| + | ==Manual== | ||
| + | {| class="wikitable" | ||
| + | ! Einstellung !! Wert | ||
| + | |- | ||
| + | | enabled || aktiviert (✓) | ||
| + | |- | ||
| + | | Reqid || | ||
| + | |- | ||
| + | | Connection child || it113-it114 | ||
| + | |- | ||
| + | | Source network || 172.16.113.0/24 | ||
| + | |- | ||
| + | | Destination network || 172.16.114.0/24 | ||
| + | |- | ||
| + | | Description || | ||
|} | |} | ||
Aktuelle Version vom 2. Mai 2025, 06:47 Uhr
Ziel
- Unser lokales Netz (172.16.113.0/24) darf nicht direkt in ein externes Netz (172.16.114.0/24) kommunizieren.
- Die Kommunikation erfolgt deshalb über eine zugewiesene Pseudo-IP (172.20.24.1/32).
- Pakete aus unserem Netz werden via NAT auf diese einzelne IP übersetzt, bevor sie in das externe Netz gesendet werden.
- Das externe Netz sieht nur unsere Pseudo-IP (172.20.24.1), niemals unsere tatsächlichen Adressen.
- NAT erfolgt im IPsec-Tunnel selbst; hierzu sind manuelle SPD-Einträge nötig, um Pakete überhaupt erst in den Tunnel zu bringen.
Plan
Szenario
| Einstellung | opnsense.it113.int | opnsense2.it114.int |
|---|---|---|
| IP Address | 192.168.6.113 | 192.168.6.114 |
| Internes Netz | 172.16.113.0/24 | 172.16.114.0/24 |
| Zugeteilte VPN IP | 172.20.24.1/32 | X |
| Pre-Shared Key (PSK) | 123Start$ | |
| Phase 1 | AES256 – SHA256 – DH16 | |
| Phase 2 | AES256 – SHA256 – DH16 | |
opnsense.it113.int PSK
| Einstellung | Wert |
|---|---|
| Local Identifier | 192.168.6.113 |
| Remote Identifier | 192.168.6.114 |
| Pre-Shared Key | 123Start$ |
| Type | PSK |
| Description | – |
VPN: IPsec: Connections
opnsense.it113.int Connections
| Einstellung | Wert |
|---|---|
| Enabled | aktiviert (✓) |
| Proposals | es256-sha256-modp4096 [DH16] |
| Version | IKEv2 |
| MOBIKE | deaktiviert |
| Local addresses | 192.168.6.113 |
| Remote addresses | 192.168.6.114 |
| DPD delay (s) | – |
| Pools | Nothing selected |
| Description | it113-it114 |
VPN: IPsec: Connections
opnsense.it113.int Authentication
Local
| Einstellung | Wert |
|---|---|
| Enabled | aktiviert (✓) |
| Connection | it113-it114 |
| Round | 0 |
| Authentication | Pre-Shared Key |
| Id | 192.168.6.113 |
| Certificates | Nothing selected |
| Description | – |
Remote
| Einstellung | Wert |
|---|---|
| Enabled | aktiviert (✓) |
| Connection | it113-it114 |
| Round | 0 |
| Authentication | Pre-Shared Key |
| Id | 192.168.6.114 |
| Certificates | Nothing selected |
| Description | – |
Children
opnsense.it113.int Children
| Einstellung | Wert |
|---|---|
| Enabled | aktiviert (✓) |
| Connection | it113-it114 |
| Mode | Tunnel |
| Policies | aktiviert (✓) |
| Start action | Start |
| DPD action | Clear |
| Reqid | 10 |
| ESP Proposals | aes256-sha256-modp4096 [DH16] |
| Local | 172.20.24.1 |
| Remote | 172.16.114.0/24 |
| Description | – |
VPN: IPsec: Security Policy Database
Manual
| Einstellung | Wert |
|---|---|
| enabled | aktiviert (✓) |
| Reqid | |
| Connection child | it113-it114 |
| Source network | 172.16.113.0/24 |
| Destination network | 172.16.114.0/24 |
| Description |
