Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Diffie-Hellman (DH) key exchange protocol allows two parties without any initial shared secret to create one securely. The following Modular Exponential (MODP) and Elliptic Curve (EC2N) ECP Diffie-Hellman (also known as "Oakley") Groups are supported:

Diffie-Hellman GroupNameReference
Group 1768 bits MODP groupRFC 2409
Group 21024 bits MODP groupRFC 2409
Group 3EC2N group on GP(2^155)RFC 2409
Group 4EC2N group on GP(2^185)RFC 2409
Group 51536 bits MODP groupRFC 3526
Group 142048 bits MODP groupRFC 3526
Group 153072 bits MODP groupRFC 3526
Group 164096 bits MODP groupRFC 3526
Group 176144 bits MODP groupRFC 3526
Group 188192 bits MODP groupRFC 3526
Group 19256 bits random ECP groupRFC 5903
Group 20384 bits random ECP groupRFC 5903
Group 21521 bits random ECP groupRFC 5903

More on standards can be found found here.

IKE Traffic

To avoid problems with IKE packets hit some SPD rule and require to encrypt it with not yet established SA (that this packet perhaps is trying to establish), locally originated packets with UDP source port 500 are not processed with SPD. The same way packets with UDP destination port 500 that are to be delivered locally are not processed in incoming policy checks.

Setup Procedure

To get IPsec to work with automatic keying using IKE-ISAKMP you will have to configure policy, peer, and proposal (optional) entries.

Larger DH groups offer better security but require more CPU power. Here are a few commonly used DH groups with varying levels of security and CPU impact:

DH Group 14 (2048-bit) - Provides a reasonable balance between security and CPU usage. It offers 2048-bit key exchange, which is considered secure for most applications today and is widely supported.

DH Group 5 (1536-bit) - Offers a slightly lower level of security compared to DH Group 14 but has a lower CPU impact due to the smaller key size. It is still considered secure for many scenarios.

DH Group 2 (1024-bit) - Should be used with caution because it provides the least security among commonly used groups. It has a lower CPU impact but is susceptible to attacks, especially as computational power increases. It's generally not recommended for new deployments.

For optimal security, it's advisable to use DH Group 19. It's considered fast and secure. However, DH Group 14 might give large load for your router, DH Group 5 can be a reasonable compromise between security and performance. DH Group 2 should generally be avoided unless you have legacy devices that require it.

Info

The correct way of calculating security for your network infrastructure would be to choose how many bits of security you want and you could see how long it would require to decrypt your data, then you have to choose algorithms. Please see information for reference https://www.keylength.com/en/4/


IKE Traffic

To avoid problems with IKE packets hit some SPD rule and require to encrypt it with not yet established SA (that this packet perhaps is trying to establish), locally originated packets with UDP source port 500 are not processed with SPD. The same way packets with UDP destination port 500 that are to be delivered locally are not processed in incoming policy checks.

Setup Procedure

To get IPsec to work with automatic keying using IKE-ISAKMP you will have to configure policy, peer, and proposal (optional) entries.

Warning

