Hi,
I almost completely set up my Mikrotik Router (RB5009) for my home, including VLANs, Firewall etc., which was not that hard until now.
I also set up Wireguard as an always-connected-solution for my mobile phone, which then has limited access to my network (DNS and smart home devices). So if the mobile phone is lost, I am not too worried about the fact that it is connected to my home.
But sometimes, just sometimes, I need to access other devices on my LAN when I am on-the-go. For example, I want to access sensitive data on my NAS. For that case I want an additional step of security, i.e. I want my Phone to ask me for a password, when I want to connect to the home-vpn.
On iOS I can set it to always ask for the vpn-password when using IKEv2 with user/password or IKEv1 with XAuth user/password. As I am aiming for the most simplistic setup (no certificates, not RADIUS server, single vpn user etc.), I guess the XAuth approach would suit my need. But I am a little lost in the IPSec world (no experience yet). I found some examples for RouterOS v6, but nothing for v7.
Do you guys know some good RouterOS v7 IPSec XAuth example, or even better: Does someone here has such a config running and wants to share? ![]()
This is what I did so far:
/ip ipsec profile
add dh-group=modp2048 enc-algorithm=aes-256 hash-algorithm=sha512 name=profile1
/ip ipsec peer
add name=peer1 passive=yes profile=profile1 send-initial-contact=no
/ip ipsec proposal
add auth-algorithms=sha256 enc-algorithms=aes-256-cbc lifetime=1h name=proposal1 pfs-group=modp2048
/ip pool
add name=ipsec_pool ranges=10.0.55.2-10.0.55.20
/ip ipsec mode-config
add address-pool=ipsec_pool name=cfg1 static-dns=10.0.123.2 system-dns=no
/ip ipsec identity
add auth-method=pre-shared-key-xauth mode-config=cfg1 password=PASSWORD peer=peer1 secret=PSK username=USERNAME
/ip ipsec policy
add dst-address=10.0.55.0/24 proposal=proposal1 src-address=0.0.0.0/0 template=yes
And I can see that the authentication is working when connecting with my iPhone. My user shows up on „Active Peers“ tab in the ipsec window. I can also see it in the logs. I also see that the VPN client got an IP from the correct pool. But the iPhone keeps showing „connecting“ until it shows an error. So I am obviously missing something … like policies or firewall rules.
ipsec,info respond new phase 1 (Identity Protection): 10.0.200.1[500]<=>10.0.200.245[500]
ipsec,info ISAKMP-SA established 10.0.200.1[500]-10.0.200.245[500] spi:398537e1c565d841:d10ffbdd9f6e9248
ipsec,info,account XAuth login succeeded for user: USERNAME
ipsec,info acquired 10.0.55.19 address for 10.0.200.245[500]
...
ipsec,info purging ISAKMP-SA 10.0.200.1[500]<=>10.0.200.245[500] spi=398537e1c565d841:d10ffbdd9f6e9248:00000e05.
ipsec,info ISAKMP-SA deleted 10.0.200.1[500]-10.0.200.245[500] spi:398537e1c565d841:d10ffbdd9f6e9248 rekey:0
ipsec,info releasing address 10.0.55.19
Best regards