VPN gateway (IKEv2 Roadwarriors and IPV6)

Hello,

My company is setting up a routeros VPN gateway, our ambision is to serve Roadwarrior-client via both openvpn, wireguard and IPSec, IKEv2 via Radius/EAP. We need truly universal conectivity via both IPv4 and IPv6. That means that the clients can connect via a pure IPv6 connection or a pure IPv4 connection, snd access both IPv4 and IPv6 servers on the internal network.

Wireguard is already testet thorughly and work like a charm on both IP-stacks.

Ipsec+IKEv2 however is mostly working, we are using letsencrypt certifcates and are able to tunnel clients both via both the IPv4-Internet and the IPV6-internet, but we are struggeling with providing IPv6-connectivity to the internal IPv6-resources.

IPv4-addresses are being provided via modeconfig and a IPv4-pool, or via the Framed IPv4-radius attribute, but we have not found a way to give internal IPv6 addresses to our clients. It doesen’t seem like it is possible to create a IPv6 address pool, only prefix pools are configurable, but if there are other workarounds like specify IPv6 addresses manually, we are interested.

I find these post on the topic:

http://forum.mikrotik.com/t/ipsec-mode-config-with-ipv6-address-pool/139161/3

http://forum.mikrotik.com/t/how-to-assign-an-ipv6-address-to-an-ipsec-roadwarrior-client/166639/1


Openvpn, have not yet been testet, so I was hoping the fourm could share some experiences there, we want to use both UDP and TCP on the server/vpn-gateway, to get through more firewalls. But is there any limitations we should be aware of?

Thank you in advance

I recommend running a proper IPsec server either elsewhere or in a docker container.

What do you suggest? A strongswan-container in router os? It might be doable. Not certain how that things will be with hardware crypto-support, though.

But anyway, we’d really want to run everything on mikrotik. I know things can move slowly with them, and have been festering support about at least updating the documentation regarding this.

It should be fixable for them, it is a shame that in 2024, Ipv6 support for IPv6-clients is a struggle, opnsense/pfsense does this out of the box. But to Mikrotik’s deffence, Windows 10 at least, require a cli-command to force IPv6 trafic through the tunnel in the bult-in ipsec implimentation.

I was vondering if it is posible to somehow specify an IPv6 address on the client config, similar to how Wireguard work. If it is doable at least strongswan-clients could, that could be temporary solution, but I haven’t done any research.

There seems to be a possible workaround, but I have just started to experiment with it following the same config-outline as when one configures wireguard.

The basic idea would be to instead of using mode-config, define an identity connected to each user:

/ip ipsec identity add auth-method=eap-radius certificate=letsencrypt-autogen_2024-02-05T11:19:41Z,lets-encrypt-r3 generate-policy=port-strict peer=peer-ikev2 policy-template-group=ikev2-group remote-id=user-fqdn:[ EAP USER NAME]

And then for each user, create a policy for IPv4 and IPv6

/ip ipsec policy add dst-address=[Roadwarrior IPv6-address]/128 level=unique peer=peer-ikev2 proposal=ikev2-proposal tunnel=yes
/ip ipsec policy add dst-address=[Roadwarrior IPv4-address]/32 level=unique peer=peer-ikev2 proposal=ikev2-proposal src-address=0.0.0.0/0 tunnel=yes

Then the client need to set an virtual [Roadwarrior IPv4-address]/32 and [Roadwarrior IPv6-address]/128 either in the ipsec-client/config or on a local interface (virtual or real). I just experimented somewhat with strongswan, and was able to send IPv6-traffic into the local nettwork over IPsec, but I could only get the client (strongswan/Mikrotik) to create one P2-entry. So I need to look at this more closely.

A working solution! (workaround)

Create a policy Group for each Roadwarrior:

/ip ipsec policy group add name=[ Policy Group for Road Warrior ]

Create an identity:

 
 
/ip ipsec identity add auth-method=eap-radius certificate=letsencrypt-autogen_2024-02-05T11:19:41Z,lets-encrypt-r3 generate-policy=port-strict peer=peer-ikev2 policy-template-group=[ Policy Group for Road Warrior ]  remote-id=user-fqdn:[ EAP USER NAME]

Create templates for IPv4 and IPv6:

/ip ipsec policy add dst-address=[Roadwarrior IPv6-address]/128 group=[ Policy Group for Road Warrior ]  proposal=ikev2-proposal template=yes
/ip ipsec policy add dst-address=[Roadwarrior IPv4-address]/32 group=[ Policy Group for Road Warrior ] proposal=ikev2-proposal src-address=0.0.0.0/0 template=yes

Now my strongswan config (work in progress):

conn ikev2-roadwarrior
    auto=start
    right=[ FQDN of VPN GW]
    rightid=%any
    rightsubnet=0.0.0.0/0
    rightauth=pubkey
    leftsubnet=[Roadwarrior IPv4-address]32
    leftid=[ EAP USER NAME]
    leftauth=eap-mschapv2
    eap_identity=[ EAP USER NAME]

conn net-host
        also=ikev2-roadwarrior
        leftsubnet=[Roadwarrior IPv6-address]/128
        rightsubnet=::/0

Two P2-entries gets established and traffic flows both over IPv4 and IPv6.