IPsec is very sensitive to time changes. If both ends of the IPsec tunnel are not synchronizing time equally(for example,

Warning

IPsec is very sensitive to time changes. If both ends of the IPsec tunnel are not synchronizing time equally(for example, different NTP servers not updating time with the same timestamp), tunnels will break and will have to be established again.

...

EAP-TLS on Windows is called "Smart Card or other certificates".

Info

Using ed25519 - authentication is not yet supported.

Authentication Header (AH)

...

nonoyesyes*************nonono
CPUDES and 3DESAES-CBCAES-CTRAES-GCM
MD5SHA1SHA256SHA512MD5SHA1SHA256SHA512MD5SHA1SHA256SHA512MD5SHA1SHA256SHA512
88F7040noyesyesyesnoyesyesyesnoyesyesyesnonoyesyesyes
AL21400yesyesyesyesyesyesyesyesyesyesyesyesyesyesyesyes
AL32400yesyesyesyesyesyesyesyesyesyesyesyesyesyesyesyes
AL52400yesyesyesyesyesyesyesyesyesyesyesyesyesyesyesyes
AL73400yesyesyesyesyesyesyesyesyesyesyesyesyesyesyesyes
IPQ-4018 / IPQ-4019noyesyesnonoyes*yes*nonoyes*yes*nonononono
IPQ-5018 yes yes yes no yes yes yes no yes yes yes no no no no no
IPQ-6010nononononoyesyesyesnoyesyesyesnoyesyesyes
IPQ-8064noyesyesnonoyes*yes*nonoyes*yes*nonononono
MT7621Ayes****yes****yes****nonoyesyesyesnonononononononono
P1023NSN5CFBnonononoyes**yes**yes**yes**nononoyes*nonononono
MT7621AP202ASSE2KFByesyesyesnoyesyesyesyesnononononononono
P1023NSN5CFB PPC460GTnonononoyes***yes***yes***yes***nononoyes***yes***yes***yes***nononono
P202ASSE2KFBTLR4 (TILE)yesyesyesnoyesyesyesnoyesyesyesnonononono
x86 (AES-NI)nononono PPC460GTnononoyes***yes***yes***yes***yes***yes***yes***yes***yes***yes***yes***yes****yes***nononono
TLR4 (TILE)yesyesyesnoyesyesyesnoyesyesyesnonononono
x86 (AES-NI)nonononoyes***yes***yes***yes***yes***yes***yes***yes***yes***yes***yes***yes***

* supported only 128 bit and 256 bit key sizes

** only manufactured since 2016, serial numbers that begin with number 5 and 7

*** AES-CBC and AES-CTR only encryption is accelerated, hashing done in software

**** DES is not supported, only 3DES and AES-CBC

IPsec throughput results of various encryption and hash algorithm combinations are published on the MikroTik products page.

Policies

The policy table is used to determine whether security settings should be applied to a packet.

Properties

*

* supported only 128 bit and 256 bit key sizes

** only manufactured since 2016, serial numbers that begin with number 5 and 7

*** AES-CBC and AES-CTR only encryption is accelerated, hashing done in software

**** DES is not supported, only 3DES and AES-CBC

IPsec throughput results of various encryption and hash algorithm combinations are published on the MikroTik products page.

Policies

The policy table is used to determine whether security settings should be applied to a packet.

Properties

PropertyDescription
action (discard | encrypt | none; Default: encrypt)Specifies what to do with the packet matched by the policy.
  • none - pass the packet unchanged.
  • discard - drop the packet.
  • encrypt - apply transformations specified in this policy and it's SA.
comment (string; Default: )Short description of the policy.
disabled (yes | no; Default: no)Whether a policy is used to match packets.
dst-address (IP/IPv6 prefix; Default: 0.0.0.0/32)Destination address to be matched in packets. Applicable when tunnel mode (tunnel=yes) or template (template=yes) is used.
dst-port (integer:0..65535 | any; Default: any)Destination port to be matched in packets. If set to any all ports will be matched.
group (string; Default: default)Name of the policy group to which this template is assigned.
ipsec-protocols (ah | esp; Default: esp)Specifies what combination of Authentication Header and Encapsulating Security Payload protocols you want to apply to matched traffic.
level (require | unique | use; Default: require)Specifies what to do if some of the SAs for this policy cannot be found:
  • use - skip this transform, do not drop the packet, and do not acquire SA from IKE daemon;
  • require - drop the packet and acquire SA;
  • unique - drop the packet and acquire a unique SA that is only used with this particular policy. It is used in setups where multiple clients can sit behind one public IP address (clients behind NAT).
peer (string; Default: )Name of the peer on which the policy applies.
proposal (string; Default: default)Name of the proposal template that will be sent by IKE daemon to establish SAs for this policy.
protocol (all | egp | ggp| icmp | igmp | ...; Default: all)IP packet protocol to match.
src-address (ip/ipv6 prefix; Default: 0.0.0.0/32)Source address to be matched in packets. Applicable when tunnel mode (tunnel=yes) or template (template=yes) is used.
src-port (any | integer:0..65535; Default: any)Source port to be matched in packets. If set to any all ports will be matched.
template
PropertyDescription
action (discard | encrypt | none; Default: encrypt)Specifies what to do with the packet matched by the policy.
  • none - pass the packet unchanged.
  • discard - drop the packet.
  • encrypt - apply transformations specified in this policy and it's SA.
comment (string; Default: )Short description of the policy.
disabled (yes | no; Default: no)Whether a policy is used to match packets.Creates a template and assigns it to a specified policy group.

Following parameters are used by template:

  • group - name of the policy group to which this template is assigned;
  • src-address, dst-address - Requested subnet must match in both directions(for example
dst-address (IP/IPv6 prefix; Default:
  • 0.0.0.0/
32
  • 0 to allow all)
Destination address to be matched in packets. Applicable when tunnel mode (tunnel=yes) or template (template=yes) is used.
dst-port (integer:0..65535 | any; Default: any)Destination port to be matched in packets. If set to any all ports will be matched.
group (string; Default: default)Name of the policy group to which this template is assigned.
ipsec-protocols (ah | esp; Default: esp)Specifies what combination of Authentication Header and Encapsulating Security Payload protocols you want to apply to matched traffic.
level (require | unique | use; Default: require)Specifies what to do if some of the SAs for this policy cannot be found:
  • use - skip this transform, do not drop the packet, and do not acquire SA from IKE daemon;
  • require - drop the packet and acquire SA;
  • unique - drop the packet and acquire a unique SA that is only used with this particular policy. It is used in setups where multiple clients can sit behind one public IP address (clients behind NAT).
peer (string; Default: )Name of the peer on which the policy applies.
proposal (string; Default: default)Name of the proposal template that will be sent by IKE daemon to establish SAs for this policy.
protocol (all | egp | ggp| icmp | igmp | ...; Default: all)IP packet protocol to match.
  • ;
  • protocol - protocol to match, if set to all, then any protocol is accepted;
  • proposal - SA parameters used for this template;
  • level - useful when unique is required in setups with multiple clients behind NAT.
tunnel (yes | no; Default: no)Specifies whether to use tunnel mode.

Read-only properties

PropertyDescription
active (yes | no)Whether this policy is currently in use.
default (yes | no)Whether this is a default system entry.
dynamic (yes | no)Whether this is a dynamically added or generated entry.
invalid (yes | no)Whether this policy is invalid - the possible cause is a duplicate policy with the same src-address and dst-address.
ph2-count (integer)A number of active phase 2 sessions associated with the policy.
ph2-state (expired | no-phase2 | established)Indication of the progress of key establishing.
sa-dst-address (ip/ipv6 address; Default: ::)SA destination IP/IPv6 address (remote peer).
sa-src-address (ip/ipv6 prefixaddress; Default: 0.0.0.0/32)Source address to be matched in packets. Applicable when tunnel mode (tunnel=yes) or template (template=yes) is used.
src-port (any | integer:0..65535; Default: any)Source port to be matched in packets. If set to any all ports will be matched.
template (yes | no; Default: no)Creates a template and assigns it to a specified policy group.

Following parameters are used by template:

  • group - name of the policy group to which this template is assigned;
  • src-address, dst-address - Requested subnet must match in both directions(for example 0.0.0.0/0 to allow all);
  • protocol - protocol to match, if set to all, then any protocol is accepted;
  • proposal - SA parameters used for this template;
  • level - useful when unique is required in setups with multiple clients behind NAT.
tunnel (yes | no; Default: no)Specifies whether to use tunnel mode.
::)SA source IP/IPv6 address (local peer).


Warning

Policy order is important starting from v6.40. Now it works similarly to firewall filters where policies are executed from top to bottom (priority parameter is removed).


Note

All packets are IPIP encapsulated in tunnel mode, and their new IP header's src-address and dst-address are set to sa-src-address and sa-dst-address values of this policy. If you do not use tunnel mode (id est you use transport mode), then only packets whose source and destination addresses are the same as sa-src-address and sa-dst-address can be processed by this policy. Transport mode can only work with packets that originate at and are destined for IPsec peers (hosts that established security associations). To encrypt traffic between networks (or a network and a host) you have to use tunnel mode.

Statistics

This menu shows various IPsec statistics and errors.

Read-only properties

PropertyDescription
active (yes | no)Whether this policy is currently in use.
default (yes | no)Whether this is a default system entry.
dynamic (yes | no)Whether this is a dynamically added or generated entry.
invalid (yes | no)Whether this policy is invalid - the possible cause is a duplicate policy with the same src-address and dst-address.
ph2-count (integer)A number of active phase 2 sessions associated with the policy.
ph2-state (expired | no-phase2 | established)Indication of the progress of key establishing.
sa-dst-address (ip/ipv6 address; Default: ::)SA destination IP/IPv6 address (remote peer).
sa-src-address (ip/ipv6 address; Default: ::)SA source IP/IPv6 address (local peer).
Warning

Policy order is important starting from v6.40. Now it works similarly to firewall filters where policies are executed from top to bottom (priority parameter is removed).

Note

All packets are IPIP encapsulated in tunnel mode, and their new IP header's src-address and dst-address are set to sa-src-address and sa-dst-address values of this policy. If you do not use tunnel mode (id est you use transport mode), then only packets whose source and destination addresses are the same as sa-src-address and sa-dst-address can be processed by this policy. Transport mode can only work with packets that originate at and are destined for IPsec peers (hosts that established security associations). To encrypt traffic between networks (or a network and a host) you have to use tunnel mode.

Statistics

This menu shows various IPsec statistics and errors.

Read-only properties

in-errors (integer)All inbound errors that are not matched by other counters.
in-buffer-errors (integer)No free buffer.
in-header-errors (integer)Header error.
in-no-states (integer)No state is found i.e. either inbound SPI, address, or IPsec protocol at SA is wrong.
in-state-protocol-errors (integer)Transformation protocol-specific error, for example, SA key is wrong or hardware accelerator is unable to handle the number of packets.
in-state-mode-errors (integer)Transformation mode-specific error.
in-state-sequence-errors (integer)A sequence number is out of a window.
in-state-expired (integer)The state is expired.
in-state-mismatches (integer)The state has a mismatched option, for example, the UDP encapsulation type is mismatched.
in-state-invalid (integer)The state is invalid.
in-template-mismatches (integer)No matching template for states, e.g. inbound SAs are correct but the SP rule is wrong. A possible cause is a mismatched sa-source or sa-destination address.
in-no-policies (integer)No policy is found for states, e.g. inbound SAs are correct but no SP is found.
in-policy-blocked (integer)Policy discards.
in-policy-errors (integer)Policy errors.
out-errors (integer)All outbound
PropertyDescription
in-errors (integer)All inbound errors that are not matched by other counters.
inout-bufferbundle-errors (integer)No free bufferBundle generation error.
inout-bundle-headercheck-errors (integer)Header Bundle check error.
inout-no-states (integer)No state is found i.e. either inbound SPI, address, or IPsec protocol at SA is wrong.
outin-state-protocol-errors (integer)Transformation protocol-specific error, for example, SA key is wrong or hardware accelerator is unable to handle the number of packets.protocol specific error.
outin-state-mode-errors (integer)Transformation mode-specific error.
inout-state-sequence-errors (integer)A Sequence errors, for example, sequence number is out of a windowoverflow.
inout-state-expired (integer)The state is expired.
inout-statepolicy-mismatchesblocked (integer)The state has a mismatched option, for example, the UDP encapsulation type is mismatchedPolicy discards.
inout-statepolicy-invaliddead (integer)The state policy is invaliddead.
inout-templatepolicy-mismatcheserrors (integer)No matching template for states, e.g. inbound SAs are correct but the SP rule is wrong. A possible cause is a mismatched sa-source or sa-destination address.
in-no-policies (integer)No policy is found for states, e.g. inbound SAs are correct but no SP is found.
in-policy-blocked (integer)Policy discards.
in-policy-errors (integer)Policy errors.
out-errors (integer)All outbound errors that are not matched by other counters.
out-bundle-errors (integer)Bundle generation error.
out-bundle-check-errors (integer)Bundle check error.
out-no-states (integer)No state is found.
out-state-protocol-errors (integer)Transformation protocol specific error.
out-state-mode-errors (integer)Transformation mode-specific error.
out-state-sequence-errors (integer)Sequence errors, for example, sequence number overflow.
out-state-expired (integer)The state is expired.
out-policy-blocked (integer)Policy discards.
out-policy-dead (integer)The policy is dead.
out-policy-errors (integer)Policy error.

Proposals

Policy error.

Proposals

Proposal information that will be sent by IKE daemons to establish SAs for certain policies.


Properties

PropertyDescription
auth-algorithms (md5|null|sha1|sha256|sha512; Default: sha1)Allowed algorithms for authorization. SHA (Secure Hash Algorithm) is stronger but slower. MD5 uses a 128-bit key, sha1-160bit key.
comment (string; Default: )
disabled (yes | no; Default: no)Whether an item is disabled.
enc-algorithms (null|des|3des|aes-128-cbc|aes-128-cbc|aes-128gcm|aes-192-cbc|aes-192-ctr|aes-192-gcm|aes-256-cbc|aes-256-ctr|aes-256-gcm|blowfish|camellia-128|camellia-192|camellia-256|twofish; Default: aes-256-cbc,aes-192-cbc,aes-128-cbc)Allowed algorithms and key lengths to use for SAs.
lifetime (time; Default: 30m)How long to use SA before throwing it out.
name (string; Default: )
pfs-group (ecp256 | ecp384 | ecp521 | modp768 | modp1024 | modp1536 | modp2048 | modp3072 | modp4096 | modp6144 | modp8192 | none; Default: modp1024)The diffie-Helman group used for Perfect Forward Secrecy.


Read-only properties

PropertyDescription
default (yes | no)Whether this is a default system entry.

Groups

In this menu, it is possible to create additional policy groups used by policy templates.


Properties

PropertyDescription
name (string; Default: )
comment (string; Default: )

Peers

Peer configuration settings are used to establish connections between IKE daemons. This connection then will be used to negotiate keys and algorithms for SAs. Exchange mode is the only unique identifier between the peers, meaning that there can be multiple peer configurations with the same remote-address as long as a different exchange-mode is usedProposal information that will be sent by IKE daemons to establish SAs for certain policies.

Properties

PropertyDescription
auth-algorithms (md5|null|sha1|sha256|sha512; Default: sha1)
address (IP/IPv6 Prefix; Default: 0.0.0.0/0)If the remote peer's address matches this prefix, then the peer configuration is used in authentication and establishment of Phase 1. If several peer's addresses match several configuration entries, the most specific one (i.e. the one with the largest netmask) will be used.
Allowed algorithms for authorization. SHA (Secure Hash Algorithm) is stronger but slower. MD5 uses a 128-bit key, sha1-160bit key.
comment (string; Default: )Short description of the peer.
disabled (yes | no; Default: no)Whether
an item is disabled
peer is used to matching remote peer's prefix.
enc
exchange-
algorithms
mode (
null
aggressive |
des
base |
3des|aes-128-cbc|aes-128-cbc|aes-128gcm|aes-192-cbc|aes-192-ctr|aes-192-gcm|aes-256-cbc|aes-256-ctr|aes-256-gcm|blowfish|camellia-128|camellia-192|camellia-256|twofish
main | ike2; Default: main)Different ISAKMP phase 1 exchange modes according to RFC 2408. the main mode relaxes rfc2409 section 5.4, to allow pre-shared-key authentication in the main mode. ike2 mode enables Ikev2 RFC 7296. Parameters that are ignored by IKEv2 proposal-check, compatibility-options, lifebytes, dpd-maximum-failures, nat-traversal.
local-address (IP/IPv6 Address; Default: )Routers local address on which Phase 1 should be bounded to
; Default: aes-256-cbc,aes-192-cbc,aes-128-cbc)Allowed algorithms and key lengths to use for SAs.lifetime (time; Default: 30m)How long to use SA before throwing it out
.
name (string; Default: )
pfs-group

