This is my settings:-
[code]
/interface ethernet
set [ find default-name=ether2 ] name=LAN
set [ find default-name=ether1 ] name=WAN
/ip ipsec policy group
add name=group-vpn
/ip ipsec profile
add dh-group=modp2048,modp1536,modp1024 enc-algorithm=aes-256,aes-192,aes-128 \
hash-algorithm=sha256 name=profile-vpn
/ip ipsec peer
add exchange-mode=ike2 local-address=172.30.7.90 name=peer-WAN passive=yes \
profile=profile-vpn
/ip ipsec proposal
add auth-algorithms=sha512,sha256,sha1 enc-algorithms="aes-256-cbc,aes-256-ctr\
,aes-256-gcm,aes-192-ctr,aes-192-gcm,aes-128-cbc,aes-128-ctr,aes-128-gcm" \
lifetime=8h name=proposal-vpn pfs-group=none
/ip pool
add name=pool-vpn ranges=172.30.7.91-172.30.7.95
/ip ipsec mode-config
add address-pool=pool-vpn address-prefix-length=32 name=modeconf-vpn \
split-include=172.30.6.0/24 system-dns=no
/tool user-manager customer
set admin access=\
own-routers,own-users,own-profiles,own-limits,config-payment-gw
/ip address
add address=172.30.7.90/24 interface=WAN network=172.30.7.0
add address=172.30.6.200/24 interface=LAN network=172.30.6.0
/ip cloud
set update-time=no
/ip dns
set allow-remote-requests=yes servers=8.8.8.8,8.8.4.4
/ip firewall filter
add action=accept chain=input comment="IPSec Policies" dst-port=500,4500 \
protocol=udp
add action=accept chain=input protocol=ipsec-esp
add action=accept chain=forward ipsec-policy=in,ipsec
add action=accept chain=forward ipsec-policy=out,ipsec
/ip firewall nat
add action=masquerade chain=srcnat out-interface=WAN
/ip ipsec identity
add auth-method=digital-signature certificate=Router generate-policy=\
port-strict match-by=certificate mode-config=modeconf-vpn peer=peer-WAN \
policy-template-group=group-vpn remote-certificate=
amgad@new.test.org \
remote-id=user-fqdn:
amgad@new.test.org
/ip ipsec policy
add dst-address=172.30.7.0/24 group=group-vpn proposal=proposal-vpn \
src-address=0.0.0.0/0 template=yes
/ip route
add distance=1 gateway=172.30.7.225
/tool user-manager database
set db-path=user-manager
[/code]
I Was adding certificate like this
[code]
/certificate add name=my.new.test.org common-name=my.new.test.org subject-alt-name=DNS:my.new.test.org days-valid=3650 key-size=2048 organization=new.test.org key-usage=crl-sign,key-cert-sign
/certificate add name=template-Router common-name=remote.new.test.org subject-alt-name=DNS:my.new.test.org days-valid=1095 key-size=2048 organization=new.test.org key-usage=tls-server
/certificate add name=template-User common-name=Template subject-alt-name=email:
template@new.test.org days-valid=396 key-size=2048 organization=new.test.org key-usage=tls-client
/certificate add name=CA copy-from=my.new.test.org
/certificate add name=Router copy-from=template-Router
/certificate add name=
amgad@new.test.org copy-from=template-User
/certificate sign CA
/certificate set trusted=yes CA
/certificate sign Router ca=CA
/certificate set trusted=yes Router
/certificate sign
amgad@new.test.org ca=CA
/certificate set trusted=yes
amgad@new.test.org
/certificate export-certificate CA type=pem
/certificate export-certificate Router type=pem
/certificate export-certificate
amgad@new.test.org type=pkcs12 export-passphrase=Mewa#60@2021
[/code]
On win10 I Apply this from admin power shell:-
[code]
$certpass = $(ConvertTo-SecureString -String "Mewa#60@2021" -AsPlainText -Force)
Push-Location "C:\Users\steen\Desktop\CertsFromMikrotik"
Import-Certificate -FilePath 'cert_export_CA.crt' -CertStoreLocation Cert:\LocalMachine\root
Import-Certificate -FilePath 'cert_export_Router.crt' -CertStoreLocation Cert:\LocalMachine\CA
Import-PfxCertificate -FilePath '
cert_export_amgad@new.test.org.p12' -CertStoreLocation Cert:\LocalMachine\My -Password $certpass
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($(Join-Path -Path $(Get-Location) -ChildPath cert_export_CA.crt))
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($(Join-Path -Path $(Get-Location) -ChildPath cert_export_CA.crt))
[/code]
Then create VPN connection
[code]
Add-VpnConnection -Name "I2KE" -ServerAddress "My Public IP" -TunnelType Ikev2 -SplitTunneling -EncryptionLevel Required -AuthenticationMethod MachineCertificate -MachineCertificateIssuerFilter $cert
[/code]
Now I receive this error when try to connect :- " IKE authentication credentials are unacceptable "
One note this "my.new.test.org" and this "
amgad@new.test.org" are not real exiting domain or email as I do not have a domain name just a local LAN
Please Help