My Tik is behind NAT (due to ISP), and it gets an internal IP from them.
I want to setup an IKE2 VPN Server on this Tik to allow my Android phone to be part of the LAN.
Phone (192.168.0.10) ----> ISP1 (192.168.0.1, 4.3.2.1) -----> INTERNET -----> ISP2 (8.7.6.5, 192.168.1.1) -----> TIK (192.168.1.10) (192.168.2.1)
I have followed a tutorial from internet, with some adjustments. I'm currently on version 6.46.6.
These were my steps:
1.) Create the CA certificate which will validate all incoming connections
###Replace common name with Public DNS name of VPN appliance
/certificate add common-name="vpn.yourdomain.com Root CA" name=ca days-valid=3650
/certificate sign ca ca-crl-host=192.168.2.1
2.) Create and sign VPN Server's certificate
/certificate add common-name=vpn.yourdomain.com key-usage=tls-server name=vpnserver1 days-valid=3650
/certificate sign vpnserver1 ca=ca
3.) Create and sign a client certificate
/certificate add common-name=android key-usage=tls-client name=android days-valid=3650
/certificate sign android ca=ca
4.) Create a new bridge for VPN connections to make it easier to manage with custom rules
/interface bridge add name=vpn-bridge
/ip address add interface=vpn-bridge address=192.168.200.1/24 comment="VPN Bridge IP"
5.) Create a new pool from which VPN clients can get their IPs
/ip pool add name=vpn-pool ranges=192.168.200.100-192.168.200.200
6.) Create a new IPSec entity (ModeConfig, Proposal, Profile, Peer, Policy, Identity):
#Add mode config to use our pool with VPN Bridge's IP as DNS
/ip ipsec mode-config add
address-pool=vpn-pool address-prefix-length=32 name=vpn-config system-dns=no static-dns=192.168.200.1
/ip ipsec proposal add
name=vpn-clients auth-algorithms=sha1,sha256 enc-algorithms=aes-128-cbc,aes-256-cbc pfs-group=modp2048
/ip ipsec profile add
dh-group=modp1024,modp2048 enc-algorithm=aes-256 hash-algorithm=sha256 name=vpn-profile
/ip ipsec peer add
name=vpn-peer address=0.0.0.0/0 exchange-mode=ike2 passive=yes profile=vpn-profile
/ip ipsec policy group add
name=vpn
/ip ipsec policy add
template=yes src-address=0.0.0.0/0 dst-address=192.168.200.0/24 proposal=vpn-clients group=vpn
/ip ipsec identity add
peer=vpn-peer auth-method=digital-signature certificate=vpnserver1 generate-policy=port-strict mode-config=vpn-config policy-template-group=vpn
7.) Export certificates from Tik, and import into Android (successful), I can share these details, but no errors were happened, so let me know if needed.
8.) Try connecting: with vpn.yourdomain.com as address, and with CA and "android" client certificates. Android says "Unsuccessful" after 10-15seconds.
Extra info: I have forwarded UDP ports 500 and 4500 in ISP2 Router (to 192.168.1.10).
I have no clue on why it fails, can you please help me with either just looking into my config (I might misconfigured something), either with some tips on debug, or on what to check, what to see in Tik while android is trying to connect.
Thank you very much.