passive (
ec2n155 | ec2n185 | ecp256 | ecp384 | ecp521 | modp768 | modp1024 | modp1536 | modp2048 | modp3072 | modp4096 | modp6144 | modp8192 | none; Default: modp1024)The diffie-Helman group used for Perfect Forward Secrecy.

...

Groups

In this menu, it is possible to create additional policy groups used by policy templates.

...

Peers

Peer configuration settings are used to establish connections between IKE daemons. This connection then will be used to negotiate keys and algorithms for SAs. Exchange mode is the only unique identifier between the peers, meaning that there can be multiple peer configurations with the same remote-address as long as a different exchange-mode is used.

Properties

...

Read-only properties

...

Identities

Identities are configuration parameters that are specific to the remote peer. The main purpose of identity is to handle authentication and verify the peer's integrity.

Properties

...

  • digital-signature - authenticate using a pair of RSA certificates;
  • eap - IKEv2 EAP authentication for initiator (peer with a netmask of /32). Must be used together with eap-methods;
  • eap-radius - IKEv2 EAP RADIUS passthrough authentication for the responder (RFC 3579). A server certificate in this case is required. If a server certificate is not specified then only clients supporting EAP-only (RFC 5998) will be able to connect. Note that the EAP method should be compatible with EAP-only;
  • pre-shared-key - authenticate by a password (pre-shared secret) string shared between the peers (not recommended since an offline attack on the pre-shared key is possible);
  • rsa-key - authenticate using an RSA key imported in keys menu. Only supported in IKEv1;
  • pre-shared-key-xauth - authenticate by a password (pre-shared secret) string shared between the peers + XAuth username and password. Only supported in IKEv1;
  • rsa-signature-hybrid - responder certificate authentication with initiator XAuth. Only supported in IKEv1.

