summaryrefslogtreecommitdiff
path: root/docs/configuration/vpn/site2site_ipsec.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/configuration/vpn/site2site_ipsec.rst')
-rw-r--r--docs/configuration/vpn/site2site_ipsec.rst156
1 files changed, 74 insertions, 82 deletions
diff --git a/docs/configuration/vpn/site2site_ipsec.rst b/docs/configuration/vpn/site2site_ipsec.rst
index 2fa59dc1..68f6c48b 100644
--- a/docs/configuration/vpn/site2site_ipsec.rst
+++ b/docs/configuration/vpn/site2site_ipsec.rst
@@ -8,26 +8,18 @@ to exchange encrypted information between them and VyOS itself or
connected/routed networks.
To configure site-to-site connection you need to add peers with the
-``set vpn ipsec site-to-site`` command.
+``set vpn ipsec site-to-site peer <name>`` command.
-You can identify a remote peer with:
-
-* IPv4 or IPv6 address. This mode is easiest for configuration and mostly used
- when a peer has a public static IP address;
-* Hostname. This mode is similar to IP address, only you define DNS name instead
- of an IP. Could be used when a peer has a public IP address and DNS name, but
- an IP address could be changed from time to time;
-* Remote ID of the peer. In this mode, there is no predefined remote address
- nor DNS name of the peer. This mode is useful when a peer doesn't have a
- publicly available IP address (NAT between it and VyOS), or IP address could
- be changed.
+The peer name must be an alphanumeric and can have hypen or underscore as
+special characters. It is purely informational.
Each site-to-site peer has the next options:
* ``authentication`` - configure authentication between VyOS and a remote peer.
Suboptions:
- * ``id`` - ID for the local VyOS router. If defined, during the authentication
+ * ``local-id`` - ID for the local VyOS router. If defined, during the
+ authentication
it will be send to remote peer;
* ``mode`` - mode for authentication between VyOS and remote peer:
@@ -96,26 +88,25 @@ Each site-to-site peer has the next options:
* ``dhcp-interface`` - use an IP address, received from DHCP for IPSec
connection with this peer, instead of ``local-address``;
-* ``force-encapsulation`` - force encapsulation of ESP into UDP datagrams.
+* ``force-udp-encapsulation`` - force encapsulation of ESP into UDP datagrams.
Useful in case if between local and remote side is firewall or NAT, which not
allows passing plain ESP packets between them;
* ``ike-group`` - IKE group to use for key exchanges;
* ``ikev2-reauth`` - reauthenticate remote peer during the rekeying process.
- Can be used only with IKEv2:
-
- * ``yes`` - create a new IKE_SA from the scratch and try to recreate all
- IPsec SAs;
-
- * ``no`` - rekey without uninstalling the IPsec SAs;
-
- * ``inherit`` - use default behavior for the used IKE group.
+ Can be used only with IKEv2.
+ Create a new IKE_SA from the scratch and try to recreate all IPsec SAs;
* ``local-address`` - local IP address for IPSec connection with this peer.
If defined ``any``, then an IP address which configured on interface with
default route will be used;
+* ``remote-address`` - remote IP address or hostname for IPSec connection.
+ IPv4 or IPv6 address is used when a peer has a public static IP address.
+ Hostname is a DNS name which could be used when a peer has a public IP
+ address and DNS name, but an IP address could be changed from time to time.
+
* ``tunnel`` - define criteria for traffic to be matched for encrypting and send
it to a peer:
@@ -170,50 +161,46 @@ Example:
.. code-block:: none
# server config
- set vpn ipsec esp-group office-srv-esp compression 'disable'
set vpn ipsec esp-group office-srv-esp lifetime '1800'
set vpn ipsec esp-group office-srv-esp mode 'tunnel'
set vpn ipsec esp-group office-srv-esp pfs 'enable'
set vpn ipsec esp-group office-srv-esp proposal 1 encryption 'aes256'
set vpn ipsec esp-group office-srv-esp proposal 1 hash 'sha1'
- set vpn ipsec ike-group office-srv-ike ikev2-reauth 'no'
set vpn ipsec ike-group office-srv-ike key-exchange 'ikev1'
set vpn ipsec ike-group office-srv-ike lifetime '3600'
set vpn ipsec ike-group office-srv-ike proposal 1 encryption 'aes256'
set vpn ipsec ike-group office-srv-ike proposal 1 hash 'sha1'
- set vpn ipsec ipsec-interfaces interface 'eth1'
- set vpn ipsec site-to-site peer 203.0.113.2 authentication mode 'pre-shared-secret'
- set vpn ipsec site-to-site peer 203.0.113.2 authentication pre-shared-secret 'SomePreSharedKey'
- set vpn ipsec site-to-site peer 203.0.113.2 ike-group 'office-srv-ike'
- set vpn ipsec site-to-site peer 203.0.113.2 local-address '198.51.100.3'
- set vpn ipsec site-to-site peer 203.0.113.2 tunnel 0 allow-nat-networks 'disable'
- set vpn ipsec site-to-site peer 203.0.113.2 tunnel 0 allow-public-networks 'disable'
- set vpn ipsec site-to-site peer 203.0.113.2 tunnel 0 esp-group 'office-srv-esp'
- set vpn ipsec site-to-site peer 203.0.113.2 tunnel 0 local prefix '192.168.0.0/24'
- set vpn ipsec site-to-site peer 203.0.113.2 tunnel 0 remote prefix '10.0.0.0/21'
+ set vpn ipsec interface 'eth1'
+ set vpn ipsec site-to-site peer OFFICE-B authentication mode 'pre-shared-secret'
+ set vpn ipsec site-to-site peer OFFICE-B authentication pre-shared-secret 'SomePreSharedKey'
+ set vpn ipsec site-to-site peer OFFICE-B authentication remote-id '203.0.113.2'
+ set vpn ipsec site-to-site peer OFFICE-B ike-group 'office-srv-ike'
+ set vpn ipsec site-to-site peer OFFICE-B local-address '198.51.100.3'
+ set vpn ipsec site-to-site peer OFFICE-B remote-address '203.0.113.2'
+ set vpn ipsec site-to-site peer OFFICE-B tunnel 0 esp-group 'office-srv-esp'
+ set vpn ipsec site-to-site peer OFFICE-B tunnel 0 local prefix '192.168.0.0/24'
+ set vpn ipsec site-to-site peer OFFICE-B tunnel 0 remote prefix '10.0.0.0/21'
# remote office config
- set vpn ipsec esp-group office-srv-esp compression 'disable'
set vpn ipsec esp-group office-srv-esp lifetime '1800'
set vpn ipsec esp-group office-srv-esp mode 'tunnel'
set vpn ipsec esp-group office-srv-esp pfs 'enable'
set vpn ipsec esp-group office-srv-esp proposal 1 encryption 'aes256'
set vpn ipsec esp-group office-srv-esp proposal 1 hash 'sha1'
- set vpn ipsec ike-group office-srv-ike ikev2-reauth 'no'
set vpn ipsec ike-group office-srv-ike key-exchange 'ikev1'
set vpn ipsec ike-group office-srv-ike lifetime '3600'
set vpn ipsec ike-group office-srv-ike proposal 1 encryption 'aes256'
set vpn ipsec ike-group office-srv-ike proposal 1 hash 'sha1'
- set vpn ipsec ipsec-interfaces interface 'eth1'
- set vpn ipsec site-to-site peer 198.51.100.3 authentication mode 'pre-shared-secret'
- set vpn ipsec site-to-site peer 198.51.100.3 authentication pre-shared-secret 'SomePreSharedKey'
- set vpn ipsec site-to-site peer 198.51.100.3 ike-group 'office-srv-ike'
- set vpn ipsec site-to-site peer 198.51.100.3 local-address '203.0.113.2'
- set vpn ipsec site-to-site peer 198.51.100.3 tunnel 0 allow-nat-networks 'disable'
- set vpn ipsec site-to-site peer 198.51.100.3 tunnel 0 allow-public-networks 'disable'
- set vpn ipsec site-to-site peer 198.51.100.3 tunnel 0 esp-group 'office-srv-esp'
- set vpn ipsec site-to-site peer 198.51.100.3 tunnel 0 local prefix '10.0.0.0/21'
- set vpn ipsec site-to-site peer 198.51.100.3 tunnel 0 remote prefix '192.168.0.0/24'
+ set vpn ipsec interface 'eth1'
+ set vpn ipsec site-to-site peer OFFICE-A authentication mode 'pre-shared-secret'
+ set vpn ipsec site-to-site peer OFFICE-A authentication pre-shared-secret 'SomePreSharedKey'
+ set vpn ipsec site-to-site peer OFFICE-A authentication remote-id '198.51.100.3'
+ set vpn ipsec site-to-site peer OFFICE-A ike-group 'office-srv-ike'
+ set vpn ipsec site-to-site peer OFFICE-A local-address '203.0.113.2'
+ set vpn ipsec site-to-site peer OFFICE-A remote-address '198.51.100.3'
+ set vpn ipsec site-to-site peer OFFICE-A tunnel 0 esp-group 'office-srv-esp'
+ set vpn ipsec site-to-site peer OFFICE-A tunnel 0 local prefix '10.0.0.0/21'
+ set vpn ipsec site-to-site peer OFFICE-A tunnel 0 remote prefix '192.168.0.0/24'
Show status of new setup:
@@ -292,30 +279,28 @@ Imagine the following topology
set interfaces vti vti10 address '10.0.0.2/31'
- set vpn ipsec esp-group ESP_DEFAULT compression 'disable'
set vpn ipsec esp-group ESP_DEFAULT lifetime '3600'
set vpn ipsec esp-group ESP_DEFAULT mode 'tunnel'
set vpn ipsec esp-group ESP_DEFAULT pfs 'dh-group19'
set vpn ipsec esp-group ESP_DEFAULT proposal 10 encryption 'aes256gcm128'
set vpn ipsec esp-group ESP_DEFAULT proposal 10 hash 'sha256'
- set vpn ipsec ike-group IKEv2_DEFAULT ikev2-reauth 'no'
set vpn ipsec ike-group IKEv2_DEFAULT key-exchange 'ikev2'
set vpn ipsec ike-group IKEv2_DEFAULT lifetime '10800'
- set vpn ipsec ike-group IKEv2_DEFAULT mobike 'disable'
+ set vpn ipsec ike-group IKEv2_DEFAULT disable-mobike
set vpn ipsec ike-group IKEv2_DEFAULT proposal 10 dh-group '19'
set vpn ipsec ike-group IKEv2_DEFAULT proposal 10 encryption 'aes256gcm128'
set vpn ipsec ike-group IKEv2_DEFAULT proposal 10 hash 'sha256'
- set vpn ipsec ipsec-interfaces interface 'eth0.201'
- set vpn ipsec site-to-site peer 172.18.202.10 authentication id '172.18.201.10'
- set vpn ipsec site-to-site peer 172.18.202.10 authentication mode 'pre-shared-secret'
- set vpn ipsec site-to-site peer 172.18.202.10 authentication pre-shared-secret 'secretkey'
- set vpn ipsec site-to-site peer 172.18.202.10 authentication remote-id '172.18.202.10'
- set vpn ipsec site-to-site peer 172.18.202.10 connection-type 'respond'
- set vpn ipsec site-to-site peer 172.18.202.10 ike-group 'IKEv2_DEFAULT'
- set vpn ipsec site-to-site peer 172.18.202.10 ikev2-reauth 'inherit'
- set vpn ipsec site-to-site peer 172.18.202.10 local-address '192.168.0.10'
- set vpn ipsec site-to-site peer 172.18.202.10 vti bind 'vti10'
- set vpn ipsec site-to-site peer 172.18.202.10 vti esp-group 'ESP_DEFAULT'
+ set vpn ipsec interface 'eth0.201'
+ set vpn ipsec site-to-site peer OFFICE-B authentication local-id '172.18.201.10'
+ set vpn ipsec site-to-site peer OFFICE-B authentication mode 'pre-shared-secret'
+ set vpn ipsec site-to-site peer OFFICE-B authentication pre-shared-secret 'secretkey'
+ set vpn ipsec site-to-site peer OFFICE-B authentication remote-id '172.18.202.10'
+ set vpn ipsec site-to-site peer OFFICE-B connection-type 'respond'
+ set vpn ipsec site-to-site peer OFFICE-B ike-group 'IKEv2_DEFAULT'
+ set vpn ipsec site-to-site peer OFFICE-B local-address '192.168.0.10'
+ set vpn ipsec site-to-site peer OFFICE-B remote-address '172.18.202.10'
+ set vpn ipsec site-to-site peer OFFICE-B vti bind 'vti10'
+ set vpn ipsec site-to-site peer OFFICE-B vti esp-group 'ESP_DEFAULT'
**right**
@@ -323,7 +308,6 @@ Imagine the following topology
set interfaces vti vti10 address '10.0.0.3/31'
- set vpn ipsec esp-group ESP_DEFAULT compression 'disable'
set vpn ipsec esp-group ESP_DEFAULT lifetime '3600'
set vpn ipsec esp-group ESP_DEFAULT mode 'tunnel'
set vpn ipsec esp-group ESP_DEFAULT pfs 'dh-group19'
@@ -332,31 +316,30 @@ Imagine the following topology
set vpn ipsec ike-group IKEv2_DEFAULT dead-peer-detection action 'restart'
set vpn ipsec ike-group IKEv2_DEFAULT dead-peer-detection interval '30'
set vpn ipsec ike-group IKEv2_DEFAULT dead-peer-detection timeout '120'
- set vpn ipsec ike-group IKEv2_DEFAULT ikev2-reauth 'no'
set vpn ipsec ike-group IKEv2_DEFAULT key-exchange 'ikev2'
set vpn ipsec ike-group IKEv2_DEFAULT lifetime '10800'
- set vpn ipsec ike-group IKEv2_DEFAULT mobike 'disable'
+ set vpn ipsec ike-group IKEv2_DEFAULT disable-mobike
set vpn ipsec ike-group IKEv2_DEFAULT proposal 10 dh-group '19'
set vpn ipsec ike-group IKEv2_DEFAULT proposal 10 encryption 'aes256gcm128'
set vpn ipsec ike-group IKEv2_DEFAULT proposal 10 hash 'sha256'
- set vpn ipsec ipsec-interfaces interface 'eth0.202'
- set vpn ipsec site-to-site peer 172.18.201.10 authentication id '172.18.202.10'
- set vpn ipsec site-to-site peer 172.18.201.10 authentication mode 'pre-shared-secret'
- set vpn ipsec site-to-site peer 172.18.201.10 authentication pre-shared-secret 'secretkey'
- set vpn ipsec site-to-site peer 172.18.201.10 authentication remote-id '172.18.201.10'
- set vpn ipsec site-to-site peer 172.18.201.10 connection-type 'initiate'
- set vpn ipsec site-to-site peer 172.18.201.10 ike-group 'IKEv2_DEFAULT'
- set vpn ipsec site-to-site peer 172.18.201.10 ikev2-reauth 'inherit'
- set vpn ipsec site-to-site peer 172.18.201.10 local-address '172.18.202.10'
- set vpn ipsec site-to-site peer 172.18.201.10 vti bind 'vti10'
- set vpn ipsec site-to-site peer 172.18.201.10 vti esp-group 'ESP_DEFAULT'
+ set vpn ipsec interface 'eth0.202'
+ set vpn ipsec site-to-site peer OFFICE-A authentication local-id '172.18.202.10'
+ set vpn ipsec site-to-site peer OFFICE-A authentication mode 'pre-shared-secret'
+ set vpn ipsec site-to-site peer OFFICE-A authentication pre-shared-secret 'secretkey'
+ set vpn ipsec site-to-site peer OFFICE-A authentication remote-id '172.18.201.10'
+ set vpn ipsec site-to-site peer OFFICE-A connection-type 'initiate'
+ set vpn ipsec site-to-site peer OFFICE-A ike-group 'IKEv2_DEFAULT'
+ set vpn ipsec site-to-site peer OFFICE-A local-address '172.18.202.10'
+ set vpn ipsec site-to-site peer OFFICE-A remote-address '172.18.201.10'
+ set vpn ipsec site-to-site peer OFFICE-A vti bind 'vti10'
+ set vpn ipsec site-to-site peer OFFICE-A vti esp-group 'ESP_DEFAULT'
Key Parameters:
-* ``authentication id/remote-id`` - IKE identification is used for validation
- of VPN peer devices during IKE negotiation. If you do not configure local/
- remote-identity, the device uses the IPv4 or IPv6 address that corresponds
- to the local/remote peer by default.
+* ``authentication local-id/remote-id`` - IKE identification is used for
+ validation of VPN peer devices during IKE negotiation. If you do not configure
+ local/remote-identity, the device uses the IPv4 or IPv6 address that
+ corresponds to the local/remote peer by default.
In certain network setups (like ipsec interface with dynamic address, or
behind the NAT ), the IKE ID received from the peer does not match the IKE
gateway configured on the device. This can lead to a Phase 1 validation
@@ -370,7 +353,7 @@ Key Parameters:
* ``dead-peer-detection action = clear | hold | restart`` - R_U_THERE
notification messages(IKEv1) or empty INFORMATIONAL messages (IKEv2)
- are periodically sent in order to check the liveliness of theIPsec peer. The
+ are periodically sent in order to check the liveliness of the IPsec peer. The
values clear, hold, and restart all activate DPD and determine the action to
perform on a timeout.
With ``clear`` the connection is closed with no further actions taken.
@@ -384,6 +367,15 @@ Key Parameters:
values). A closeaction should not be used if the peer uses reauthentication or
uniqueids.
- For a responder, close-action or dead-peer-detection must not be enabled.
- For an initiator DPD with `restart` action, and `close-action 'restart'`
- is recommended in IKE profile.
+ When the close-action option is set on the peers, the connection-type
+ of each peer has to considered carefully. For example, if the option is set
+ on both peers, then both would attempt to initiate and hold open multiple
+ copies of each child SA. This might lead to instability of the device or
+ cpu/memory utilization.
+
+ Below flow-chart could be a quick reference for the close-action
+ combination depending on how the peer is configured.
+
+.. figure:: /_static/images/IPSec_close_action_settings.jpg
+
+ Similar combinations are applicable for the dead-peer-detection.