FireBrick Road Warrior strongSwan: Difference between revisions
Appearance
Content deleted Content added
m AA-Andrew moved page FireBrick to Debian strongSwan to FireBrick Road Warrior strongSwan |
|||
| (23 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
<indicator name="RoadW">[[File:Menu-Road-Warrior.svg|link=:Category: |
<indicator name="RoadW">[[File:Menu-Road-Warrior.svg|link=:Category:FireBrick IPsec Road Warrior|30px|Back up to the FireBrick Road Warrior Category Page]]</indicator> |
||
'''FireBrick acting as the ipsec 'server', and configuring a strongSwan/Debian client.''' |
|||
| ⚫ | |||
| ⚫ | |||
See also: [[FireBrick to Openswan Strongswan IPsec (Howto)]] |
|||
==Install Packages== |
==Install Packages== |
||
$ sudo apt-get install strongswan libcharon-extra-plugins |
$ sudo apt-get install strongswan libcharon-extra-plugins |
||
You may also want <tt>libstrongswan-extra-plugins</tt> if you need the curl plugin for strongswan to fetch CA certificates (eg from Let's Encrypt). |
|||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
| ⚫ | |||
Usually you can use ACME and Letsencrypt to assign a certificate to the FireBrick, so skip the next step if you're doing this. |
|||
| ⚫ | |||
If you're using a Let's Encrypt cert on the FireBrick (which is easy) - you'll need to symlink the system CA: |
|||
ln -s /etc/ssl/certs/ISRGRootX1.pem /etc/ipsec.d/cacerts/ISRGRootX1.pem |
|||
==strongSwan Config== |
==strongSwan Config== |
||
| Line 20: | Line 31: | ||
Add your connection to /etc/ipsec.conf: |
Add your connection to /etc/ipsec.conf: |
||
<syntaxhighlight lang=" |
<syntaxhighlight lang="ini"> |
||
conn |
conn firebrick # Arbitrary name - doesn't have to be 'firebrick' |
||
left=%defaultroute # Use your default route to the internet |
left=%defaultroute # Use your default route to the internet |
||
leftfirewall=yes # Yes as you may be behind firewall/NAT |
leftfirewall=yes # Yes as you may be behind firewall/NAT |
||
leftauth=eap-mschapv2 # Match the EAP method defined on FireBrick |
leftauth=eap-mschapv2 # Match the EAP method defined on FireBrick |
||
leftid=@peer-ID # Peer ID as defined in FB IPsec IKE setting |
leftid=@peer-ID # Peer ID as defined in FB IPsec IKE setting |
||
leftsourceip=%config # Ask for an IP from the roaming pool |
leftsourceip=%config # Ask for an IP from the roaming pool |
||
eap_identity=username # Username as in ipsec.secrets and FB config |
eap_identity=username # Username as in ipsec.secrets and FB config |
||
right=hostname.example.com # Hostname/IP of FireBrick |
right=hostname.example.com # Hostname/IP of FireBrick |
||
rightauth=pubkey # FireBrick should be set to auth-method Certificate |
rightauth=pubkey # FireBrick should be set to auth-method Certificate |
||
rightid=@hostname.example.com # ID of FireBrick |
rightid=@hostname.example.com # ID of FireBrick |
||
auto= |
auto=route # Try to connect on startup |
||
</syntaxhighlight> |
|||
If the FireBrick is configured to give an IPv6 address in the Roaming pool, then tell strongSwan to request IPv6 too: |
|||
<syntaxhighlight lang="ini"> |
|||
leftsourceip=%config4,%config6 |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
| Line 46: | Line 62: | ||
Here's some StrongSwan info on split tunnelling: https://wiki.strongswan.org/projects/strongswan/wiki/ForwardingAndSplitTunneling |
Here's some StrongSwan info on split tunnelling: https://wiki.strongswan.org/projects/strongswan/wiki/ForwardingAndSplitTunneling |
||
You use leftsubnet on the strongSwan roadwarrior to determine whether to use the tunnel as default gateway - you'd need leftsubnet=0.0.0.0/0 to ensure all traffic used the tunnel, and leftsubnet=<serverLAN> for split tunnelling. |
You use <tt>leftsubnet</tt> on the strongSwan roadwarrior to determine whether to use the tunnel as default gateway - you'd need <tt>leftsubnet=0.0.0.0/0</tt> to ensure all traffic used the tunnel, and <tt>leftsubnet=<serverLAN></tt> for split tunnelling. |
||
For example: |
For example: |
||
<syntaxhighlight> |
<syntaxhighlight lang="ini"> |
||
leftsourceip=%config4,%config6 |
leftsourceip=%config4,%config6 |
||
rightsubnet=0.0.0.0/0,::/0 |
rightsubnet=0.0.0.0/0,::/0 |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
If you want to route additional blocks via the tunnel, use rightsubnet, eg: |
|||
| ⚫ | |||
<syntaxhighlight lang="ini"> |
|||
rightsubnet=10.1.0.0/24,10.2.0.0/24,fd00:1::/64,fd00:1::/64 # IPs to route down tunnel |
|||
</syntaxhighlight> |
|||
== Further help== |
|||
ipsec up <username> # manually attempt to bring up the connection - look for errors |
|||
ipsec listcacerts # check if your cert is loaded |
|||
ipsec statusall |
|||
| ⚫ | |||