...

  • eap-mschapv2;
  • eap-peap - also known as PEAPv0/EAP-MSCHAPv2;
  • eap-tls - requires additional client certificate specified under certificate parameter;
  • eap-ttls.

...

  • no - do not generate policies;
  • port-override - generate policies and force policy to use any port (old behavior);
  • port-strict - use ports from peer's proposal, which should match peer's policy.

...

  • remote-id - will verify the peer's ID according to remote-id setting.
  • certificate will verify the peer's certificate with what is specified under remote-certificate setting.

...

  • auto - tries to use correct ID automatically: IP for pre-shared key, SAN (DN if not present) for certificate based connections;
  • address - IP address is used as ID;
  • dn - The binary Distinguished Encoding Rules (DER) encoding of an ASN.1 X.500 Distinguished Name;
  • fqdn - fully qualified domain name;
  • key-id - use the specified key ID for the identity;
  • user fqdn - specifies a fully-qualified username string, for example, "user@domain.com".

...

  • auto - accept all ID's;
  • fqdn - fully qualified domain name. Only supported in IKEv2;
  • user fqdn - a fully-qualified username string, for example, "user@domain.com". Only supported in IKEv2;
  • key-id - specific key ID for the identity. Only supported in IKEv2;
  • ignore - do not verify received ID with certificate (dangerous).

...

yes | no; Default: no)When a passive mode is enabled will wait for a remote peer to initiate an IKE connection. The enabled passive mode also indicates that the peer is xauth responder, and disabled passive mode - xauth initiator. When a passive mode is a disabled peer will try to establish not only phase1 but also phase2 automatically, if policies are configured or created during the phase1.
port (integer:0..65535; Default: 500)Communication port used (when a router is an initiator) to connect to remote peer in cases if remote peer uses the non-default port.
profile (string; Default: default)Name of the profile template that will be used during IKE negotiation.
send-initial-contact (yes | no; Default: yes)Specifies whether to send "initial contact" IKE packet or wait for remote side, this packet should trigger the removal of old peer SAs for current source address. Usually, in road warrior setups clients are initiators and this parameter should be set to no. Initial contact is not sent if modecfg or xauth is enabled for ikev1.

Read-only properties

PropertyDescription
dynamic (yes | no)Whether this is a dynamically added entry by a different service (e.g L2TP).
responder (yes | no)Whether this peer will act as a responder only (listen to incoming requests) and not initiate a connection.

Profiles

Profiles define a set of parameters that will be used for IKE negotiation during Phase 1. These parameters may be common with other peer configurations.

Properties

PropertyDescription
dh-group (modp768 | modp1024  | modp1536 | modp2048 | modp3072 | modp4096 | modp6144 | modp8192 | ecp256 | ecp384 | ecp521; Default: modp1024,modp2048)Diffie-Hellman group (cipher strength).
dpd-interval (time | disable-dpd; Default: 2m)Dead peer detection interval. If set to disable-dpd, dead peer detection will not be used.
dpd-maximum-failures (integer: 1..100; Default: 5)Maximum count of failures until peer is considered to be dead. Applicable if DPD is enabled.
enc-algorithm (3des | aes-128 | aes-192 | aes-256 | blowfish | camellia-128 | camellia-192 | camellia-256 | des; Default: aes-128)List of encryption algorithms that will be used by the peer.
hash-algorithm (md5 | sha1 | sha256 | sha512; Default: sha1)Hashing algorithm. SHA (Secure Hash Algorithm) is stronger, but slower. MD5 uses 128-bit key, sha1-160bit key.
lifebytes (Integer: 0..4294967295; Default: 0)Phase 1 lifebytes is used only as administrative value which is added to proposal. Used in cases if remote peer requires specific lifebytes value to establish phase 1.
lifetime (time; Default: 1d)Phase 1 lifetime: specifies how long the SA will be valid.
name (string; Default: )
nat-traversal (yes | no; Default: yes)Use Linux NAT-T mechanism to solve IPsec incompatibility with NAT routers between IPsec peers. This can only be used with ESP protocol (AH is not supported by design, as it signs the complete packet, including the IP header, which is changed by NAT, rendering AH signature invalid). The method encapsulates IPsec ESP traffic into UDP streams in order to overcome some minor issues that made ESP incompatible with NAT.
proposal-check (claim | exact | obey | strict; Default: obey)Phase 2 lifetime check logic:
  • claim - take shortest of proposed and configured lifetimes and notify initiator about it
  • exact - require lifetimes to be the same
  • obey - accept whatever is sent by an initiator
  • strict - if the proposed lifetime is longer than the default then reject the proposal otherwise accept a proposed lifetime

Identities

Identities are configuration parameters that are specific to the remote peer. The main purpose of identity is to handle authentication and verify the peer's integrity.

Properties

PropertyDescription
auth-method (digital-signature | eap | eap-radius | pre-shared-key | pre-shared-key-xauth | rsa-key | rsa-signature-hybrid; Default: pre-shared-key)Authentication method:
  • digital-signature - authenticate using a pair of RSA certificates;
  • eap - IKEv2 EAP authentication for initiator (peer with a netmask of /32). Must be used together with eap-methods;
  • eap-radius - IKEv2 EAP RADIUS passthrough authentication for the responder (RFC 3579). A server certificate in this case is required. If a server certificate is not specified then only clients supporting EAP-only (RFC 5998) will be able to connect. Note that the EAP method should be compatible with EAP-only;
  • pre-shared-key - authenticate by a password (pre-shared secret) string shared between the peers (not recommended since an offline attack on the pre-shared key is possible);
  • rsa-key - authenticate using an RSA key imported in keys menu. Only supported in IKEv1;
  • pre-shared-key-xauth - authenticate by a password (pre-shared secret) string shared between the peers + XAuth username and password. Only supported in IKEv1;
  • rsa-signature-hybrid - responder certificate authentication with initiator XAuth. Only supported in IKEv1.
certificate (string; Default: )Name of a certificate listed in System/Certificates (signing packets; the certificate must have the private key). Applicable if digital signature authentication method (auth-method=digital-signature) or EAP (auth-method=eap) is used.
comment (string; Default: )Short description of the identity.
disabled (yes | no; Default: no)Whether identity is used to match remote peers.
eap-methods (eap-mschapv2 | eap-peap | eap-tls | eap-ttls; Default: eap-tls)All EAP methods requires whole certificate chain including intermediate and root CA certificates to be present in System/Certificates menu. Also, the username and password (if required by the authentication server) must be specified. Multiple EAP methods may be specified and will be used in a specified order. Currently supported EAP methods:
  • eap-mschapv2;
  • eap-peap - also known as PEAPv0/EAP-MSCHAPv2;
  • eap-tls - requires additional client certificate specified under certificate parameter;
  • eap-ttls.
generate-policy (no | port-override | port-strict; Default: no)Allow this peer to establish SA for non-existing policies. Such policies are created dynamically for the lifetime of SA. Automatic policies allows, for example, to create IPsec secured L2TP tunnels, or any other setup where remote peer's IP address is not known at the configuration time.
  • no - do not generate policies;
  • port-override - generate policies and force policy to use any port (old behavior);
  • port-strict - use ports from peer's proposal, which should match peer's policy.
key (string; Default: )Name of the private key from keys menu. Applicable if RSA key authentication method (auth-method=rsa-key) is used.
match-by (remote-id | certificate; Default: remote-id)Defines the logic used for peer's identity validation.
  • remote-id - will verify the peer's ID according to remote-id setting.
  • certificate will verify the peer's certificate with what is specified under remote-certificate setting.
mode-config (none | *request-only | string; Default: none)Name of the configuration parameters from mode-config menu. When parameter is set mode-config is enabled.
my-id (auto | address | fqdn | user-fqdn | key-id; Default: auto)On initiator, this controls what ID_i is sent to the responder. On responder, this controls what ID_r is sent to the initiator. In IKEv2, responder also expects this ID in received ID_r from initiator.
  • auto - tries to use correct ID automatically: IP for pre-shared key, SAN (DN if not present) for certificate based connections;
  • address - IP address is used as ID;
  • dn - the binary Distinguished Encoding Rules (DER) encoding of an ASN.1 X.500 Distinguished Name;
  • fqdn - fully qualified domain name;
  • key-id - use the specified key ID for the identity;
  • user fqdn - specifies a fully-qualified username string, for example, "user@domain.com".
notrack-chain (string; Default: )Adds IP/Firewall/Raw rules matching IPsec policy to a specified chain. Use together with generate-policy.
password (string; Default: )XAuth or EAP password. Applicable if pre-shared key with XAuth authentication method (auth-method=pre-shared-key-xauth) or EAP (auth-method=eap) is used.
peer (string; Default: )Name of the peer on which the identity applies.
policy-template-group (none | string; Default: default)If generate-policy is enabled, traffic selectors are checked against templates from the same group. If none of the templates match, Phase 2 SA will not be established.
remote-certificate (string; Default: )Name of a certificate (listed in System/Certificates) for authenticating the remote side (validating packets; no private key required). If a remote-certificate is not specified then the received certificate from a remote peer is used and checked against CA in the certificate menu. Proper CA must be imported in a certificate store. If remote-certificate and match-by=certificate is specified, only the specific client certificate will be matched. Applicable if digital signature authentication method (auth-method=digital-signature) is used.
remote-id (auto | fqdn | user-fqdn | key-id | ignore; Default: auto)This parameter controls what ID value to expect from the remote peer. Note that all types except for ignoring will verify remote peer's ID with a received certificate. In case when the peer sends the certificate name as its ID, it is checked against the certificate, else the ID is checked against Subject Alt. Name.
  • auto - accept all ID's;
  • address - IP address is used as ID;
  • dn - the binary Distinguished Encoding Rules (DER) encoding of an ASN.1 X.500 Distinguished Name;
  • fqdn - fully qualified domain name. Only supported in IKEv2;
  • user fqdn - a fully-qualified username string, for example, "user@domain.com". Only supported in IKEv2;
  • key-id - specific key ID for the identity. Only supported in IKEv2;
  • ignore - do not verify received ID with certificate (dangerous).
    * Wildcard key ID matching is not supported, for example remote-id="key-id:CN=*.domain.com"
remote-key (string; Default: )Name of the public key from keys menu. Applicable if RSA key authentication method (auth-method=rsa-key) is used.
secret (string; Default: )Secret string. If it starts with '0x', it is parsed as a hexadecimal value. Applicable if pre-shared key authentication method (auth-method=pre-shared-key and auth-method=pre-shared-key-xauth) is used.
username (string; Default: )XAuth or EAP username. Applicable if pre-shared key with XAuth authentication method (auth-method=pre-shared-key-xauth) or EAP (auth-method=eap) is used.


Read only properties

PropertyDescription
dynamic (yes | no)Whether this is a dynamically added entry by a different service (e.g L2TP).

Active

...

Profiles

Profiles define a set of parameters that will be used for IKE negotiation during Phase 1. These parameters may be common with other peer configurations.

Properties

...

  • claim - take shortest of proposed and configured lifetimes and notify initiator about it
  • exact - require lifetimes to be the same
  • obey - accept whatever is sent by an initiator
  • strict - if the proposed lifetime is longer than the default then reject the proposal otherwise accept a proposed lifetime

Active Peers

This menu provides various statistics about remote peers that currently have established phase 1 connection.

...

PropertyDescription
address (none | string; Default: )Single IP address for the initiator instead of specifying a whole address pool.
address-pool (none | string; Default: )Name of the address pool from which the responder will try to assign address if mode-config is enabled.
address-prefix-length (integer [1..32]; Default: )Prefix length (netmask) of the assigned address from the pool.
comment (string; Default: )
name (string; Default: )
responder (yes | no; Default: no)Specifies whether the configuration will work as an initiator (client) or responder (server). The initiator will request for mode-config parameters from the responder.
split-dnsList of DNS names that will be resolved using a system-dns=yes or static-dns= setting.
split-include (list of IP prefix; Default: )List of subnets in CIDR format, which to tunnel. Subnets will be sent to the peer using the CISCO UNITY extension, a remote peer will create specific dynamic policies.
src-address-list (address list; Default: )Specifying an address list will generate dynamic source NAT rules. This parameter is only available with responder=no. A roadWarrior client with NAT
static-dns (list of IP; Default: )Manually specified DNS server's IP address to be sent to the client.
system-dns (yes | no; Default: )When this option is enabled DNS addresses will be taken from /ip dns.

...

Note

If RouterOS client is initiator, it will always send CISCO UNITY extension, and RouterOS supports only split-include from this extension. 

Both attributes Cisco Unity Split DNS (attribute type 28675) and RFC8598 (attribute type 25) are supported, ROS will answer to these attributes but only as responder. 


Note

It is not possible to use system-dns and static-dns at the same time, ROS can use only one DNS.

Installed SAs

This menu provides information about installed security associations including the keys.

...

PropertyDescription
accounting (yes | no; Default: )Whether to send RADIUS accounting requests to a RADIUS server. Applicable if EAP Radius (auth-method=eap-radius) or pre-shared key with XAuth authentication method (auth-method=pre-shared-key-xauth) is used.
interim-update (time; Default: )The interval between each consecutive RADIUS accounting Interim update. Accounting must be enabled.
xauth-use-radius (yes | no; Default: )Whether to use Radius client for XAuth users or not.  Property is only applicable to peers using the IKEv1 exchange mode.


Application Guides

RoadWarrior client with NAT

...